# Twitter (X) Trends Scraper & API: Trending Topics by Country (`s_actors/x-trends-scraper`) Actor

Scrape Twitter (X) trends without login: top 50 trending topics and hashtags in 467 locations (worldwide, 62 countries, 400+ cities), with the last 24 hours of every trend, trends of any past day since 2023, top hashtags of the week, month or year, and new trend alerts.

- **URL**: https://apify.com/s_actors/x-trends-scraper.md
- **Developed by:** [Superior Actors](https://apify.com/s_actors) (community)
- **Categories:** Social media, Marketing, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.08 / 1,000 trends

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Twitter (X) Trends Scraper & API: Trending Topics by Country

Export **what is trending on Twitter (X) right now**: the top 50 trending topics and hashtags in **467 locations**: worldwide, **62 countries** and **400+ cities** (London, New York, Mumbai, São Paulo, Tokyo...). Every trend comes with **its last 24 hours**: best rank, hours in the trends, when it first appeared and its rank an hour ago. Go back in time with **Twitter trends history**: the trends of **any past day or hour since June 2023**, or the **top hashtags** of the last day, week, month or year.

```json
{ "mode": "now", "locations": ["worldwide", "US", "UK", "London"], "maxTrendsPerLocation": 50 }
```

No X account, no X API key, no browser. Schedule it every hour with **Only new trends** to get new trends as alerts.

#### What you get

Real example, trending now in the United States, 28 October 2026 15:27 UTC:

| # | trend | change in 1 h | best rank in 24 h | hours trending in 24 h | first seen (UTC) |
|---|---|---|---|---|---|
| 1 | Justin Tucker | 0 | 1 | 4 | 12:57 |
| 2 | Butker | +2 | 2 | 3 | 13:48 |
| 3 | Good Wednesday | -1 | 1 | 8 | 09:31 |
| 4 | FOMC | +1 | 4 | 4 | 12:57 |
| 5 | Hump Day | -2 | 2 | 6 | 11:15 |

Past day, United States, 28 October 2025 (daily summary of 24 hourly lists, 348 trends):

| # | trend | best rank | best hour (UTC) | hours in top 50 | first / last hour | tweets |
|---|---|---|---|---|---|---|
| 1 | Jamaica | 1 | 15:00 | 13 | 0 / 22 | 287,400 |
| 2 | #WorldSeries | 1 | 6:00 | 13 | 2 / 14 | 229,000 |
| 3 | Ohtani | 1 | 3:00 | 11 | 3 / 13 | 147,700 |
| 4 | Kershaw | 1 | 5:00 | 10 | 4 / 13 | 21,000 |
| 5 | Snap | 1 | 19:00 | 7 | 0 / 22 | 1,100,000 |

Top hashtags worldwide, last 7 days (most tweeted):

| # | hashtag | score | record |
|---|---|---|---|
| 1 | #出身地当てます | 690 | now |
| 2 | #HojeEuVotoLula | 569 | 2 days ago |
| 3 | #BallonDor | 435 | 1 day ago |
| 4 | #sbhawks | 388 | 2 hours ago |
| 5 | #Eleicoes2026 | 385 | 2 days ago |

| Field | Description |
|---|---|
| `trend`, `isHashtag`, `rank` | The trending topic or hashtag, whether it is a hashtag, its place in the list (1 = top) |
| `location`, `locationType`, `country`, `countryCode`, `city`, `locationSlug` | Where it trends: worldwide, a country (ISO code) or a city |
| `source` | `now`, `history-daily`, `history-hourly` or `top` |
| `rankHourAgo`, `rankChange`, `isNewThisHour` | Trending now: rank in the previous hourly list, places gained (+) or lost (-), new in the trends this hour |
| `bestRank24h`, `hoursInTop24h`, `firstSeen24h`, `trendingAllDay` | Trending now: best rank in the last 24 hours, hourly lists it was in, first time seen in that window, in every list of the day |
| `hourlyRanks` | Rank of every hour the trend was in the top 50: `[{time, rank}]` (now) or `[{hour, rank}]` (past days) |
| `date`, `hour`, `bestRank`, `bestRankHour`, `hoursInTop`, `hoursChecked`, `firstHour`, `lastHour` | Past days: the day (UTC), the hour (hourly lists) or the day's best rank, its hour, hours in the top 50 of the hours checked, first and last hour |
| `tweetCount` | Number of posts, when X showed it (X stopped showing volumes in most lists in 2026; part of the 2024-2025 archive has them) |
| `topList`, `period`, `score`, `recordDate`, `totalDuration`, `totalHours`, `lastSeen` | Top hashtags: most tweeted (score and record date) or longest trending (total time trending and last seen) in the period |
| `isNew`, `previousRank` | Trending now: not in this location's list in the previous runs of this monitor, rank in the previous run (empty on the first run) |
| `snapshotTime`, `xSearchUrl`, `scrapedAt` | Time of the trend list (UTC), the trend's search on X, run time |

#### How it works

1. Choose **What to scrape**: **Trending now (+ last 24 hours)**, **Past days (trend history)** or **Top hashtags**
2. Add **locations**, one per line: `worldwide`, a country (`United States`, `US`, `UK`, `India`), a city (`London`, `Los Angeles`, `Birmingham, United States`) or a trends24.in link. Past days and top hashtags are available for worldwide and the 62 countries
3. Optionally keep only trends that **contain your words** (brand or topic monitoring) or **hashtags only**
4. Past days: add **dates** (`2025-10-28`, `yesterday`, `7 days ago`), optionally **hours (UTC)**, and choose **daily summary** or **hourly lists**
5. Run, then download the dataset as CSV, Excel, JSON or HTML. Tabs: **Trending now**, **New trends**, **Past days** (daily or hourly), **Top hashtags** (most tweeted or longest trending)

#### Why this Actor

| | |
|---|---|
| 🌍 **467 locations** | Worldwide, 62 countries and 400+ cities, by name or ISO code: no WOEID lookup needed |
| ⏱️ **Last 24 hours with every trend** | Best rank, hours trending, first seen, rank change in the last hour and the hourly ranks, from one request per location |
| 📅 **Twitter trends history** | Trends of any day or hour since June 2023: a daily summary with best rank and hours trending, or the full hourly lists |
| #️⃣ **Top hashtags** | The most tweeted and longest trending hashtags of the last day, week, month or year, up to 100 per list |
| 🔔 **New-trend alerts** | `isNew` and `previousRank` on every row; **Only new trends** returns just the trends that entered the list since the previous run |
| 🔎 **Keyword filter** | Keep only trends with your brand, team, show or topic |
| 💰 **$0.18 per 1,000 trends** | No subscription, no X API plan |

#### Get new Twitter trends every hour

1. Add your locations, choose **Trending now** and turn on **Only new trends** (optionally with **Must contain** words)
2. Save as a task and add a schedule, e.g. every hour (X updates the trends lists about every hour)
3. The **first run** returns the full lists as a baseline. **Every later run** returns only trends not seen before: send them to [Google Sheets](https://apify.com/s_actors/google-sheets-import-export), Slack or email with an integration

The memory is kept in your account (key-value store `x-trends-state`). Use a different **Monitor name** for each task.

#### Pricing

Pay per trend in the results, no subscription needed. Apify Scale and Business plans pay less:

| Event | Free and Starter plans | Scale plan | Business plan |
|---|---|---|---|
| Run start | $0.001 | $0.001 | $0.001 |
| Trend (one row) | $0.00018 | $0.000146 | $0.00008 |

| Task | Cost |
|---|---|
| Trending now in worldwide, US and UK (~150 trends) | ~$0.03 |
| Trending now in all 62 countries (3,100 trends) | ~$0.56 |
| One past day of one country, daily summary (~350 trends) | ~$0.06 |
| Hourly alert of new trends in one country (~10 new an hour) | ~$2.03 per month |

Trends left out by your filters or by **Only new trends** are not charged.

#### Ready-made tasks

Open it, change the locations, and run:

| Task | What you get |
|---|---|
| [Twitter Trends Worldwide Today](https://apify.com/s_actors/x-trends-scraper/examples/twitter-trends-worldwide-today) | What is trending on X worldwide, in the US and the UK right now, with the last 24 hours of every trend |

#### FAQ

**Where does the data come from?** From the public trend trackers [trends24.in](https://trends24.in) (the current lists and the last 24 hours, every location) and [getdaytrends.com](https://getdaytrends.com) (the archive since June 2023 and the top hashtags, countries). They record the trends lists X shows every hour. The Actor does not log in to X and does not use the X API.

**Why is `tweetCount` empty?** X stopped showing the number of posts next to most trends. When a list had volumes (part of the 2024-2025 archive), you get them.

**How fresh is "now"?** The latest hourly list of each location, usually 0-60 minutes old: `snapshotTime` shows its time in UTC.

**Why do I get fewer than 50 trends?** Some lists are shorter (smaller locations, or a list being updated), your filters left some out, or with **Only new trends** most trends were already seen.

**Can I get trends of a city in the past?** The archive and the top hashtags cover worldwide and the 62 countries. Cities have the current list and the last 24 hours.

**Do I need an X (Twitter) account?** No.

#### Use with the API and AI agents

Run it via the [Apify API](https://docs.apify.com/api/v2) from Python, Node.js or any HTTP client as a Twitter trends API, or connect it to Claude, ChatGPT and other AI agents through the [Apify MCP server](https://mcp.apify.com): "What is trending on X in Germany right now, and what was trending there yesterday?"

#### Other trend tools

| Tool | What it does |
|---|---|
| [TikTok Trending Hashtags Scraper](https://apify.com/s_actors/tiktok-trending-hashtags-scraper) | Trending TikTok hashtags by country, views, trend curve, new-trend alerts |
| [TikTok Trending Sounds & Songs Scraper](https://apify.com/s_actors/tiktok-trending-sounds-scraper) | Sounds and songs trending on TikTok in any country: videos using them, plays, MP3, new-sound alerts |
| [Instagram Trending Audio](https://apify.com/s_actors/instagram-trending-audio) | Reels sounds trending on Instagram by country, with reels counts and growth |
| [Pinterest Trends Scraper](https://apify.com/s_actors/pinterest-trends-scraper) | Growing, top and seasonal Pinterest searches in 29 markets, keyword research |
| [Google Sheets Import & Export](https://apify.com/s_actors/google-sheets-import-export) | Send the trends to a Google Sheet |

#### Is it legal?

The Actor collects only public, aggregated trend lists (topic names and ranks) that the trend trackers show to any visitor, without logging in. It contains no personal data and no posts.

# Actor input Schema

## `mode` (type: `string`):

Trending now: the current top 50 of each location, with the last 24 hours of every trend (best rank, hours trending, first seen, rank an hour ago). Past days: the trends of any day or hour since June 2023 (countries and worldwide). Top hashtags: the hashtags that trended most in the last day, week, month or year.

## `locations` (type: `array`):

Worldwide, countries and cities, one per line: "worldwide", a country name or ISO code ("United States", "US", "UK", "India"), a city ("London", "Mumbai", "Los Angeles", "Birmingham, United States") or a trends24.in link. 467 locations: worldwide, 62 countries and 400+ cities. Past days and top hashtags: worldwide and countries only.

## `maxTrendsPerLocation` (type: `integer`):

Top N of each list. Trending now and past days: up to 50 (X shows 50), with the daily summary the trends that reached this top N in any hour. Top hashtags: up to 100.

## `keywords` (type: `array`):

Only trends that contain one of these words (brand monitoring), e.g. "nike", "election". Empty = all trends.

## `hashtagsOnly` (type: `boolean`):

Only trends that start with #.

## `includeHourlyRanks` (type: `boolean`):

Add the rank of every hour the trend was in the top 50 (hourlyRanks) to each row.

## `onlyNew` (type: `boolean`):

Output only trends that were not in this location's list in the previous runs (with the same monitor name). Schedule the Actor every hour to get new trends as alerts. Every row also has isNew and previousRank.

## `monitorName` (type: `string`):

Keeps the memory of new trends apart for different schedules.

## `dates` (type: `array`):

Days to get (What to scrape = Past days), UTC: YYYY-MM-DD from 2023-06-03, "yesterday", "today" or "7 days ago". Default: yesterday.

## `hours` (type: `array`):

Hours of the day, 0-23 UTC. Empty = all 24 hours.

## `historyOutput` (type: `string`):

Daily summary: one row per trend per day with its best rank, hours in the top 50, first and last hour. Hourly lists: one row per trend per hour (50 rows an hour).

## `topType` (type: `string`):

Most tweeted: by the trend score of getdaytrends. Longest trending: by the total time in the trends.

## `topPeriod` (type: `string`):

Period of the top list.

## `debugLog` (type: `boolean`):

Log every request retry.

## Actor input object example

```json
{
  "mode": "now",
  "locations": [
    "worldwide",
    "US",
    "UK"
  ],
  "maxTrendsPerLocation": 50,
  "hashtagsOnly": false,
  "includeHourlyRanks": true,
  "onlyNew": false,
  "dates": [
    "yesterday",
    "2025-10-28"
  ],
  "hours": [
    "12",
    "18"
  ],
  "historyOutput": "daily",
  "topType": "tweeted",
  "topPeriod": "day",
  "debugLog": false
}
```

# Actor output Schema

## `overview` (type: `string`):

Current trends with rank change, best rank and hours trending in 24 hours.

## `all` (type: `string`):

Every field, with the hourly ranks.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "now",
    "locations": [
        "worldwide",
        "US",
        "UK"
    ],
    "maxTrendsPerLocation": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("s_actors/x-trends-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "now",
    "locations": [
        "worldwide",
        "US",
        "UK",
    ],
    "maxTrendsPerLocation": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("s_actors/x-trends-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "now",
  "locations": [
    "worldwide",
    "US",
    "UK"
  ],
  "maxTrendsPerLocation": 50
}' |
apify call s_actors/x-trends-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,s_actors/x-trends-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/67bA80chcXEUymQUl/builds/21AmbVO6fHRSCjqXt/openapi.json
