Trends
Get Trends
Fetch the current top X/Twitter trends for any country or city via API. $0.001 per call. GetXAPI trends endpoint documentation.
GET
/twitter/trendsThis endpoint costs $0.001 per API call.
Fetch the current top X (Twitter) trends for a location — up to 50, in X's own ranking order.
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
country | string | No | A location name — country or city — or an ISO country code, e.g. US, india, japan, tokyo, london, dubai, são paulo (accents optional). ~530 locations resolvable — no need to know WOEIDs. Defaults to worldwide. |
woeid | string | No | Numeric Yahoo WOEID, e.g. 1 = worldwide, 23424977 = USA. Overrides country when both are given. |
count | integer | No | Cap the number of trends returned (X returns up to 50). |
Notes
- Returns the current top trends for a location (up to 50), in X's own ranking order.
- Pass
countryfor convenience, or a rawwoeidfor any location; with neither you get worldwide trends. - Use each trend's
search_url(orquery) with Advanced Search to pull tweets for a trend. tweet_volumeis supplied by X only for some trends and is oftennull.- Need a WOEID for a city the
countryshortcut doesn't cover? Look it up with Trend Locations.
Response (200)
{
"status": "success",
"woeid": 23424977,
"location": "United States",
"as_of": "2026-07-09T04:51:10Z",
"trends_count": 50,
"trends": [
{
"rank": 1,
"name": "#AEWDynamite",
"is_hashtag": true,
"tweet_volume": null,
"query": "#AEWDynamite",
"search_url": "https://x.com/search?q=%23AEWDynamite&src=trend_click",
"promoted": false
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
woeid | number | The resolved location WOEID |
location | string | The resolved location name |
as_of | string | ISO 8601 timestamp of when X computed the list |
trends_count | number | Number of trends returned |
trends[].rank | number | Position in X's ranking |
trends[].name | string | The trend text |
trends[].is_hashtag | boolean | Whether the trend is a hashtag |
trends[].tweet_volume | number | Approximate tweet volume, or null |
trends[].query | string | Search query for the trend |
trends[].search_url | string | X search URL for the trend |
trends[].promoted | boolean | Whether the trend is a promoted (ad) trend |
Error Responses
400 - Unknown location
{
"error": "Unknown location \"narnia\". Use a country name/ISO code, a numeric woeid, or GET /twitter/trends/locations to look one up."
}Example
# Worldwide
curl -X GET "https://api.getxapi.com/twitter/trends" \
-H "Authorization: Bearer API_KEY"
# By country or city
curl -X GET "https://api.getxapi.com/twitter/trends?country=india" \
-H "Authorization: Bearer API_KEY"
# By WOEID, capped to 20
curl -X GET "https://api.getxapi.com/twitter/trends?woeid=23424977&count=20" \
-H "Authorization: Bearer API_KEY"Download SpaceNew
Download an X/Twitter Space as MP3 with an optional transcript via API. $0.05 base + $0.015 per transcript minute. GetXAPI Spaces download endpoint.
Trend LocationsNew
List every location X/Twitter offers trends for, with WOEIDs, via API. $0.001 per call. GetXAPI trend locations endpoint documentation.