# Twitter Trends Scraper: X Trending Topics by Country & City (`tenfoldfleet/twitter-trends-scraper-by-location`) Actor

Get the trending topics and hashtags on X (Twitter) right now for any country or city, or worldwide. Returns up to 50 trends per location with rank, rank change and hours trending, plus 24 hours of hourly history, for 460+ locations. $10 per 1,000 locations; locations without data are free.

- **URL**: https://apify.com/tenfoldfleet/twitter-trends-scraper-by-location.md
- **Developed by:** [Tenfold Fleet](https://apify.com/tenfoldfleet) (community)
- **Categories:** Social media, Agents
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 locations

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

### What does Twitter Trends Scraper do?

**Twitter Trends Scraper** returns the **trending topics and hashtags on X (Twitter)** for any of **62 countries, 400+ cities or worldwide**. For each location you get the current **top trends** in rank order (up to 50) and the **hourly trend lists of the last 24 hours**, so you can see what is trending now, what is new this hour and how long each topic has stayed in the list.

Not affiliated with X Corp. or Twitter. The data comes from a **public trend aggregator** that records X's trending lists about once an hour. It is not read from X itself, and no X account, login, cookie or API key is used.

Use it as a **Twitter trends API**: start it from the Apify API, a schedule, Make, Zapier, n8n or an AI agent through the [Apify MCP server](https://apify.com/apify/actors-mcp-server), and get clean JSON. It runs over plain HTTP with no browser: a few locations take a few seconds, and all 460+ take about 12 minutes (about 40 locations a minute).

### Why use Twitter Trends Scraper?

- **Social media and content teams**: check each morning what your country or city is talking about, and post while a topic is still rising (`isNew`, `previousRank`).
- **Newsrooms and PR**: spot breaking topics by location and see how long they have been trending (`hoursTrending`, `firstSeenAt`).
- **Marketing by market**: compare trends across countries in one run with `all-countries`.
- **Trend monitoring**: schedule an hourly or daily run and build your own long-term archive of X trends by location. One run already holds the last 24 hours.
- **AI agents**: one compact row per location, with a ready `topTrends` summary and a search link for every trend.

### What data can Twitter Trends Scraper extract?

| Field | Description |
|---|---|
| `location`, `locationName`, `country`, `city` | The place, for example `united-kingdom/london`, "London, United Kingdom" |
| `snapshotAt` | When the newest trend list was recorded (UTC) |
| `trends` | The newest list, up to 50 trends in rank order |
| `trends[].rank`, `name`, `isHashtag`, `url` | Position, trend text, whether it is a hashtag, and the X search link for it |
| `trends[].previousRank`, `isNew` | Position one list earlier; `isNew` is true when the trend just entered the list |
| `trends[].bestRank`, `hoursTrending`, `firstSeenAt` | Highest position, number of hourly lists it appeared in and first appearance, all inside the 24-hour window |
| `trends[].tweetCount` | Post volume when the source publishes one. It is usually `null`, because X rarely shares volumes now |
| `topTrends` | The top 10 trend names as one line of text |
| `history` | The hourly lists of the last 24 hours: `timestamp` and trend names in rank order |
| `trendCount`, `snapshotCount`, `isComplete` | Size of the newest list, number of hourly lists, and whether a full day was available |
| `source`, `url` | Which aggregator page the row came from |
| `error`, `suggestions` | `null` on a normal row. On a free row: why there are no trends, and what to enter instead |

### How to scrape Twitter trends by location

1. Click **Try for free**.
2. In **Locations**, enter the places you want: `worldwide`, a country (`United States`, `US`, `Japan`), a city with its country (`London, United Kingdom`) or a slug (`united-states/new-york`).
3. Click **Start**. Each location is one row.
4. Open the **Output** tab and download the trends as JSON, CSV, Excel or HTML, or read them through the API.
5. To monitor trends, add a **Schedule** that runs the same input every hour or every day.

### How much does it cost to scrape Twitter trends?

You pay **$0.01 per location returned with trends**, which is **$10 per 1,000 locations**, plus $0.00005 per run. The price is the same with or without the 24-hour history. Unknown locations, locations that fail to load and locations the source has no current trends for are **free**.

| Use | Locations | Cost |
|---|---|---|
| One country, once a day for a month | 30 | $0.30 |
| One city, every hour for a month | 720 | $7.20 |
| Worldwide plus all 62 countries, once | 63 | $0.63 |

The Apify free plan includes $5 of credit each month, which covers about 500 locations. Set a maximum cost per run in the run options and the Actor stops cleanly when it is reached.

### Input

```json
{
    "locations": ["worldwide", "United States", "London, United Kingdom"],
    "includeHistory": true,
    "maxTrends": 50
}
```

- `locations` (required): any mix of `worldwide`, country names or 2-letter codes, `City, Country`, and `country/city` slugs. `all-countries` expands to worldwide plus the 62 countries (63 rows). `all-locations` expands to every country and city (460+ rows).
- `includeHistory` (default `true`): add the hourly lists of the last 24 hours.
- `maxTrends` (default `50`): keep only the top N trends of each list.

### Output

![Sample output of Twitter Trends Scraper: X Trending Topics by Country & City, rows from a real run: Location, Trends as of, Top 10 trends, # Trends, Hourly lists, Source](https://api.apify.com/v2/key-value-stores/4TBgG7fopkYMNWnX2/records/twitter-trends-scraper-by-location-output.png)

One row per location. The example is shortened to two trends and two hourly lists, and leaves out each trend's `url` (its X search link).

```json
{
    "input": "London, United Kingdom",
    "location": "united-kingdom/london",
    "locationName": "London, United Kingdom",
    "country": "United Kingdom",
    "city": "London",
    "source": "trends24",
    "snapshotAt": "2026-11-10T00:15:32.630Z",
    "trendCount": 48,
    "snapshotCount": 24,
    "isComplete": true,
    "topTrends": "Eddie Howe, Jags, Vine, Tom Brady, ...",
    "trends": [
        {
            "rank": 1,
            "name": "Eddie Howe",
            "isHashtag": false,
            "tweetCount": null,
            "previousRank": 3,
            "isNew": false,
            "bestRank": 1,
            "hoursTrending": 5,
            "firstSeenAt": "2026-11-09T20:02:11.418Z"
        },
        {
            "rank": 2,
            "name": "Jags",
            "isHashtag": false,
            "tweetCount": null,
            "previousRank": null,
            "isNew": true,
            "bestRank": 2,
            "hoursTrending": 1,
            "firstSeenAt": "2026-11-10T00:15:32.630Z"
        }
    ],
    "history": [
        { "timestamp": "2026-11-10T00:15:32.630Z", "trends": ["Eddie Howe", "Jags"] },
        { "timestamp": "2026-11-09T23:24:07.102Z", "trends": ["Vine", "Tom Brady"] }
    ],
    "error": null,
    "scrapedAt": "2026-11-10T00:31:05.000Z"
}
```

A location that cannot be matched returns a free row with `error` and `suggestions`, for example `"Barcelona"` returns `["spain/barcelona", "venezuela/barcelona"]`. Free rows have the same columns as normal rows, with an empty `trends` list.

### Tips

- Trend lists are recorded about once an hour, so running more often than hourly returns the same list.
- For a dashboard or an alert, read `trends` where `isNew` is true: these topics entered the list in the last hour.
- For small results, set `includeHistory` to `false` and `maxTrends` to 10.
- A few city names exist in two countries (Barcelona, Valencia, Birmingham). Add the country: `Birmingham, United Kingdom`.
- A list can be shorter than 50, mostly for smaller cities and at night local time. `isComplete` is true when the newest list has 40 or more trends and 20 or more hourly lists are present.
- A few listed places have no trends at the source at a given time (on 10 November 2026: 19 of 467, among them Kyiv, Athens and Tel Aviv). They return a free row with `error`, and `suggestions` holds the country to try instead.
- `previousRank`, `isNew`, `bestRank` and `hoursTrending` are always worked out on the full lists, also when `maxTrends` is small.

### FAQ

#### Which countries and cities are covered?

Worldwide, 62 countries and 400+ cities: every place the aggregator tracks. Countries: Algeria, Argentina, Australia, Austria, Bahrain, Belarus, Belgium, Brazil, Canada, Chile, Colombia, Denmark, Dominican Republic, Ecuador, Egypt, France, Germany, Ghana, Greece, Guatemala, India, Indonesia, Ireland, Israel, Italy, Japan, Jordan, Kenya, Korea, Kuwait, Latvia, Lebanon, Malaysia, Mexico, Netherlands, New Zealand, Nigeria, Norway, Oman, Pakistan, Panama, Peru, Philippines, Poland, Portugal, Puerto Rico, Qatar, Russia, Saudi Arabia, Singapore, South Africa, Spain, Sweden, Switzerland, Thailand, Turkey, Ukraine, United Arab Emirates, United Kingdom, United States, Venezuela and Vietnam.

#### How far back does the trend history go?

24 hours. Each run returns about 24 hourly lists per location. For a longer history, schedule the Actor daily and keep the datasets.

#### Does it return tweet volume?

Only when the source shows one. X now shares post volumes for few trends, so `tweetCount` is `null` in most rows. Use `rank`, `bestRank` and `hoursTrending` to judge how big a trend is.

#### Is the data read from X?

No. It comes from a public aggregator that records X's trending lists, so trends are usually up to an hour old. `snapshotAt` gives the exact time of the newest list. A list older than 12 hours is not returned as current: that location gets a free row, or the second source for a country. If the main aggregator is down, the Actor reads a second one for countries and worldwide: those rows have the current list only (`snapshotCount` 1, `isComplete` false).

#### Do I need an X account or the X API?

No. There is no login, cookie or API key.

#### Can I use it as a Twitter trends API from my code or an AI agent?

Yes. Call the Actor through the [Apify API](https://docs.apify.com/api/v2) or add it as a tool in the Apify MCP server. The input is a list of place names, and each result is one JSON row.

#### Is it legal to scrape Twitter trends?

Trending topics are public, aggregate information about what many people post about. The results contain topic names and ranks, not personal data. You are responsible for how you use the data and for following the laws that apply to you.

### Disclaimer

This Actor is an independent tool. It is not affiliated with, endorsed by or sponsored by X Corp. or Twitter. X and Twitter are trademarks of their owner. Trend data is provided as recorded by a public third-party aggregator, without any guarantee of completeness.

### More tools from Tenfold Fleet

| Actor | Output |
|---|---|
| [Twitter Video Transcript - X Video to Text & SRT](https://apify.com/tenfoldfleet/twitter-video-transcript) | video transcript |
| [Google Trends Scraper - Search Interest by Region and Over Time](https://apify.com/tenfoldfleet/google-trends-scraper) | keyword |
| [Bilibili Scraper API - Videos, Comments, Danmaku & Search](https://apify.com/tenfoldfleet/bilibili-scraper) | video or comment |
| [Brand Mentions Monitor - Bluesky, Hacker News & Mastodon](https://apify.com/tenfoldfleet/brand-mentions-monitor) | mention |
| [Douban Reviews Scraper - Movies, Books, TV & Groups](https://apify.com/tenfoldfleet/douban-reviews-scraper) | review |
| [Facebook Ads Library Scraper for Marketers](https://apify.com/tenfoldfleet/facebook-ads-library-scraper) | ad |
| [Facebook Ads Transcript - Spoken Hook, CTA, Offer & Angle](https://apify.com/tenfoldfleet/facebook-ads-transcript) | video ad transcript |
| [Facebook Reels Scraper: Views & Captions Monitor for Any Page](https://apify.com/tenfoldfleet/facebook-reels-scraper) | reel |
| [Facebook Reels Transcript - Facebook Video to Text, No Login](https://apify.com/tenfoldfleet/facebook-reels-transcript) | reel transcript |
| [Instagram Post Details Scraper - Carousel, Likes, Caption](https://apify.com/tenfoldfleet/instagram-post-details) | post |
| [Instagram Profile Transcript Monitor - New Reels to Text](https://apify.com/tenfoldfleet/instagram-profile-transcript-monitor) | new reel transcript |
| [Instagram Reels Analytics - Profile Reel Plays, Likes, Comments](https://apify.com/tenfoldfleet/instagram-reels-analytics) | reel |

All 124 tools: [apify.com/tenfoldfleet](https://apify.com/tenfoldfleet). If this Actor saves you time, save it (the bookmark on its Store page) and leave a review: both help other people find it. Found a bug or need another field? Tell us on the Issues tab of this page.

# Changelog

This Actor's version history is a separate document: https://apify.com/tenfoldfleet/twitter-trends-scraper-by-location/changelog.md

# Actor input Schema

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

Places to get X (Twitter) trends for. Use "worldwide", a country name or 2-letter code (United States, US, Japan, BR), a city with its country (London, United Kingdom) or a slug (united-states/new-york). 62 countries and 400+ cities are covered. One location = one result. "all-countries" expands to worldwide plus every country (63 results). An unknown place, or a place the source has no trends for right now, returns a free row. On the Apify free plan, the $5 monthly credit covers about 500 locations.

## `includeHistory` (type: `boolean`):

Add the hourly trend lists of the last 24 hours to each result (about 24 lists of trend names in rank order). Turn off for smaller results; the price is the same.

## `maxTrends` (type: `integer`):

Keep only the top N trends of each list. A location has up to 50 trends.

## `proxyConfiguration` (type: `object`):

Optional. The default Apify datacenter proxy works and does not need changing.

## Actor input object example

```json
{
  "locations": [
    "worldwide",
    "United States",
    "London, United Kingdom"
  ],
  "includeHistory": true,
  "maxTrends": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "locations": [
        "worldwide",
        "United States",
        "London, United Kingdom"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tenfoldfleet/twitter-trends-scraper-by-location").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 = { "locations": [
        "worldwide",
        "United States",
        "London, United Kingdom",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("tenfoldfleet/twitter-trends-scraper-by-location").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 '{
  "locations": [
    "worldwide",
    "United States",
    "London, United Kingdom"
  ]
}' |
apify call tenfoldfleet/twitter-trends-scraper-by-location --silent --output-dataset

```

## MCP server setup

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

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/HFyf1aDirj4xxkPja/builds/f8x2Ce7Lgo0PxSWSB/openapi.json
