# X (Twitter) Trends Scraper - 24-Hour Trend History (`scrapesage/x-trends-scraper`) Actor

Scrape X (Twitter) trending topics for Worldwide and 58 countries, with the full 24-hour hourly history - not just what is trending right now. Rank, hashtag flag, search link and the hour each trend was captured. No login, no API key. Independent tool, not affiliated with X Corp.

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

## Pricing

from $0.17 / 1,000 trend scrapeds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## X (Twitter) Trends Scraper - 24-Hour Trend History

> **Disclaimer:** This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by X Corp. or any of its subsidiaries. All trademarks mentioned are the property of their respective owners. "X (Twitter)" is referenced only to describe the publicly available website this Actor collects data from.

Scrape **X (Twitter) trending topics** for **Worldwide and 58 countries** - and not just what is trending *right now*. Every run can return the **full 24-hour history, one snapshot per hour**, so you can see when a hashtag entered the list, how high it climbed and when it fell out. Export to JSON, CSV or Excel.

No login, no API key, no paid X API tier.

### Where the data comes from

This Actor reads the public trend pages of **[trends24.in](https://trends24.in)**, an independent site that archives X's own trend lists hour by hour. It does **not** call X's API and does not need an X account. Every row carries a `source` field so the provenance travels with your data. The hourly archive is the reason this Actor can give you history at all - X itself only publishes what is trending at this moment.

### What you get

| | |
|---|---|
| **24-hour history** | One snapshot per hour for the last 24 hours, each with its own UTC timestamp and `hoursAgo` - track a hashtag's whole run, not a single moment |
| **59 places** | Worldwide plus 58 countries. Every slug in the picker was checked against the live source, so nothing you can select comes back empty |
| **Rank order** | `rank` 1-50 exactly as X ordered the list at that hour |
| **Hashtag flag** | `isHashtag` separates `#hashtags` from plain keyword trends in one column |
| **Search links** | A ready X search URL per trend, so you can jump straight to the posts |
| **Compact snapshots** | Optional one-row-per-place-per-hour summary: trend count, hashtag count and share, and the top 10 names |
| **Filters that cost nothing** | Hashtags-only and name-contains are applied before billing - filtered rows are **never charged** |
| **Monitor mode** | Remembers what it has seen so a scheduled run returns only trends that are new |

### Use cases

- **Catch a trend early** - schedule it with **Monitor mode** and get only hashtags that have just entered a country's list.
- **Measure a campaign** - did your hashtag reach the list, in which countries, at what rank, and for how many hours?
- **Compare markets** - the same run covers 59 places, so you can see what is global and what is local.
- **Newsroom monitoring** - a 24-hour rank history is a timeline of when a story broke.
- **LLM input** - clean, ranked, timestamped topic lists per country, ready for clustering or summarisation.

### How to use

1. [Sign up for Apify](https://console.apify.com/sign-up) - the free plan is enough to try this Actor.
2. Open the **X (Twitter) Trends Scraper**, pick your **places** (Worldwide plus any of 58 countries) and set **hours back** - 1 for what is trending right now, 24 for a full day of history.
3. Click **Start** and watch trends stream into the dataset table.
4. **Export** as JSON, CSV, Excel, XML or RSS - or pull results programmatically through the [Apify API](https://docs.apify.com/api/v2).

### Input

Trending right now, worldwide:

```json
{ "places": ["worldwide"], "hoursBack": 1 }
```

A full day of history for three markets:

```json
{
  "places": ["united-states", "united-kingdom", "india"],
  "hoursBack": 24,
  "maxTrendsPerSnapshot": 50
}
```

Only hashtags, and only ones mentioning a keyword:

```json
{ "places": ["brazil"], "hoursBack": 24, "hashtagsOnly": true, "containsText": "cup" }
```

A dashboard row per country per hour, without the individual trends:

```json
{
  "places": ["worldwide", "japan", "nigeria"],
  "hoursBack": 24,
  "includeTrends": false,
  "includePlaceSnapshots": true
}
```

### Output

A `trend` row:

```json
{
  "type": "trend",
  "place": "united-states",
  "placeName": "United States",
  "placeUrl": "https://trends24.in/united-states/",
  "snapshotAt": "2026-09-07T07:00:11.468Z",
  "hoursAgo": 0,
  "rank": 1,
  "name": "#Lanterns",
  "isHashtag": true,
  "searchUrl": "https://twitter.com/search?q=%23Lanterns",
  "source": "trends24.in",
  "scrapedAt": "2026-09-07T07:17:12.500Z"
}
```

A `placeSnapshot` row (optional, one per place and hour):

```json
{
  "type": "placeSnapshot",
  "place": "united-states",
  "placeName": "United States",
  "snapshotAt": "2026-09-07T07:00:11.468Z",
  "hoursAgo": 0,
  "trendCount": 50,
  "hashtagCount": 14,
  "hashtagSharePercent": 28,
  "topTrends": ["JUNGKOOK", "Louisville", "#Lanterns", "WHALIEN 52", "Mookie"],
  "source": "trends24.in"
}
```

Three dataset views ship with the Actor: **Trends**, **Trend history** and **Place snapshots**.

### Good to know

- **59 places, every one of them live.** X does not publish a trend list for every country, so the picker carries only the places that actually return trends - nothing you can select comes back empty.
- **24 hourly snapshots per place, up to 50 trends each** - about 1,200 rows per place per run at full depth.
- **No post-volume column.** X no longer publishes a post count per trend, so this Actor ships no `tweetVolume` field rather than an always-empty one. Rank and time-on-list are the volume signals that are published.
- **Snapshots are hourly, and timestamps are UTC.** A trend that appeared and vanished inside one hour may not be in the archive.
- **City-level trends are not covered** - the picker is Worldwide plus countries.
- Trend names are whatever X published; some are in non-Latin scripts and are returned exactly as-is.

### How much does it cost to scrape X (Twitter)?

This Actor uses Apify's **pay-per-event** pricing: you are charged only for the results it delivers, with no monthly rental and no start fee. The events it can charge are:

- **Trend scraped** - Charged once per trending topic written to your dataset - place, capture hour, rank, name, hashtag flag and the X search link. Trends removed by your filters, trends already seen in monitor mode, and places that could not be read are never charged.
- **Place snapshot** - Charged once per place and hour when snapshot rows are switched on - trend count, hashtag count and share, and the top 10 trend names in a single row. Turn off 'Include one row per place snapshot' to skip it entirely.

The current price of each event is shown on the **Pricing** tab of this page. Set a maximum total charge on the run if you want a hard cap on spend, and use the input limits to control how much the Actor fetches.

### Automate & schedule

Run this Actor on autopilot and pull results into your own stack:

- **[Apify API](https://docs.apify.com/api/v2)** - start runs, fetch datasets and manage schedules over REST.
- **[apify-client for JavaScript](https://docs.apify.com/api/client/js/)** and **[apify-client for Python](https://docs.apify.com/api/client/python/)** - official SDKs.
- **[Schedules](https://docs.apify.com/platform/schedules)** - run it hourly, daily or weekly and keep your dataset current.
- **[Webhooks](https://docs.apify.com/platform/integrations/webhooks)** - trigger downstream actions (CRM import, Slack alert, email sequence) the moment a run finishes.

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

const client = new ApifyClient({ token: 'MY_APIFY_TOKEN' });

const run = await client.actor('scrapesage/x-trends-scraper').call({
    "places": [
        "worldwide",
        "united-states"
    ],
    "hoursBack": 24,
    "maxTrendsPerSnapshot": 50,
    "includePlaceSnapshots": false
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Got ${items.length} records`);
```

### Integrate with any app

Connect the dataset to thousands of apps - no code required:

- **[Make](https://docs.apify.com/platform/integrations/make)** - multi-step automation scenarios.
- **[Zapier](https://docs.apify.com/platform/integrations/zapier)** - push new records straight into your CRM or spreadsheet.
- **[Slack](https://docs.apify.com/platform/integrations/slack)** - get notified when a scheduled run finds something new.
- **[Google Drive / Sheets](https://docs.apify.com/platform/integrations/drive)** - auto-export every run to a spreadsheet.
- **[Airbyte](https://docs.apify.com/platform/integrations/airbyte)** - pipe results into your data warehouse.
- **[GitHub](https://docs.apify.com/platform/integrations/github)** - trigger runs from commits or releases.

### Use with AI assistants (MCP)

The output is clean, LLM-ready JSON. You can call this Actor from Claude, ChatGPT or any agent framework through the **[Apify MCP server](https://docs.apify.com/platform/integrations/mcp)** - describe the data you need and let the assistant run this Actor for you.

### Agent-ready: autonomous payments (x402 & Skyfire)

This actor is **agent-ready** — AI agents can discover it, run it, and **pay for it autonomously**, with no Apify account and no human in the loop. It uses [pay-per-event](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event) pricing and [limited permissions](https://docs.apify.com/platform/actors/development/permissions), so it qualifies for Apify's agentic-payment standards:

- **[x402](https://docs.apify.com/platform/integrations/x402)** — an open, HTTP-native payment protocol. Agents pay per run in USDC on the Base network directly through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) — no account, no API key.
- **[Skyfire](https://docs.apify.com/platform/integrations/skyfire)** — agent-to-service payments for fully autonomous AI-agent workflows.

Building an AI agent, MCP tool, or autonomous data pipeline? This scraper is ready to plug in and pay as it goes.

### More scrapers from scrapesage

Related Actors in the same category:

- **[LinkedIn Ad Library Scraper](https://apify.com/scrapesage/linkedin-ad-library-scraper)** - Competitor B2B Ads & Creatives
- **[Instagram Hashtag Scraper](https://apify.com/scrapesage/instagram-hashtag-scraper)** - Filtered Post Search
- **[Twitter (X) Scraper](https://apify.com/scrapesage/twitter-scraper)** - Tweets, Profiles & Monitor
- **[LinkedIn Profile Scraper](https://apify.com/scrapesage/linkedin-profile-scraper)** - People, Job Changes & B2B Leads
- **[People Search Scraper for LinkedIn](https://apify.com/scrapesage/linkedin-people-search-scraper)** - By Job Title

### Tips

- **One run, many markets.** Every row carries `place` and `placeName`, so covering 59 places in one run beats 59 scheduled runs.
- **Rank history is the story.** Pull `hoursBack: 24` and pivot on `name` + `snapshotAt` to plot exactly when a hashtag entered, peaked and dropped out.
- **Campaign tracking.** Combine `hashtagsOnly` with `containsText` to keep only your own tag, then check which countries it reached and at what rank.
- **Dashboards without the noise.** Set `includeTrends: false` and `includePlaceSnapshots: true` for one compact row per place per hour.
- **Catch entries early** with monitor mode on an hourly [Schedule](https://docs.apify.com/platform/schedules) - you are charged only for trends that are new.

### FAQ

**How is this Actor billed?** Pay-per-event: you pay only for the results it delivers, with no monthly rental and no start fee. The per-event price is shown on the Pricing tab.

**Can I schedule it and get results automatically?** Yes - create a [Schedule](https://docs.apify.com/platform/schedules) and add a [webhook](https://docs.apify.com/platform/integrations/webhooks) or an integration (Google Sheets, Slack, Make, Zapier) to push each run's dataset wherever you need it.

**Which export formats are available?** Every run's dataset can be downloaded as JSON, CSV, Excel (XLSX), XML, HTML or RSS from the Apify Console or the API.

**Can I run it from code or an AI agent?** Yes - through the [Apify API](https://docs.apify.com/api/v2) and client libraries, or from Claude, ChatGPT and other assistants via the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).

**Is it legal to scrape X (Twitter)?** This Actor collects publicly available data only. You are responsible for using the output in compliance with applicable laws (including data-protection law where personal data is involved) and the source's terms. See the **Disclaimer** below.

**Is this an official X (Twitter) tool?** No. It is an independent, third-party Actor with no affiliation to, endorsement by or sponsorship from X Corp. See the **Disclaimer** below.

### Disclaimer

**This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by X Corp. or any of its subsidiaries. All trademarks mentioned are the property of their respective owners.**

"X (Twitter)" and any related marks are the property of their respective owners and are used here only in a descriptive, nominative sense - to identify the publicly accessible website from which this Actor collects data. This Actor is not an official X (Twitter) product, is not authorised or certified by X Corp., and does not distribute X (Twitter) software. It collects only publicly available information; you are responsible for ensuring your use of that data complies with applicable laws, regulations and the terms of the source website.

### Need help?

Open an issue on the Actor's **Issues** tab, or visit the [Apify help center](https://help.apify.com/). Feature requests are welcome - this Actor is actively maintained.

# Actor input Schema

## `places` (type: `array`):

Which trend lists to read. **Worldwide plus 58 countries** - every place X publishes a trend list for. Each place is read once per run and every row carries the place it came from.

## `hoursBack` (type: `integer`):

How far back to go. The source publishes **one snapshot per hour for the last 24 hours**, so `1` is "trending right now" and `24` is the full day - a trend history no live-only scraper gives you.

## `maxTrendsPerSnapshot` (type: `integer`):

Trends to keep from each hourly snapshot, ranked from the top. X publishes up to 50.

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

Keep only trends that are hashtags (`#example`) and drop plain keyword trends. Filtered rows are **never charged**.

## `containsText` (type: `string`):

Keep only trends whose name contains this text (case-insensitive), e.g. `cup`, `election`, `AI`.

## `includeTrends` (type: `boolean`):

On by default: one row per trend, per hour, per place - the detailed export.

## `includePlaceSnapshots` (type: `boolean`):

Adds a compact `placeSnapshot` row per place and hour: trend count, hashtag count and share, and the top 10 names in one cell. Ideal for a dashboard row per country. Charged as `place-snapshot`.

## `outputFields` (type: `array`):

Trim the export to just these columns. Leave empty for every field.

## `monitorMode` (type: `boolean`):

Remembers trends between runs and emits only ones it has not seen. Pair with an Apify Schedule to track what breaks into a trend list.

## `monitorStoreName` (type: `string`):

Named key-value store holding the remembered trends. Use a different name per tracked place set.

## `maxConcurrency` (type: `integer`):

How many places to read in parallel.

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

Apify Proxy is used by default. Datacenter proxy is enough - no residential needed.

## Actor input object example

```json
{
  "places": [
    "worldwide"
  ],
  "hoursBack": 24,
  "maxTrendsPerSnapshot": 50,
  "hashtagsOnly": false,
  "includeTrends": true,
  "includePlaceSnapshots": false,
  "monitorMode": false,
  "monitorStoreName": "x-trends-monitor",
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Every trend and snapshot collected in this run.

# 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 = {
    "places": [
        "worldwide"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapesage/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 = { "places": ["worldwide"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapesage/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 '{
  "places": [
    "worldwide"
  ]
}' |
apify call scrapesage/x-trends-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapesage/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/kGjuisc01ChYdwyvO/builds/yUsW4RND0jIWWOcyO/openapi.json
