API DocsweiboAccountSearch user posts
Search user posts
What this API is for
- Search for content containing specific keywords in a specified user's posts
GET
/openapi/api/v1/weibo/web_v2/search_user_postsPrice:Price unavailable · Actual charges depend on free quota and account discounts
Authentication
All API requests require a Bearer project token in the Authorization header
Authorization header
Authorization: Bearer YOUR_API_TOKENRequest parameters
- uid: User ID (required)
- q: Search keyword (optional, empty string means search all content)
- page: Page number, starts from 1 (default 1)
- starttime: Start timestamp (optional, Unix timestamp format)
- endtime: End timestamp (optional, Unix timestamp format)
- hasori: Include original posts (default 1 include)
- hasret: Include retweets (default 1 include)
- hastext: Include text posts (default 1 include)
- haspic: Include image posts (default 1 include)
- hasvideo: Include video posts (default 1 include)
- hasmusic: Include music posts (default 1 include)
| Name | Location / type | Required | Notes | Example |
|---|---|---|---|---|
| uid | query / string | Yes |
| 7277477906 |
| q | query / string | No |
| |
| page | query / integer | No |
| 1 |
| starttime | query / integer | null | No |
| 1772294400 |
| endtime | query / integer | null | No |
| 1772294400 |
| hasori | query / integer | No |
| 1 |
| hasret | query / integer | No |
| 1 |
| hastext | query / integer | No |
| 1 |
| haspic | query / integer | No |
| 1 |
| hasvideo | query / integer | No |
| 1 |
| hasmusic | query / integer | No |
| 1 |
Request examples
curl -X GET "https://api.trmesh.com/openapi/api/v1/weibo/web_v2/search_user_posts" \ -H "Authorization: Bearer sdc_your_project_token" \ -H "Accept: application/json"
Response fields
- Search result list, including post content, author info, interaction data
Common response envelope
Common fields for response status, request identifiers and data
| Field | Type | Notes | Example |
|---|---|---|---|
| code | integer |
| |
| request_id | string | null |
| |
| message | string |
| |
| message_zh | string |
| |
| support | string |
| |
| time | string |
| |
| time_stamp | integer |
| |
| time_zone | string |
| |
| docs | string | null |
| |
| cache_message | string | null |
| |
| cache_message_zh | string | null |
| |
| cache_url | string | null |
| |
| router | string |
| |
| params | unknown |
| |
| data | unknown | null |
|
Errors and limits
The docs cover not only success responses, but also auth failures, rate limits, and data-service errors
| Code | Meaning | Notes |
|---|---|---|
| 200 | Success | The request completed and returned the standard response envelope. |
| 401 | Unauthorized | The token is missing, invalid, or no longer active. |
| 429 | Rate limited | The request exceeded token, user, or plan-level throughput limits. |
| 502 | Service unavailable | The gateway could not obtain a healthy result. Retry in a moment. |
Next steps
New to the API? Read the guide or explore examples