Twitter (X) Trending Topics

API docs
https://api.sandbase.ai/v1/api/twitter/web/trending

Get trending topics on Twitter / X by country: trend names with their category context, for the United States, Japan, India, the UK and other markets.

Price
$0.001USD / call
Method
POST
Response
JSON
Parameters
0 required · 1 optional
100 free calls / dayFirst 100 calls per day free (shared per organization) · Resets at 00:00 UTC. Pay per call after that.

Playground

Input
Country, default is UnitedStates, other optional values are as follows: China; India; Japan; Russia; Germany; Indonesia; Brazil; France; UnitedKingdom; Turkey; Italy; Mexico; SouthKorea; Canada; Spain; SaudiArabia; Egypt; Australia; Poland; Iran; Pakistan; Vietnam; Nigeria; Bangladesh; Netherlands; Argentina; Philippines; Malaysia; Colombia; UniteArabEmirates; Romania; Belgium; Switzerland; Singapore; Sweden; Norway; Austria; Kazakhstan; Algeria; Chile; Czechia; Peru
OutputExample
Responseoutputs · 476 B · 24 lines
[
  {
    "data": {
      "trends": [
        {
          "context": "Only on X · Trending",
          "description": null,
          "name": "#bb28"
        },
        {
          "context": "Only on X · Trending",
          "description": null,
          "name": "#RaisingKanan"
        },
        {
          "context": "Trending",
          "description": null,
          "name": "#SnoopDoggMV"
        },
        "… 47 more items in the full response"
      ]
    }
  }
]

Examples

Select an example to load its inputs and result into the playground.

API README

Twitter (X) Trending Topics API

Returns the current list of trending topics on Twitter (X) for one country. The only input is the optional country parameter, which defaults to UnitedStates.

Use cases

  • Check which topics trend in Japan, India or the UK at the moment you call.
  • Flag a brand or keyword when its name appears in the name field of a trend.
  • Group trends by their context label, such as NFL, to see which categories dominate a market.
  • Pick topics to search for or write about while they trend.

Request

curl -X POST "https://api.sandbase.ai/v1/api/twitter/web/trending" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
countrystringNoCountry, default is UnitedStates, other optional values are as follows: China; India; Japan; Russia; Germany; Indonesia; Brazil; France; UnitedKingdom; Turkey; Italy; Mexico; SouthKorea; Canada; Spain; SaudiArabia; Egypt

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "trends": [
    {
      "context": "NFL · Trending",
      "description": null,
      "name": "Bears"
    }
  ]
}

Response fields

FieldMeaning
trends[]List of trending topics for the chosen country.
trends[].nameThe trend text as shown on X, for example a team, person or hashtag.
trends[].contextShort label that shows where the trend sits, for example NFL · Trending. The part before the dot names the category.
trends[].descriptionExtra text about the trend. It is null when none is given.

Notes

  • Pass country as a full name without spaces, such as UnitedStates, UnitedKingdom, SouthKorea or SaudiArabia. An empty request returns UnitedStates.
  • The response has no pagination, tweet counts or rank field. The order of trends is the order returned.
  • To see posts about a trend, pass its name to Twitter (X) Search.

Pricing

$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

Explore more

Related APIs

All APIs
APIPriceResponse
Twitter$0.001 per callJSON
Twitter$0.001 per callJSON
Twitter$0.001 per callJSON
Twitter$0.001 per callJSON
Twitter$0.001 per callJSON
Twitter$0.001 per callJSON

Questions

FAQ

How do I use the Twitter (X) Trending Topics API?

Send a POST request to https://api.sandbase.ai/v1/api/twitter/web/trending with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

How much does the Twitter (X) Trending Topics API cost?

$0.001 per call. Every organization gets 100 free calls per UTC day, shared across eligible SandBase APIs including this one; after that each call is billed at this price from your SandBase balance. There is no subscription.

What parameters does the Twitter (X) Trending Topics API accept?

No parameters are required. Optional: country (string). The Parameters table and the Playground on this page list every field.

What does the Twitter (X) Trending Topics API return?

A JSON response returned in the same HTTP request (synchronous). The README on this page includes a sample response.

Do I need a Twitter developer account or API key?

No. Twitter (X) Trending Topics runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Twitter API access separately.