# Twitter (X) Trends Scraper (PPE) (`eunit/x-twitter-trends-ppe`) Actor

Scrape real-time Twitter/X trends from any country or city. Get top 50 trending hashtags, tweet counts, and hourly history. Ideal for social media monitoring, viral topic tracking, and market research. Fast, reliable, and supports granular location data.

- **URL**: https://apify.com/eunit/x-twitter-trends-ppe.md
- **Developed by:** [Emmanuel Uchenna](https://apify.com/eunit) (community)
- **Categories:** Social media, Lead generation, SEO tools
- **Features:** Limited permissions
- **Stats:** 124 total users, 1 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $99.00 / 1,000 successfully extracting all trends

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

### Overview

The **Twitter (X) Trends Scraper** is a powerful tool designed to extract real-time trending topics from countries and cities worldwide. It provides a comprehensive view of what's happening now, making it an essential tool for:

- **Social Media Monitoring:** Track viral hashtags and topics as they emerge.
- **Market Research:** Understand regional interests and granular location-based trends.
- **Content Strategy:** Discover high-engagement topics for your content calendar.
- **Brand Sentiment:** Monitor relevant industry keywords in specific locations.

### Features

- **Granular Location Support:** Scrape trends for huge list of **countries** and specific **cities** (e.g., "United States", "New York", "London", "Lagos").
- **Comprehensive Data:** Extracts data from the **Timeline** (hourly trends), **Tag Cloud**, and **Top Trends Table**.
- **Deep Insights:** Retrieves trend **rank**, **hashtag/name**, **tweet counts**, and direct links.
- **Fast & Reliable:** Built for high performance and low overhead.
- **Easy Integration:** Export data in JSON, CSV, Excel, and more for seamless analysis.

### Pricing

This Actor is priced on a **pay-per-event** basis. You are charged only for each successful scrape (one run = one scrape of a specific location). This transparent model ensures you only pay for the valuable data you receive.

### No Setup Required

Unlike many other scrapers, this Actor requires **no complex proxy configuration**. It is optimized to run out-of-the-box on the Apify platform, handling connections automatically to ensure high success rates.

### How to Use

1. **Select Location:** specific country or city from the dropdown menu (e.g., "United States - New York").
2. **Run Scraper:** Click the "Run" button.
3. **Download Data:** Export the results in your preferred format (JSON, CSV, etc.).

### Output Format

The scraper returns a structured dataset containing trend information. Here is a sample of the JSON output:

```json
{
  "scraped_at": "2023-10-27T10:30:00.000Z",
  "country_input": "united-states/new-york",
  "timeline": [
    {
      "datetime": "2 minutes ago",
      "timestamp": "1698402400",
      "trends": [
        {
          "rank": 1,
          "name": "#FridayFeeIing",
          "link": "https://twitter.com/search?q=%23FridayFeeIing",
          "tweet_count": "50K"
        },
        {
          "rank": 2,
          "name": "New York Giants",
          "link": "https://twitter.com/search?q=%22New+York+Giants%22",
          "tweet_count": "12K"
        },
        // ...
      ]
    }
  ],
  "tag_cloud": [
    {
      "name": "#TechTrends",
      "link": "https://twitter.com/search?q=%23TechTrends"
    }
  ],
  "table_data": [
    {
       "rank": "1",
       "name": "#AI",
       "tweet_count": "100K"
    }
  ]
}
```

### FAQs

#### Is it legal to scrape trends?

Extracting publicly available factual data like "trending topics" is generally considered legal. However, you should always respect the terms of service of the target website and ensure your use case complies with local regulations like GDPR or CCPA.

### Related Actors

Expand your data collection capabilities with these other powerful Apify Actors developed by the same author:

#### [Zillow Scraper](https://apify.com/eunit/zillow-scraper)

- **URL:** <https://apify.com/eunit/zillow-scraper>
- **Description:** This general Zillow Scraper extracts data for properties **for sale**, **for rent**, or **recently sold** on Zillow. Use this Actor for broad market research or historical data collection across all property types.

#### [Enhanced Twitter (X) Bot](https://apify.com/eunit/enhanced-twitter-x-bot)

- **URL:** <https://apify.com/eunit/enhanced-twitter-x-bot>
- **Description:** A versatile Twitter bot for powerful social media automation. This tool uses the Twitter API to auto-like, auto-follow, and manages your followers. Configure keywords, schedules, and safety limits for effective Twitter engagement and account growth.

#### [Target Product Reviews Scraper](https://apify.com/eunit/target-reviews-scraper)

- **URL:** <https://apify.com/eunit/target-reviews-scraper>
- **Description:** A tool for market research and e-commerce analysis. Scrape **product reviews, star ratings, and consumer sentiment** from Target.com, useful for businesses analyzing the retail landscape in target neighborhoods.

### Support & Feedback

We are constantly improving this scraper. If you have feature requests, find a bug, or need a specific customization, please create an issue on the [Actor’s Issues tab](https://console.apify.com/actors/gt00A5awlaRmNFUzd/issues) in Apify Console.

# Actor input Schema

## `country` (type: `string`):

Select the location to scrape trends for.

## Actor input object example

```json
{
  "country": "Worldwide"
}
```

# Actor output Schema

## `overview` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("eunit/x-twitter-trends-ppe").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("eunit/x-twitter-trends-ppe").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 '{}' |
apify call eunit/x-twitter-trends-ppe --silent --output-dataset

```

## MCP server setup

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

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/gt00A5awlaRmNFUzd/builds/QLpuOYTggw6xWdWg5/openapi.json
