# X/Twitter Intelligence Scraper Pro (`qaseemiqbal/x-twitter-intelligence-scraper-pro`) Actor

Scrape public X/Twitter posts and profiles from search terms, handles, tweet URLs, and lists. Export clean tweet, author, media, engagement, and monitoring data for research, marketing, and social listening.

- **URL**: https://apify.com/qaseemiqbal/x-twitter-intelligence-scraper-pro.md
- **Developed by:** [Muhammad Qaseem Iqbal](https://apify.com/qaseemiqbal) (community)
- **Categories:** Social media, Marketing, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Intelligence Scraper Pro 🚀

Collect public X/Twitter data for monitoring, research, reporting, dashboards, spreadsheets, and AI workflows.

This actor can scrape public search results, profile timelines, tweet URLs, lists, conversations, and recurring monitoring runs. It is designed to start cheaply by default, then use a browser only when X/Twitter blocks simple page access or does not return enough data.

> ⚠️ Important: X/Twitter often changes how public pages load. Cheap HTTP-only runs may return warning records instead of tweets when X serves a generic page. For more reliable results, use `http_first` with `browserFallbackOnEmpty: true`.

### TL;DR ⚡

Want to scrape tweets from a profile and get real results reliably? Start here:

```json
{
  "scrapeMode": "profiles",
  "twitterHandles": ["NASA"],
  "maxItems": 10,
  "maxItemsPerProfile": 10,
  "crawlStrategy": "http_first",
  "browserFallbackOnEmpty": true,
  "maxConcurrency": 1,
  "downloadMedia": false
}
````

Want the cheapest possible test run first?

```json
{
  "scrapeMode": "search",
  "searchTerms": ["from:NASA lang:en"],
  "maxItems": 10,
  "crawlStrategy": "http_only",
  "downloadMedia": false
}
```

If the cheapest run returns `X_ACCESS_WARNING` or `NO_TWEETS_FOUND`, switch to the first example with browser fallback enabled.

### What You Can Collect 📥

| Data source | What to enter | Example |
| --- | --- | --- |
| Search results | Search terms or advanced X/Twitter queries | `from:NASA lang:en` |
| Profile timelines | One or more handles | `NASA`, `OpenAI`, `apify` |
| Tweet details | Tweet URLs or tweet IDs | `https://x.com/NASA/status/...` |
| Start URLs | Profile, tweet, list, or search URLs | `https://x.com/NASA` |
| Lists | Public X/Twitter list URLs | `https://x.com/i/lists/...` |
| Conversations | Tweet IDs or tweet URLs | Use when you want replies/context |
| Monitoring | Repeated search/profile runs | Emit only newly seen tweets |
| User discovery | Author aggregation from matching tweets | Useful for audience research |

### Common Use Cases 🎯

- Track mentions of a brand, product, event, or person.
- Collect posts from public profiles for research or reporting.
- Monitor public conversations around keywords or hashtags.
- Build datasets for dashboards, spreadsheets, or BI tools.
- Prepare clean tweet text and metadata for AI search, chatbots, and RAG workflows. RAG means retrieval-augmented generation, a common way to give AI apps source data to search.
- Watch for new posts over time with persistent monitoring.
- Export structured tweet records to Apify datasets.

### How It Works 🛠️

1. Choose a scrape mode, such as search, profiles, URLs, tweet details, conversations, or monitoring.
2. Add search terms, handles, tweet IDs, or X/Twitter URLs.
3. Set `maxItems` to control how many records you want.
4. Choose a crawl strategy:
   - `http_only`: lowest cost, fastest, but may return warnings if X blocks public HTML.
   - `http_first`: tries the cheap method first, then can use a browser if enabled.
   - `browser_only`: highest extraction effort, usually higher cost.
5. Run the actor and download your results from the dataset.

### Recommended Settings 💡

| Goal | Recommended settings |
| --- | --- |
| Cheapest test | `crawlStrategy: "http_only"`, `maxItems: 10`, `downloadMedia: false` |
| More reliable profile scraping | `crawlStrategy: "http_first"`, `browserFallbackOnEmpty: true` |
| Keep costs low | Use `maxConcurrency: 1`, avoid media downloads, start with small `maxItems` |
| Get more search results | Try `sort: "top"` or `sort: "latest_and_top"` |
| Avoid duplicate tweets | Keep `deduplicateBy: "tweetId"` |
| AI-ready output | Enable `includeRagFields: true` to add fields that are easier for AI apps to search |
| Spreadsheet-friendly output | Enable `flattenOutput: true` or choose `outputFields` |

### Example Inputs 🧪

#### Scrape a Profile 👤

```json
{
  "scrapeMode": "profiles",
  "twitterHandles": ["NASA"],
  "maxItems": 25,
  "maxItemsPerProfile": 25,
  "crawlStrategy": "http_first",
  "browserFallbackOnEmpty": true
}
```

#### Search for Tweets 🔎

```json
{
  "scrapeMode": "search",
  "searchTerms": ["\"artificial intelligence\" lang:en -filter:retweets"],
  "maxItems": 100,
  "sort": "latest_and_top",
  "crawlStrategy": "http_first",
  "browserFallbackOnEmpty": true
}
```

#### Use a Date Range 📅

```json
{
  "scrapeMode": "search",
  "searchTerms": ["from:NASA since:2026-01-01 until:2026-06-01"],
  "maxItems": 200,
  "sort": "top",
  "dateSplitStrategy": "monthly"
}
```

#### Mix Handles, URLs, and Search Terms 🧩

```json
{
  "scrapeMode": "auto",
  "searchTerms": ["@apify lang:en"],
  "twitterHandles": ["NASA"],
  "startUrls": [{ "url": "https://x.com/OpenAI" }],
  "tweetIds": ["1728108619189874825"],
  "maxItems": 100
}
```

#### Monitor New Results Over Time 🔔

```json
{
  "scrapeMode": "monitoring",
  "searchTerms": ["\"launch announcement\" lang:en"],
  "maxItems": 50,
  "monitoring": {
    "enabled": true,
    "stateKey": "launch-monitor",
    "emitOnlyNewItems": true,
    "lookbackHours": 24
  },
  "deduplicateScope": "persistent"
}
```

#### Prepare Data for AI Search or Chatbots 🤖

```json
{
  "scrapeMode": "profiles",
  "twitterHandles": ["NASA"],
  "maxItems": 50,
  "includeRagFields": true,
  "cleanText": true,
  "includeRawData": false
}
```

### Main Input Options ⚙️

| Field | Plain-English meaning | Default |
| --- | --- | --- |
| `scrapeMode` | What kind of run to perform. Use `auto` if you are mixing inputs. | `auto` |
| `searchTerms` | Search queries to run on X/Twitter. Supports advanced search syntax. | `[]` |
| `twitterHandles` | Public profile handles to scrape. `@` is optional. | `[]` |
| `startUrls` | Public X/Twitter URLs, including profiles, tweets, lists, and searches. | `[]` |
| `tweetIds` | Tweet IDs to fetch directly. | `[]` |
| `maxItems` | Maximum number of output records for the run. | `100` |
| `maxItemsPerQuery` | Maximum records per search query, URL, or list. | `100` |
| `maxItemsPerProfile` | Maximum records per profile timeline. | `100` |
| `sort` | Search order: latest, top, both, or automatic fallback. | `latest` |
| `profileMode` | Which profile tab to use, such as tweets, replies, or media. | `tweets` |
| `filters` | Optional filters for language, engagement, media, links, replies, and retweets. | `{}` |
| `crawlStrategy` | How the actor loads pages: cheap HTTP, HTTP first, or browser only. | `http_only` |
| `browserFallbackOnEmpty` | Use a browser if the cheap request returns no tweets or an access warning. | `false` |
| `downloadMedia` | Download images/videos to storage instead of only collecting metadata. | `false` |
| `flattenOutput` | Make nested fields easier to use in CSV/spreadsheets. | `false` |
| `outputFields` | Keep only selected fields in the final output. | `[]` |
| `includeRagFields` | Add AI-friendly text chunks and metadata for search/chatbot workflows. | `false` |
| `monitoring` | Save state between runs and emit only new items. | disabled |

### Output 📦

Results are saved to the Apify dataset. Most successful records are tweet records.

Example tweet record:

```json
{
  "recordType": "tweet",
  "tweetId": "2064422103416238295",
  "url": "https://x.com/NASA/status/2064422103416238295",
  "text": "Pinned NASA @NASA Jun 9 Introducing Artemis III...",
  "cleanText": "Pinned NASA @NASA Jun 9 Introducing Artemis III...",
  "author": {
    "userName": "NASA",
    "url": "https://x.com/NASA"
  },
  "isReply": false,
  "isRetweet": false,
  "isQuote": false,
  "discovery": {
    "inputType": "twitterHandles",
    "handle": "NASA"
  },
  "scrapedAt": "2026-06-14T15:40:03.212Z"
}
```

Depending on the page and settings, records may include:

- Tweet ID and URL
- Tweet text and cleaned text
- Author handle, name, URL, and profile details when available
- Creation time and language when available
- Reply, repost, quote, like, bookmark, and view counts when available
- Media metadata when available
- Discovery metadata showing which input produced the record
- Optional AI/RAG fields for search and chatbot workflows
- Optional raw data if `includeRawData` is enabled

### Warning and Error Records ⚠️

When X/Twitter does not return usable public tweet data, the actor writes a clear warning record instead of silently failing.

| Code | What it means | What to try |
| --- | --- | --- |
| `X_ACCESS_WARNING` | X returned a generic or restricted page. | Use `http_first` with `browserFallbackOnEmpty: true`. |
| `NO_TWEETS_FOUND` | The page loaded, but no public tweets were found. | Try a broader query, `sort: "top"`, or browser fallback. |
| `HTTP_FETCH_WARNING` | The cheap HTTP request failed. | Retry with browser fallback or Apify Proxy. |
| `REQUEST_FAILED` | A browser request failed after retries. | Lower concurrency, raise timeout, or try a smaller run. |

### Tips for Better Results ✅

- Test with `maxItems: 10` before running a larger job.
- If a search query returns few results, try `sort: "top"` or `sort: "latest_and_top"`.
- If your query uses `until`, try removing it or using smaller date windows.
- Use `dateSplitStrategy` for long historical searches.
- Keep `maxConcurrency` low for X/Twitter pages.
- Enable browser fallback when HTTP-only runs return warning records.
- Use `downloadMedia: false` unless you really need downloaded files.
- Use `outputFields` if you only need a few columns.

### Cost Notes 💸

This actor is built with cost control in mind:

- It starts with `http_only`, the cheapest crawl strategy.
- It uses one concurrent request by default.
- It does not retry failed requests by default.
- It does not download media by default.
- It caps output with `maxItems`.

Browser fallback is more reliable, but it costs more because it launches a real browser. Use it when you need results and HTTP-only mode returns access warnings.

### Limitations 🧭

- This actor only collects public data.
- It does not access protected/private accounts.
- It does not require or store X/Twitter login credentials.
- X/Twitter may hide, rate-limit, or change public pages at any time.
- Some fields are best-effort because X may not expose them on every page.
- Media downloading can increase runtime and storage usage.
- Conversation and search behavior depends on what X/Twitter publicly serves at run time.

### Troubleshooting 🔧

#### I got `X_ACCESS_WARNING` ⚠️

X likely returned a generic page instead of tweet data. Switch to:

```json
{
  "crawlStrategy": "http_first",
  "browserFallbackOnEmpty": true
}
```

#### I got `NO_TWEETS_FOUND` 🔍

Try a less restrictive query, a public profile with recent posts, `sort: "top"`, or browser fallback.

#### I got fewer results than expected 📉

Check `maxItems`, `maxItemsPerQuery`, and `maxItemsPerProfile`. Also remember that X/Twitter may show different results depending on search mode, date range, location, and whether the page is loaded in a browser.

#### My run is too expensive 💸

Lower `maxItems`, keep `downloadMedia` disabled, use `maxConcurrency: 1`, and start with `http_only`. Use browser fallback only when needed.

#### I see duplicate tweets ♻️

Keep `deduplicateBy: "tweetId"`. If you use `latest_and_top`, the same tweet can appear in both searches, so deduplication is recommended.

### For Developers 🧑‍💻

Run locally:

```bash
npm install
npm test
npm run build
npm run dev
```

Deploy to Apify:

```bash
apify push
```

### Support 🙋

If results look wrong, include the run ID, input JSON, and a short description of what you expected. The run summary and dataset warning records usually show whether the issue came from input settings, public X/Twitter access limits, or page changes.

# Actor input Schema

## `scrapeMode` (type: `string`):

How the Actor routes the input.

## `searchTerms` (type: `array`):

Raw X/Twitter search queries.

## `twitterHandles` (type: `array`):

Profile handles to scrape.

## `startUrls` (type: `array`):

Tweet, profile, list, or search URLs.

## `tweetIds` (type: `array`):

Tweet/status IDs to enrich.

## `userIds` (type: `array`):

Public numeric user IDs for future user-based routing.

## `queryWizard` (type: `object`):

Structured fields converted into X/Twitter search syntax.

## `sort` (type: `string`):

Result ordering strategy for search requests.

## `maxItems` (type: `integer`):

Maximum number of records to plan and push for the run.

## `maxItemsPerQuery` (type: `integer`):

Maximum number of records to collect for each query, URL, handle, or list.

## `maxItemsPerProfile` (type: `integer`):

Maximum number of records to collect for each profile timeline.

## `filters` (type: `object`):

Filters applied after extraction, such as language, engagement, media, and verification filters.

## `profileMode` (type: `string`):

Which public profile timeline view to scrape for handles and profile URLs.

## `includeReplies` (type: `boolean`):

Include reply posts where the selected mode supports replies.

## `includeRetweets` (type: `boolean`):

Include retweets where they are visible and supported by the selected mode.

## `includePinnedTweet` (type: `boolean`):

Include a profile's pinned tweet when it is present and visible.

## `conversationOptions` (type: `object`):

Controls for replies, parent context, quoted tweets, reply limits, and reply depth.

## `conversationOutputMode` (type: `string`):

Whether conversation records are emitted as flat rows or nested conversation data.

## `dateSplitStrategy` (type: `string`):

How date ranges are split into smaller search windows.

## `maxDaysPerWindow` (type: `integer`):

Maximum number of days in each generated date window.

## `authorDetailLevel` (type: `string`):

Amount of author profile metadata to include in tweet records.

## `includeMedia` (type: `boolean`):

Include media metadata such as media URLs, previews, dimensions, and alt text when available.

## `downloadMedia` (type: `boolean`):

Download media files into key-value storage. This increases runtime and storage cost.

## `mediaDownloadMode` (type: `string`):

Which media types to download when media downloading is enabled.

## `flattenOutput` (type: `boolean`):

Flatten selected nested output fields for easier CSV and spreadsheet exports.

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

Optional list of fields to keep in the final output records.

## `includeRawData` (type: `boolean`):

Include raw extracted page data in output records. This increases dataset size.

## `cleanText` (type: `boolean`):

Normalize whitespace in tweet text and store it as cleanText.

## `includeRagFields` (type: `boolean`):

Add AI/RAG-friendly content and metadata fields to tweet records.

## `deduplicateBy` (type: `string`):

Field or strategy used to detect duplicate tweet records.

## `deduplicateScope` (type: `string`):

Whether deduplication applies within the run, per query, or across monitoring runs.

## `monitoring` (type: `object`):

Stateful monitoring settings for repeated scheduled runs.

## `crawlStrategy` (type: `string`):

Use HTTP-only for the lowest cost. Browser modes cost more but may recover data from pages that need JavaScript.

## `browserFallbackOnEmpty` (type: `boolean`):

Only applies to HTTP first mode. Enabling this increases compute cost.

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

Maximum number of requests to process at the same time.

## `minConcurrency` (type: `integer`):

Minimum crawler concurrency for browser-based runs.

## `maxRequestRetries` (type: `integer`):

Number of retry attempts for failed requests.

## `requestTimeoutSecs` (type: `integer`):

Maximum time to spend on a single request before treating it as failed.

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

Optional Apify Proxy configuration for requests and browser fallback.

## `customMapFunction` (type: `string`):

Advanced JavaScript function body receiving record and helpers.

## `allowCustomFilter` (type: `boolean`):

Allow customMapFunction to remove records by returning null.

## `externalWebhookUrl` (type: `string`):

Optional endpoint that receives pushed output records as JSON.

## `debugMode` (type: `boolean`):

Enable extra logging and diagnostic output.

## `saveHtmlSnapshots` (type: `boolean`):

Save HTML snapshots for debugging. This increases storage usage.

## `saveFailedPages` (type: `boolean`):

Save failed pages for troubleshooting. This increases storage usage.

## Actor input object example

```json
{
  "scrapeMode": "auto",
  "searchTerms": [
    "from:NASA lang:en"
  ],
  "twitterHandles": [
    "NASA"
  ],
  "startUrls": [
    {
      "url": "https://x.com/NASA"
    }
  ],
  "sort": "latest",
  "maxItems": 100,
  "maxItemsPerQuery": 100,
  "maxItemsPerProfile": 100,
  "profileMode": "tweets",
  "includeReplies": false,
  "includeRetweets": false,
  "includePinnedTweet": true,
  "conversationOutputMode": "flat",
  "dateSplitStrategy": "none",
  "maxDaysPerWindow": 7,
  "authorDetailLevel": "standard",
  "includeMedia": true,
  "downloadMedia": false,
  "mediaDownloadMode": "metadata_only",
  "flattenOutput": false,
  "includeRawData": false,
  "cleanText": true,
  "includeRagFields": false,
  "deduplicateBy": "tweetId",
  "deduplicateScope": "run",
  "crawlStrategy": "http_only",
  "browserFallbackOnEmpty": false,
  "maxConcurrency": 1,
  "minConcurrency": 1,
  "maxRequestRetries": 0,
  "requestTimeoutSecs": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "allowCustomFilter": false,
  "debugMode": false,
  "saveHtmlSnapshots": false,
  "saveFailedPages": false
}
```

# Actor output Schema

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

Structured tweet, profile, user discovery, and error records.

## `summary` (type: `string`):

JSON summary with input, result, warning, error, and limit statistics.

# 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 = {
    "searchTerms": [
        "from:NASA lang:en"
    ],
    "twitterHandles": [
        "NASA"
    ],
    "startUrls": [
        {
            "url": "https://x.com/NASA"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("qaseemiqbal/x-twitter-intelligence-scraper-pro").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 = {
    "searchTerms": ["from:NASA lang:en"],
    "twitterHandles": ["NASA"],
    "startUrls": [{ "url": "https://x.com/NASA" }],
}

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

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

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

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "from:NASA lang:en"
  ],
  "twitterHandles": [
    "NASA"
  ],
  "startUrls": [
    {
      "url": "https://x.com/NASA"
    }
  ]
}' |
apify call qaseemiqbal/x-twitter-intelligence-scraper-pro --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=qaseemiqbal/x-twitter-intelligence-scraper-pro",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "X/Twitter Intelligence Scraper Pro",
        "description": "Scrape public X/Twitter posts and profiles from search terms, handles, tweet URLs, and lists. Export clean tweet, author, media, engagement, and monitoring data for research, marketing, and social listening.",
        "version": "1.0",
        "x-build-id": "Fd6xWeIbeN1xvE5E4"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/qaseemiqbal~x-twitter-intelligence-scraper-pro/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-qaseemiqbal-x-twitter-intelligence-scraper-pro",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/qaseemiqbal~x-twitter-intelligence-scraper-pro/runs": {
            "post": {
                "operationId": "runs-sync-qaseemiqbal-x-twitter-intelligence-scraper-pro",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/qaseemiqbal~x-twitter-intelligence-scraper-pro/run-sync": {
            "post": {
                "operationId": "run-sync-qaseemiqbal-x-twitter-intelligence-scraper-pro",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "scrapeMode": {
                        "title": "Scrape mode",
                        "enum": [
                            "auto",
                            "search",
                            "profiles",
                            "urls",
                            "lists",
                            "tweetDetails",
                            "conversation",
                            "monitoring",
                            "userDiscovery"
                        ],
                        "type": "string",
                        "description": "How the Actor routes the input.",
                        "default": "auto"
                    },
                    "searchTerms": {
                        "title": "Search terms",
                        "type": "array",
                        "description": "Raw X/Twitter search queries.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "twitterHandles": {
                        "title": "Twitter/X handles",
                        "type": "array",
                        "description": "Profile handles to scrape.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "Tweet, profile, list, or search URLs.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "title": "URL",
                                    "description": "X/Twitter tweet, profile, list, or search URL.",
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "tweetIds": {
                        "title": "Tweet IDs",
                        "type": "array",
                        "description": "Tweet/status IDs to enrich.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "userIds": {
                        "title": "User IDs",
                        "type": "array",
                        "description": "Public numeric user IDs for future user-based routing.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "queryWizard": {
                        "title": "Query Wizard",
                        "type": "object",
                        "description": "Structured fields converted into X/Twitter search syntax."
                    },
                    "sort": {
                        "title": "Sort",
                        "enum": [
                            "latest",
                            "top",
                            "latest_and_top",
                            "auto_fallback"
                        ],
                        "type": "string",
                        "description": "Result ordering strategy for search requests.",
                        "default": "latest"
                    },
                    "maxItems": {
                        "title": "Maximum items",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Maximum number of records to plan and push for the run.",
                        "default": 100
                    },
                    "maxItemsPerQuery": {
                        "title": "Maximum items per query",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Maximum number of records to collect for each query, URL, handle, or list.",
                        "default": 100
                    },
                    "maxItemsPerProfile": {
                        "title": "Maximum items per profile",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Maximum number of records to collect for each profile timeline.",
                        "default": 100
                    },
                    "filters": {
                        "title": "Post-processing filters",
                        "type": "object",
                        "description": "Filters applied after extraction, such as language, engagement, media, and verification filters."
                    },
                    "profileMode": {
                        "title": "Profile mode",
                        "enum": [
                            "tweets",
                            "tweets_and_replies",
                            "media",
                            "likes_if_public",
                            "profile_only"
                        ],
                        "type": "string",
                        "description": "Which public profile timeline view to scrape for handles and profile URLs.",
                        "default": "tweets"
                    },
                    "includeReplies": {
                        "title": "Include replies",
                        "type": "boolean",
                        "description": "Include reply posts where the selected mode supports replies.",
                        "default": false
                    },
                    "includeRetweets": {
                        "title": "Include retweets",
                        "type": "boolean",
                        "description": "Include retweets where they are visible and supported by the selected mode.",
                        "default": false
                    },
                    "includePinnedTweet": {
                        "title": "Include pinned tweet",
                        "type": "boolean",
                        "description": "Include a profile's pinned tweet when it is present and visible.",
                        "default": true
                    },
                    "conversationOptions": {
                        "title": "Conversation options",
                        "type": "object",
                        "description": "Controls for replies, parent context, quoted tweets, reply limits, and reply depth."
                    },
                    "conversationOutputMode": {
                        "title": "Conversation output mode",
                        "enum": [
                            "flat",
                            "nested"
                        ],
                        "type": "string",
                        "description": "Whether conversation records are emitted as flat rows or nested conversation data.",
                        "default": "flat"
                    },
                    "dateSplitStrategy": {
                        "title": "Date split strategy",
                        "enum": [
                            "none",
                            "daily",
                            "weekly",
                            "monthly",
                            "auto"
                        ],
                        "type": "string",
                        "description": "How date ranges are split into smaller search windows.",
                        "default": "none"
                    },
                    "maxDaysPerWindow": {
                        "title": "Maximum days per window",
                        "minimum": 1,
                        "maximum": 366,
                        "type": "integer",
                        "description": "Maximum number of days in each generated date window.",
                        "default": 7
                    },
                    "authorDetailLevel": {
                        "title": "Author detail level",
                        "enum": [
                            "minimal",
                            "standard",
                            "full"
                        ],
                        "type": "string",
                        "description": "Amount of author profile metadata to include in tweet records.",
                        "default": "standard"
                    },
                    "includeMedia": {
                        "title": "Include media metadata",
                        "type": "boolean",
                        "description": "Include media metadata such as media URLs, previews, dimensions, and alt text when available.",
                        "default": true
                    },
                    "downloadMedia": {
                        "title": "Download media",
                        "type": "boolean",
                        "description": "Download media files into key-value storage. This increases runtime and storage cost.",
                        "default": false
                    },
                    "mediaDownloadMode": {
                        "title": "Media download mode",
                        "enum": [
                            "metadata_only",
                            "download_images",
                            "download_videos",
                            "download_all"
                        ],
                        "type": "string",
                        "description": "Which media types to download when media downloading is enabled.",
                        "default": "metadata_only"
                    },
                    "flattenOutput": {
                        "title": "Flatten output",
                        "type": "boolean",
                        "description": "Flatten selected nested output fields for easier CSV and spreadsheet exports.",
                        "default": false
                    },
                    "outputFields": {
                        "title": "Output fields",
                        "type": "array",
                        "description": "Optional list of fields to keep in the final output records.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "includeRawData": {
                        "title": "Include raw data",
                        "type": "boolean",
                        "description": "Include raw extracted page data in output records. This increases dataset size.",
                        "default": false
                    },
                    "cleanText": {
                        "title": "Clean text",
                        "type": "boolean",
                        "description": "Normalize whitespace in tweet text and store it as cleanText.",
                        "default": true
                    },
                    "includeRagFields": {
                        "title": "Include RAG fields",
                        "type": "boolean",
                        "description": "Add AI/RAG-friendly content and metadata fields to tweet records.",
                        "default": false
                    },
                    "deduplicateBy": {
                        "title": "Deduplicate by",
                        "enum": [
                            "none",
                            "tweetId",
                            "url",
                            "contentHash"
                        ],
                        "type": "string",
                        "description": "Field or strategy used to detect duplicate tweet records.",
                        "default": "tweetId"
                    },
                    "deduplicateScope": {
                        "title": "Deduplicate scope",
                        "enum": [
                            "run",
                            "query",
                            "persistent"
                        ],
                        "type": "string",
                        "description": "Whether deduplication applies within the run, per query, or across monitoring runs.",
                        "default": "run"
                    },
                    "monitoring": {
                        "title": "Monitoring options",
                        "type": "object",
                        "description": "Stateful monitoring settings for repeated scheduled runs."
                    },
                    "crawlStrategy": {
                        "title": "Crawl strategy",
                        "enum": [
                            "http_only",
                            "http_first",
                            "browser_only"
                        ],
                        "type": "string",
                        "description": "Use HTTP-only for the lowest cost. Browser modes cost more but may recover data from pages that need JavaScript.",
                        "default": "http_only"
                    },
                    "browserFallbackOnEmpty": {
                        "title": "Use browser fallback on empty HTTP pages",
                        "type": "boolean",
                        "description": "Only applies to HTTP first mode. Enabling this increases compute cost.",
                        "default": false
                    },
                    "maxConcurrency": {
                        "title": "Maximum concurrency",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Maximum number of requests to process at the same time.",
                        "default": 1
                    },
                    "minConcurrency": {
                        "title": "Minimum concurrency",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Minimum crawler concurrency for browser-based runs.",
                        "default": 1
                    },
                    "maxRequestRetries": {
                        "title": "Maximum request retries",
                        "minimum": 0,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Number of retry attempts for failed requests.",
                        "default": 0
                    },
                    "requestTimeoutSecs": {
                        "title": "Request timeout seconds",
                        "minimum": 10,
                        "maximum": 300,
                        "type": "integer",
                        "description": "Maximum time to spend on a single request before treating it as failed.",
                        "default": 20
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional Apify Proxy configuration for requests and browser fallback.",
                        "default": {
                            "useApifyProxy": true
                        }
                    },
                    "customMapFunction": {
                        "title": "Custom map function",
                        "type": "string",
                        "description": "Advanced JavaScript function body receiving record and helpers."
                    },
                    "allowCustomFilter": {
                        "title": "Allow custom function to filter",
                        "type": "boolean",
                        "description": "Allow customMapFunction to remove records by returning null.",
                        "default": false
                    },
                    "externalWebhookUrl": {
                        "title": "External webhook URL",
                        "type": "string",
                        "description": "Optional endpoint that receives pushed output records as JSON."
                    },
                    "debugMode": {
                        "title": "Debug mode",
                        "type": "boolean",
                        "description": "Enable extra logging and diagnostic output.",
                        "default": false
                    },
                    "saveHtmlSnapshots": {
                        "title": "Save HTML snapshots",
                        "type": "boolean",
                        "description": "Save HTML snapshots for debugging. This increases storage usage.",
                        "default": false
                    },
                    "saveFailedPages": {
                        "title": "Save failed pages",
                        "type": "boolean",
                        "description": "Save failed pages for troubleshooting. This increases storage usage.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
