WEIR

Twitter Trends API in 2026: X Endpoints, WOEIDs, Cost

What the Twitter trends API offers in 2026, from X's docs: trends by WOEID, personalized trends, their fields, $0.010 per call, and where to find a WOEID.


Published · Updated · 6 min read

Cover image: X trends, two endpoints

The Twitter trends API is now two X endpoints: trends for a place, keyed by a WOEID, and personalized trends for one signed-in user.

This guide is for developers who want a Twitter trending topics API that works on X (Twitter) today. You get the paths, fields, price and WOEIDs. We run Weir, which has no trends endpoint; the last part shows what it does instead.

Your first call, for worldwide trends with post counts:

curl "https://api.x.com/2/trends/by/woeid/1?max_trends=10&trend.fields=trend_name,tweet_count" \
  -H "Authorization: Bearer $X_BEARER_TOKEN"
$0.010per trends request
50trends per call, at most
75WOEID calls per 15 minutes, per app

X's docs list two trends endpoints, as of 22 October 2026:

Endpoint Path Sign-in Fields
By WOEID GET /2/trends/by/woeid/:woeid App or user token Name, post count
Personalized GET /2/users/personalized_trends User token + Premium Name, post count, category, since

We have no X API key, and our token-less call got a 401, so what follows comes from X's docs.

The call takes a WOEID in the path and two optional query parameters:

  • max_trends sets how many trends come back, from 1 to 50. The default is 20.
  • trend.fields picks the fields, trend_name and tweet_count.

Here's a response from X's December 2023 launch post, trimmed to two trends:

{
  "data": [
    { "trend_name": "#NEWACM", "tweet_count": 2101 },
    { "trend_name": "Inflation", "tweet_count": 92763 }
  ]
}

So volume is there, as tweet_count, if you ask for it. X's docs don't say what time window it covers.

An app token works, so a backend can poll it on a schedule.

GET /2/users/personalized_trends returns the trends X picks for that user. X's docs list what it needs:

  • A user access token, through OAuth 2.0 with PKCE.
  • A "Premium User Subscription" on that user's account.
  • Patience: 10 requests per 15 minutes per user, and 100 a day.

It returns trend_name, post_count, category and trending_since. X's spec types post_count as a string, so parse it before you do math.

It takes no location, so it can't stand in for a city's trends.

X's pricing page lists "Trends" at $0.010 per request, as of October 2026. You pay per call, not per trend, and the page doesn't split the two endpoints.

So there's no free Twitter trends API from X: you buy credits first. Our X API pricing guide covers the starter credits.

Polling is where the cost adds up:

Monthly cost of polling X trends, October 2026
1 place, every hour$7.20
1 place, every 15 minutes$28.80
10 places, every hour$72

Each bar is calls over 30 days, times $0.010.

What happened to v1.1 trends/place?

The old v1.1 GET trends/place returned the top 50 trends for a place, many with a 24-hour tweet_volume, its archived reference says.

That page now redirects to the docs.x.com home page. X's v1.1-to-v2 endpoint map has no trends row.

The route still answers: on 22 October 2026, our token-less call got "Bad Authentication data," not "not found." We couldn't test it with a key, so build on v2.

What is a WOEID, and where do you find one?

A WOEID, or "Where On Earth ID," is a place number Yahoo created. X's old docs say it "has been deprecated," yet X's trends still use it.

X's v2 docs list eight common ones:

Worldwide        1          New York      2459115
United States    23424977   Los Angeles   2442047
United Kingdom   23424975   London        44418
Japan            23424856   Tokyo         1118370

For other places, the npm package twitter-woeid lists "locations that Twitter has trending topic information for," in its own words. We checked version 1.0.3, from March 2023: it holds 467 places, so treat it as a snapshot.

Measure a topic you already care about with Weir

Weir has no trends endpoint; we checked its API spec to be sure.

What it can do is measure a topic you name. This script counts posts per hour for one keyword, from each post's createdAt:

import os, collections, requests

URL = "https://api.weirapp.io/v1/x/search"
HEADERS = {"Authorization": f"Bearer {os.environ['WEIR_API_KEY']}"}

It pages until the cursor is null or it hits max_pages:

def posts_per_hour(keyword, since, limit=100, max_pages=10):
    body = {"query": f"{keyword} -filter:nativeretweets", "language": "en",
            "since": since, "limit": limit}
    hours = collections.Counter()
    for _ in range(max_pages):  # each page: 1 credit + 1 per post
        r = requests.post(URL, json=body, headers=HEADERS, timeout=60)
        r.raise_for_status()  # 402 means out of credits
        page = r.json()
        hours.update(p["createdAt"][:13] for p in page["data"])
        if not page["meta"]["nextCursor"]:
            return hours, True  # every matching post counted
        body = {**body, "cursor": page["meta"]["nextCursor"]}
    return hours, False  # stopped at max_pages

-filter:nativeretweets drops reposts, which X's search returns by default.

We tried it on "kubernetes" on 22 October 2026 at 18:20 UTC, with tiny limits to fit our test budget:

hours, complete = posts_per_hour("kubernetes", "2026-10-22T16:00:00Z",
                                 limit=2, max_pages=1)
for hour, count in sorted(hours.items()):
    print(f"{hour}:00 UTC  {count} posts")
print("complete" if complete else "stopped at max_pages: a floor, not a total")

We sent the search through Weir's MCP server, which takes the same fields, for 3 credits. Fed that reply, the script printed:

2026-10-22T18:00 UTC  2 posts
stopped at max_pages: a floor, not a total

The cursor wasn't null, so more posts matched. The two we got were about six minutes apart.

For a real count, set limit to 100 and raise max_pages. X serves about 20 posts a page, and a full walk often ends on one empty 1-credit page. Our hashtag tracker guide adds top posts and alerts.

When not to use Weir

  • You need X's trending list. Only X's trends endpoints have it.
  • You need hourly volume for a query. X's counts endpoint returns it without reading posts, as our Twitter search API guide shows.
  • You need a contract with X. Weir isn't licensed by X, so access can change.

Weir is read-only. Check X's terms for your use; this isn't legal advice.

FAQ

Sources

All checked on 22 October 2026, with docs.x.com read as Markdown: