Detailed API reference and usage guide
Get Twitter trending topics
| Name | Type | Required | Description |
|---|---|---|---|
| woeid | number | Yes | Where On Earth ID for the region. Common values: 1=Worldwide, 23424819=Japan, 23424977=USA, 2151849=Hong Kong, 23424775=Australia |
{
"success": true,
"data": {
"trends": [
{
"name": "#Bitcoin",
"url": "https://twitter.com/search?q=%23Bitcoin",
"tweet_volume": 125400
}
]
}
}Common business error codes returned by the backend. All APIs use the unified response format: { code, msg, data }.
Note: `code` is the business status code in response body and may differ from HTTP status.
| Code | Name | Description | Recommendation |
|---|---|---|---|
| 200 | Success | Request processed successfully. | Use `data` for business payload. |
| 400 | Bad Request | Invalid parameters or business validation failed. | Check required fields, value ranges, and request format. |
| 401 | Unauthorized | Authentication failed (login required, missing/invalid API key). | Re-login or provide a valid `X-API-Key`. |
| 402 | Insufficient Balance | Insufficient balance or call quota for this request. | Recharge or upgrade your plan and retry. |
| 403 | Forbidden | You do not have permission or account status is restricted. | Check account status and endpoint permission. |
| 404 | Not Found | Requested resource does not exist. | Verify IDs/order numbers and whether data exists. |
| 429 | Rate Limit Exceeded | Request frequency exceeded per-second/per-hour/monthly limits. | Use retry with backoff or lower request frequency. |
| 500 | Internal Server Error | Server-side processing failed. | Retry later and contact support if it persists. |
| 502 | Service Temporarily Unavailable | The service request failed to be processed. | Please try again later. |
| 503 | Service Busy | System is busy or global protection limit is triggered. | Retry after a short wait. |
curl -X GET "https://api.twtapi.com/api/v1/twitter/Trends?lang=en" \ -H "X-API-Key: YOUR_API_KEY" \ -H "X-Lang: en"