X (Twitter) Trending Topics Scraper avatar

X (Twitter) Trending Topics Scraper

Pricing

from $0.00005 / actor start

Go to Apify Store
X (Twitter) Trending Topics Scraper

X (Twitter) Trending Topics Scraper

Scrapes trending topics from X.com using Playwright. Extracts trending hashtags, topics, and post counts.

Pricing

from $0.00005 / actor start

Rating

0.0

(0)

Developer

Akash Kumar Naik

Akash Kumar Naik

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

X (Twitter) Trending Topics Scraper | Real-Time Trend Extraction

Extract trending hashtags, topics, and conversations from X.com (Twitter) in real-time. Perfect for social media monitoring, market research, SEO analysis, and trend tracking.


X Trending Topics Scraper is a powerful Apify Actor that automatically extracts live trending topics from X.com's Explore page. Whether you need to monitor viral hashtags, track industry conversations, or analyze trending discussions, this scraper delivers structured JSON data you can use for analytics, sentiment analysis, or content strategy.

Key Features

  • Real-Time Extraction - Get current trending topics as they happen
  • Multiple Locations - Scrape trends for different regions
  • Session-Based - Uses authentication cookies for reliable access
  • Structured Output - Clean JSON ready for analysis
  • Proxy Support - Built-in Apify proxy integration
  • Pay-Per-Event - Only pay for results you get

Use Cases

Who Is It For?What Can They Do?
Digital MarketersMonitor brand mentions, track viral hashtags, identify influencer topics
JournalistsDiscover breaking news, find emerging stories, research public sentiment
SEO SpecialistsFind trending keywords, discover content opportunities, track topic popularity
Data ScientistsCollect social media data for ML models, analyze trend patterns
Financial AnalystsTrack market-moving discussions, monitor industry sentiment
AcademicsResearch social media trends, study viral content patterns

Getting Started

Run the Actor with default settings:

apify call your-username/x-trending-scraper --input '{
"url": "https://x.com/explore/tabs/trending"
}'

Or use the Apify Console to run with custom input.


Input Schema Reference

ParameterTypeRequiredDefaultDescription
urlStringYes-Target X.com URL (e.g., https://x.com/explore/tabs/trending)
max_trendsIntegerNo20Maximum number of trends to extract (1-100)
proxyConfigurationObjectNoApify ProxyProxy settings for anti-bot protection

Output Data

The Actor outputs structured JSON to the default dataset:

[
{
"rank": 1,
"name": "#POCOX8SeriesSale",
"category": "Trending in India",
"post_count": null,
"scraped_at": "2026-03-23T12:47:36.755142",
"source_url": "https://x.com/explore/tabs/trending"
},
{
"rank": 2,
"name": "#ShaheedDiwas",
"category": "Only on X · Trending",
"post_count": null,
"scraped_at": "2026-03-23T12:47:36.759591",
"source_url": "https://x.com/explore/tabs/trending"
}
]

Output Fields

FieldTypeDescription
rankIntegerPosition in trending list (1, 2, 3...)
nameStringTrend name or hashtag
categoryStringTrend category (e.g., "Trending in India", "Politics")
post_countStringNumber of posts (when available)
scraped_atISO DateTimeWhen the data was extracted
source_urlStringOriginal source URL

API Integration Examples

Python Example

from apify_client import ApifyClient
# Initialize client
client = ApifyClient('YOUR_APIFY_TOKEN')
# Actor input
input_data = {
'url': 'https://x.com/explore/tabs/trending',
'max_trends': 50
}
# Run Actor and get results
call_result = client.actor('your-username/x-trending-scraper').call(input_data)
dataset_items = client.dataset(call_result['defaultDatasetId']).list_items()
# Process results
for item in dataset_items['items']:
print(f"#{item['rank']}: {item['name']} - {item['category']}")

JavaScript Example

const { ApifyClient } = require('apify-client');
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const input = {
url: 'https://x.com/explore/tabs/trending',
max_trends: 50
};
const run = await client.actor('your-username/x-trending-scraper').call(input);
const { items } = await client.dataset(run.defaultDatasetId).getItems();
console.log(items);

cURL Example

apify call your-username/x-trending-scraper --input '{
"url": "https://x.com/explore/tabs/trending"
}'

Pricing

This Actor uses Pay-Per-Event pricing:

Event TypePriceDescription
results$0.005 per trendCharged per trending topic extracted

Cost Examples

ScenarioTrends ExtractedCost
Quick check20$0.10
Standard run100$0.50
Large extraction1,000$5.00

💡 Tip: The Actor automatically uses the apify-actor-start synthetic event, giving you 5 seconds of free compute time per run.


Looking for more X.com data? Try these related Apify Actors:


Technical Details

SpecificationValue
LanguagePython 3.14+
Browser EnginePlaywright (Chromium)
Memory2 GB
TimeoutConfigurable
Output FormatJSON (Dataset)

Environment Variables

  • ACTOR_MAX_TOTAL_CHARGE_USD - User's spending limit (respected automatically)

Troubleshooting

"Session expired" or "Login required"

Your X.com cookies have expired. Get fresh cookies:

  1. Log out of X.com
  2. Log back in
  3. Copy new auth_token and ct0 values
  • Increase wait time in the code
  • Verify cookies are correct
  • Try using Apify proxy for residential IPs

"Proxy blocked"

Enable Apify proxy in input:

"proxyConfiguration": {
"useApifyProxy": true
}

  • ⚖️ Purpose: This tool is for educational and research purposes
  • 📜 Terms: Respect X.com's Terms of Service
  • 🔒 Privacy: Only scrape public data you have legitimate access to
  • Rate Limiting: Use proxies and delays to avoid overwhelming X.com servers

Support


Keywords

x scraper, twitter scraper, trending topics scraper, hashtag tracker, social media monitoring, trend analysis, web scraping, apify actor, python scraper, x.com data extraction, twitter api alternative, trend monitoring tool, social media research, viral content tracker, hashtag analytics


Built with ❤️ using Apify SDK and Playwright