GetXAPI
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/trends

This 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

FieldTypeRequiredDescription
countrystringNoA 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.
woeidstringNoNumeric Yahoo WOEID, e.g. 1 = worldwide, 23424977 = USA. Overrides country when both are given.
countintegerNoCap 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 country for convenience, or a raw woeid for any location; with neither you get worldwide trends.
  • Use each trend's search_url (or query) with Advanced Search to pull tweets for a trend.
  • tweet_volume is supplied by X only for some trends and is often null.
  • Need a WOEID for a city the country shortcut 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

FieldTypeDescription
woeidnumberThe resolved location WOEID
locationstringThe resolved location name
as_ofstringISO 8601 timestamp of when X computed the list
trends_countnumberNumber of trends returned
trends[].ranknumberPosition in X's ranking
trends[].namestringThe trend text
trends[].is_hashtagbooleanWhether the trend is a hashtag
trends[].tweet_volumenumberApproximate tweet volume, or null
trends[].querystringSearch query for the trend
trends[].search_urlstringX search URL for the trend
trends[].promotedbooleanWhether 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"

On this page