# Twitter Search Scraper (`epctex/twitter-search-scraper`) Actor

Scrape any keyword or hashtag from Twitter. Extract tweets, replies, favorites, retweets, and conversation threads without limit. Gather user-related information such as verification, location, profile image, friends, followers, following, and much more! Get everything with no limits on Twitter!!

- **URL**: https://apify.com/epctex/twitter-search-scraper.md
- **Developed by:** [epctex](https://apify.com/epctex) (community)
- **Categories:** Social media
- **Stats:** 1,048 total users, 1 monthly users, 0.0% runs succeeded, 19 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$20.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## 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

## Actor - Twitter Search Scraper

### 🐦 Twitter Search Scraper

The Twitter Search Scraper provides powerful tools to extract data from Twitter's search functionality, allowing you to find tweets based on keywords, phrases, and advanced search parameters.

### 🚀 Features and Functionality
Extremely detailed tweet information for data mining.

Multi-language support on Twitter. Globally working Twitter search actor. No restrictions!

Geo-target the tweets with advanced search capabilities. Integrate into your system with ease.

Lightning speed. Extreme efficiency. Suitable for integration into any platform.

**Query Wizard**: Easy-to-use Input for non-technical users. Create [Twitter Advanced Search](https://twitter.com/search-advanced) effortlessly.

A list of filters that you can easily use. Target your tweet search with precision!

#

- **Custom Start URLs**: Begin scraping from search query URLs.
     - Examples:
         - https://x.com/search?q=real%20madrid&src=typed_query
         - https://x.com/search?q=from%3AKMbappe&src=typed_query

- **Search Queries**: Provide a list of keywords or phrases to find tweets that match specific topics, such as "barca" or "atletico madrid"

- **Authentication Support**: Use Twitter authentication tokens for improved reliability and access to more data.

- **Search Modes**:
    - Choose between:
        - <ins>**Latest**</ins>: Most recent tweets
        - <ins>**Top**</ins>: Most popular tweets

- **Date Filters**:
    - Define specific date ranges for scraping:
        - Tweets newer than a specific date (YYYY-MM-DD)
        - Tweets older than a specific date (YYYY-MM-DD)

- **Content Filters**:
    - Customize the type of tweets to scrape:
        - Only tweets with media (images, videos, or GIFs)
        - Only tweets from verified users
        - Exclude replies, retweets, or links

- **Tweet Stats Filters**: Filter tweets based on minimum likes, replies, or retweets.

- **Account Filters**:
    - Scrape tweets:
        - From a specific account.
        - To a specific account.
        - Mentioning a specific account.

- **Language and Location**: Limit results to specific languages or find tweets near a defined location.

- **Proxy Configuration**: Use advanced proxy settings to ensure anonymous and efficient scraping.

- **Limitations**: Set limits on the number of tweets or pages to scrape for optimized performance.

These features allow for a highly customizable and efficient search process, suitable for various data collection needs.

### 😎 Who needs this?
Twitter Search Scraper is designed to provide enriched search data with high speed in a cost-effective manner. It serves a wide range of users:

- **Cryptocurrency Analysts and Investors** - can use Twitter Search Scraper to track sentiment, key influencers' opinions, and market-moving announcements related to cryptocurrencies. Catch the panic buy or panic sell right away.
- **Market Research Analysts** can use Twitter Search Scraper to gather public opinion and trends on different products, services, or topics. By analyzing tweets, they can identify consumer behavior patterns, preferences, and market trends, helping companies make informed decisions.
- **Academic Researchers** can use Twitter Search Scraper to analyze social behaviors, communication patterns, and public opinion on various topics. This can aid in understanding societal trends, public reactions to events, and the spread of information or misinformation.
- **Human Resources and Recruitment Specialists** can use Twitter Search Scraper to monitor industry trends, understand job market sentiments, and identify potential candidates for recruitment, enhancing their talent acquisition strategies.

### 🔧 Bugs, fixes, updates, and changelog

This scraper is under active development. If you have any feature requests you can create an issue from [here](https://github.com/epctex/twitter-search-scraper/issues).


### ⚙️ Input and Definitions
| Field | Type | Description
| ----- | ---- | ----------- |
startUrls | array | Twitter (X) search URLs.
searchTerms | array | Search terms or queries you want to search from Twitter (X). Check [this](https://github.com/igorbrigadir/twitter-advanced-search) page for further reference.
sort | String | Sort order for search tweets. It can be either "Latest" or "Top".
authTokens | array | Authentication tokens for Twitter (X) to improve reliability and access more data.
maxItems | number | Maximum number of items that you want to receive as output
tweetLanguage | string | Restricts tweets to the given language, given by an ISO 639-1 code.
onlyVerifiedUsers | boolean | Returns only tweets by users who are verified.
onlyTwitterBlue | boolean | Returns only tweets by users who are Twitter Blue subscribers.
onlyImage | boolean | Returns only tweets that contain images.
onlyVideo | boolean | Returns only tweets that contain videos.
onlyQuote | boolean | Returns only tweets that are quotes.
author | String | Returns tweets sent by the given user. It should be a Twitter (X) Handle.
inReplyTo | String | Returns tweets that are replies to the given user. It should be a Twitter (X) Handle.
mentioning | String | Returns tweets mentioning the given user. It should be a Twitter (X) Handle.
geotaggedNear | String | Returns tweets sent near the given location.
withinRadius | String | Returns tweets sent within the given radius of the given location.
geocode | String | Returns tweets sent by users located within a given radius of the given latitude/longitude.
placeObjectId | String | Returns tweets tagged with the given place.
minimumRetweets | number | Returns tweets with at least the given number of retweets.
minimumFavorites | number | Returns tweets with at least the given number of favorites.
minimumReplies | number | Returns tweets with at least the given number of replies.
start | String | Returns tweets sent after the given date.
end | String | Returns tweets sent before the given date.
includeSearchTerms | boolean | If selected, a field will be added to each tweet about the search term that was used to find it.
customMapFunction | string | Function that takes each of the objects as argument and returns data that will be mapped by the function itself.
proxy | object | Select proxies to be used by your crawler.


This solution requires the use of **Proxy servers**, either your own proxy servers or you can use [Apify Proxy](https://www.apify.com/docs/proxy).

#### Tip

**Important**: You must provide your own Twitter/X authentication tokens in the `authTokens` array for the scraper to work. These can be obtained from your Twitter accounts.

When you want to scrape over a specific search URL, just copy and paste the link as one of the **startUrl**.

If you would like to scrape only the first page of search results then put the link for the page and have the `endPage` as 1.

With the last approach that is explained above you can also fetch any interval of pages. If you provide the 5th page of a search and define the `endPage` parameter as 6 then you'll have the 5th and 6th pages only.

#### Compute Unit Consumption

The actor is optimized to run blazing fast and scrape many tweets as possible. Therefore, it forefronts all tweet detail requests. If the actor doesn't block very often it'll scrape 100 tweets in 20 seconds with ~0.02-0.025 compute units.

#### Twitter Search Scraper Input example

```json
{
    "proxy": {
        "useApifyProxy": true
    },
    "startUrls": [
        "https://x.com/KMbappe",
        "https://x.com/search?q=real%20madrid&src=typed_query",
        "https://x.com/realmadrid/status/1877491794000412879"
    ],
    "searchQueries": [
        "barcelona",
        "atletico madrid"
    ],
    "searchMode": "Latest",
    "maxItems": 100,
    "endPage": 5,
    "authTokens": [
        "auth_token_example_1",
        "auth_token_example_2"
    ],
}
````

### During the Run

During the run, the actor will output messages letting you know what is going on. Each message always contains a short label specifying which page from the provided list is currently specified.
When items are loaded from the page, you should see a message about this event with a loaded item count and total item count for each page.

If you provide incorrect input to the actor, it will immediately stop with a failure state and output an explanation of what is wrong.

### Tweet Export

During the run, the actor stores results into a dataset. Each tweet is a separate item in the dataset.

You can manage the results in any language (Python, PHP, Node JS/NPM). See the FAQ or <a href="https://www.apify.com/docs/api" target="blank">our API reference</a> to learn more about getting results from this Twitter Search actor.

### Scraped Twitter Properties

The structure of each tweet looks like this:

#### Tweet Detail

```json
{
	"id": "1877102356627673443",
	"url": "https://x.com/10Ronaldinho/status/1877102356627673443",
	"text": "Hermosos recuerdos en Barcelona... Sempre Barça!!!!! https://t.co/1ljiuvNHf9",
	"retweetCount": 4078,
	"replyCount": 357,
	"likeCount": 58982,
	"quoteCount": 147,
	"createdAt": "Wed Jan 08 21:17:31 +0000 2025",
	"lang": "es",
	"protected": false,
	"bookmarkCount": 421,
	"isReply": false,
	"entities": {
		"hashtags": [],
		"media": [
			{
				"display_url": "pic.x.com/1ljiuvNHf9",
				"expanded_url": "https://x.com/10Ronaldinho/status/1877102356627673443/photo/1",
				"id_str": "1877102283202162688",
				"indices": [
					53,
					76
				],
				"media_key": "3_1877102283202162688",
				"media_url_https": "https://pbs.twimg.com/media/GgzOlM1W8AAXri7.jpg",
				"type": "photo",
				"url": "https://t.co/1ljiuvNHf9",
				"ext_media_availability": {
					"status": "Available"
				},
				"features": {
					"all": {
						"tags": [
							{
								"user_id": "96951800",
								"name": "FC Barcelona",
								"screen_name": "FCBarcelona",
								"type": "user"
							}
						]
					},
					"large": {
						"faces": []
					},
					"medium": {
						"faces": []
					},
					"small": {
						"faces": []
					},
					"orig": {
						"faces": []
					}
				},
				"sizes": {
					"large": {
						"h": 1280,
						"w": 1280,
						"resize": "fit"
					},
					"medium": {
						"h": 1200,
						"w": 1200,
						"resize": "fit"
					},
					"small": {
						"h": 680,
						"w": 680,
						"resize": "fit"
					},
					"thumb": {
						"h": 150,
						"w": 150,
						"resize": "crop"
					}
				},
				"original_info": {
					"height": 1280,
					"width": 1280,
					"focus_rects": [
						{
							"x": 0,
							"y": 0,
							"w": 1280,
							"h": 717
						},
						{
							"x": 0,
							"y": 0,
							"w": 1280,
							"h": 1280
						},
						{
							"x": 111,
							"y": 0,
							"w": 1123,
							"h": 1280
						},
						{
							"x": 352,
							"y": 0,
							"w": 640,
							"h": 1280
						},
						{
							"x": 0,
							"y": 0,
							"w": 1280,
							"h": 1280
						}
					]
				},
				"media_results": {
					"result": {
						"media_key": "3_1877102283202162688"
					}
				}
			}
		],
		"symbols": [],
		"timestamps": [],
		"urls": [],
		"user_mentions": []
	},
	"extentedEntities": {
		"media": [
			{
				"display_url": "pic.x.com/1ljiuvNHf9",
				"expanded_url": "https://x.com/10Ronaldinho/status/1877102356627673443/photo/1",
				"id_str": "1877102283202162688",
				"indices": [
					53,
					76
				],
				"media_key": "3_1877102283202162688",
				"media_url_https": "https://pbs.twimg.com/media/GgzOlM1W8AAXri7.jpg",
				"type": "photo",
				"url": "https://t.co/1ljiuvNHf9",
				"ext_media_availability": {
					"status": "Available"
				},
				"features": {
					"all": {
						"tags": [
							{
								"user_id": "96951800",
								"name": "FC Barcelona",
								"screen_name": "FCBarcelona",
								"type": "user"
							}
						]
					},
					"large": {
						"faces": []
					},
					"medium": {
						"faces": []
					},
					"small": {
						"faces": []
					},
					"orig": {
						"faces": []
					}
				},
				"sizes": {
					"large": {
						"h": 1280,
						"w": 1280,
						"resize": "fit"
					},
					"medium": {
						"h": 1200,
						"w": 1200,
						"resize": "fit"
					},
					"small": {
						"h": 680,
						"w": 680,
						"resize": "fit"
					},
					"thumb": {
						"h": 150,
						"w": 150,
						"resize": "crop"
					}
				},
				"original_info": {
					"height": 1280,
					"width": 1280,
					"focus_rects": [
						{
							"x": 0,
							"y": 0,
							"w": 1280,
							"h": 717
						},
						{
							"x": 0,
							"y": 0,
							"w": 1280,
							"h": 1280
						},
						{
							"x": 111,
							"y": 0,
							"w": 1123,
							"h": 1280
						},
						{
							"x": 352,
							"y": 0,
							"w": 640,
							"h": 1280
						},
						{
							"x": 0,
							"y": 0,
							"w": 1280,
							"h": 1280
						}
					]
				},
				"media_results": {
					"result": {
						"media_key": "3_1877102283202162688"
					}
				}
			}
		]
	},
	"author": {
		"username": "10Ronaldinho",
		"url": "https://x.com/10Ronaldinho",
		"id": "29479000",
		"name": "Ronaldinho",
		"isVerified": false,
		"isBlueVerified": true,
		"profilePicture": "https://pbs.twimg.com/profile_images/1537593562619060225/AmmxIwWi_normal.jpg",
		"coverPicture": "https://pbs.twimg.com/profile_banners/29479000/1650911561",
		"description": "Twitter oficial de Ronaldinho Gaúcho. Duas vezes eleito o melhor do mundo pela FIFA.\n\n@BetifyOfficial embaixador\nhttps://t.co/jctU4nkSvp",
		"location": "",
		"followers": 21437149,
		"following": 152,
		"canDm": false,
		"canMediaTag": false,
		"createdAt": "Tue Apr 07 16:11:50 +0000 2009",
		"entities": {
			"description": {
				"urls": [
					{
						"display_url": "bit.ly/RonniexBetify",
						"expanded_url": "https://bit.ly/RonniexBetify",
						"url": "https://t.co/jctU4nkSvp",
						"indices": [
							113,
							136
						]
					}
				]
			},
			"url": {
				"urls": [
					{
						"display_url": "nooke.ag",
						"expanded_url": "http://www.nooke.ag",
						"url": "https://t.co/f6O6lqd6yM",
						"indices": [
							0,
							23
						]
					}
				]
			}
		},
		"fastFollowersCount": 0,
		"favouritesCount": 1552,
		"listedCount": 26192,
		"hasCustomTimelines": false,
		"isTranslator": false,
		"mediaCount": 3449,
		"statusesCount": 7101,
		"withheldInCountries": [],
		"affiliatesHighlightedLabel": {}
	}
}
```

### Contact

Please visit us through [epctex.com](https://epctex.com) to see all the products that are available for you. If you are looking for any custom integration or so, please reach out to us through the chat box in [epctex.com](https://epctex.com). In need of support? <business@epctex.com> is at your service.

# Actor input Schema

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

You can provide a list of starting URLs for the scraper, which may include search URLs only.

## `authTokens` (type: `array`):

Select authentication tokens to be used by your crawler.

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

Search terms you want to search from Twitter (X). You can refer to https://github.com/igorbrigadir/twitter-advanced-search.

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

Maximum number of items that you want as output.

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

Sorts search results by the given option. Only works with search terms and search URLs.

## `tweetLanguage` (type: `string`):

Restricts tweets to the given language, given by an ISO 639-1 code.

## `onlyVerifiedUsers` (type: `boolean`):

If selected, only returns tweets by users who are verified.

## `onlyTwitterBlue` (type: `boolean`):

If selected, only returns tweets by users who are Twitter Blue subscribers.

## `onlyImage` (type: `boolean`):

If selected, only returns tweets that contain images.

## `onlyVideo` (type: `boolean`):

If selected, only returns tweets that contain videos.

## `onlyQuote` (type: `boolean`):

If selected, only returns tweets that are quotes.

## `author` (type: `string`):

Returns tweets sent by the given user. It should be a Twitter (X) Handle.

## `inReplyTo` (type: `string`):

Returns tweets that are replies to the given user. It should be a Twitter (X) Handle.

## `mentioning` (type: `string`):

Returns tweets mentioning the given user. It should be a Twitter (X) Handle.

## `geotaggedNear` (type: `string`):

Returns tweets sent near the given location.

## `withinRadius` (type: `string`):

Returns tweets sent within the given radius of the given location.

## `geocode` (type: `string`):

Returns tweets sent by users located within a given radius of the given latitude/longitude.

## `placeObjectId` (type: `string`):

Returns tweets tagged with the given place.

## `minimumRetweets` (type: `integer`):

Returns tweets with at least the given number of retweets.

## `minimumFavorites` (type: `integer`):

Returns tweets with at least the given number of favorites.

## `minimumReplies` (type: `integer`):

Returns tweets with at least the given number of replies.

## `start` (type: `string`):

Returns tweets sent after the given date.

## `end` (type: `string`):

Returns tweets sent before the given date.

## `includeSearchTerms` (type: `boolean`):

If selected, a field will be added to each tweets about the search term that was used to find it.

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

Function that takes each of the objects as argument and returns data that will be mapped by the function itself. This function is not intended for filtering, please don't use it for filtering purposes or you will get banned automatically.

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "startUrls": [
    "https://x.com/search?q=real%20madrid&src=typed_query"
  ],
  "searchTerms": [
    "web scraping",
    "scraping from:apify"
  ],
  "maxItems": 1000,
  "sort": "Latest",
  "tweetLanguage": "en",
  "author": "apify",
  "inReplyTo": "webexpo",
  "mentioning": "elonmusk",
  "geotaggedNear": "Los Angeles",
  "withinRadius": "15km",
  "geocode": "37.7764685,-122.4172004,10km",
  "placeObjectId": "96683cc9126741d1",
  "minimumRetweets": 5,
  "minimumFavorites": 5,
  "minimumReplies": 5,
  "start": "2021-07-01",
  "end": "2021-07-02",
  "customMapFunction": "(object) => { return {...object} }",
  "proxy": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "startUrls": [
        "https://x.com/search?q=real%20madrid&src=typed_query"
    ],
    "searchTerms": [
        "web scraping",
        "scraping from:apify"
    ],
    "maxItems": 1000,
    "sort": "Latest",
    "tweetLanguage": "en",
    "author": "apify",
    "inReplyTo": "webexpo",
    "mentioning": "elonmusk",
    "geotaggedNear": "Los Angeles",
    "withinRadius": "15km",
    "geocode": "37.7764685,-122.4172004,10km",
    "placeObjectId": "96683cc9126741d1",
    "minimumRetweets": 5,
    "minimumFavorites": 5,
    "minimumReplies": 5,
    "start": "2021-07-01",
    "end": "2021-07-02",
    "customMapFunction": (object) => { return {...object} }
};

// Run the Actor and wait for it to finish
const run = await client.actor("epctex/twitter-search-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 = {
    "startUrls": ["https://x.com/search?q=real%20madrid&src=typed_query"],
    "searchTerms": [
        "web scraping",
        "scraping from:apify",
    ],
    "maxItems": 1000,
    "sort": "Latest",
    "tweetLanguage": "en",
    "author": "apify",
    "inReplyTo": "webexpo",
    "mentioning": "elonmusk",
    "geotaggedNear": "Los Angeles",
    "withinRadius": "15km",
    "geocode": "37.7764685,-122.4172004,10km",
    "placeObjectId": "96683cc9126741d1",
    "minimumRetweets": 5,
    "minimumFavorites": 5,
    "minimumReplies": 5,
    "start": "2021-07-01",
    "end": "2021-07-02",
    "customMapFunction": "(object) => { return {...object} }",
}

# Run the Actor and wait for it to finish
run = client.actor("epctex/twitter-search-scraper").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 '{
  "startUrls": [
    "https://x.com/search?q=real%20madrid&src=typed_query"
  ],
  "searchTerms": [
    "web scraping",
    "scraping from:apify"
  ],
  "maxItems": 1000,
  "sort": "Latest",
  "tweetLanguage": "en",
  "author": "apify",
  "inReplyTo": "webexpo",
  "mentioning": "elonmusk",
  "geotaggedNear": "Los Angeles",
  "withinRadius": "15km",
  "geocode": "37.7764685,-122.4172004,10km",
  "placeObjectId": "96683cc9126741d1",
  "minimumRetweets": 5,
  "minimumFavorites": 5,
  "minimumReplies": 5,
  "start": "2021-07-01",
  "end": "2021-07-02",
  "customMapFunction": "(object) => { return {...object} }"
}' |
apify call epctex/twitter-search-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Twitter Search Scraper",
        "description": "Scrape any keyword or hashtag from Twitter. Extract tweets, replies, favorites, retweets, and conversation threads without limit. Gather user-related information such as verification, location, profile image, friends, followers, following, and much more! Get everything with no limits on Twitter!!",
        "version": "0.0",
        "x-build-id": "gTUtIjRaRRKlmT3Od"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/epctex~twitter-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-epctex-twitter-search-scraper",
                "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/epctex~twitter-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-epctex-twitter-search-scraper",
                "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/epctex~twitter-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-epctex-twitter-search-scraper",
                "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",
                "required": [
                    "authTokens"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "You can provide a list of starting URLs for the scraper, which may include search URLs only.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "authTokens": {
                        "title": "Authentication configuration",
                        "type": "array",
                        "description": "Select authentication tokens to be used by your crawler.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "searchTerms": {
                        "title": "Search Terms",
                        "type": "array",
                        "description": "Search terms you want to search from Twitter (X). You can refer to https://github.com/igorbrigadir/twitter-advanced-search.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxItems": {
                        "title": "Maximum number of items on output",
                        "type": "integer",
                        "description": "Maximum number of items that you want as output."
                    },
                    "sort": {
                        "title": "Sort By",
                        "enum": [
                            "Top",
                            "Latest"
                        ],
                        "type": "string",
                        "description": "Sorts search results by the given option. Only works with search terms and search URLs."
                    },
                    "tweetLanguage": {
                        "title": "Tweet language",
                        "enum": [
                            "ab",
                            "aa",
                            "af",
                            "ak",
                            "sq",
                            "am",
                            "ar",
                            "an",
                            "hy",
                            "as",
                            "av",
                            "ae",
                            "ay",
                            "az",
                            "bm",
                            "ba",
                            "eu",
                            "be",
                            "bn",
                            "bi",
                            "bs",
                            "br",
                            "bg",
                            "my",
                            "ca",
                            "ch",
                            "ce",
                            "ny",
                            "zh",
                            "cu",
                            "cv",
                            "kw",
                            "co",
                            "cr",
                            "hr",
                            "cs",
                            "da",
                            "dv",
                            "nl",
                            "dz",
                            "en",
                            "eo",
                            "et",
                            "ee",
                            "fo",
                            "fj",
                            "fi",
                            "fr",
                            "fy",
                            "ff",
                            "gd",
                            "gl",
                            "lg",
                            "ka",
                            "de",
                            "el",
                            "kl",
                            "gn",
                            "gu",
                            "ht",
                            "ha",
                            "he",
                            "hz",
                            "hi",
                            "ho",
                            "hu",
                            "is",
                            "io",
                            "ig",
                            "id",
                            "ia",
                            "ie",
                            "iu",
                            "ik",
                            "ga",
                            "it",
                            "ja",
                            "jv",
                            "kn",
                            "kr",
                            "ks",
                            "kk",
                            "km",
                            "ki",
                            "rw",
                            "ky",
                            "kv",
                            "kg",
                            "ko",
                            "kj",
                            "ku",
                            "lo",
                            "la",
                            "lv",
                            "li",
                            "ln",
                            "lt",
                            "lu",
                            "lb",
                            "mk",
                            "mg",
                            "ms",
                            "ml",
                            "mt",
                            "gv",
                            "mi",
                            "mr",
                            "mh",
                            "mn",
                            "na",
                            "nv",
                            "nd",
                            "nr",
                            "ng",
                            "ne",
                            "no",
                            "nb",
                            "nn",
                            "ii",
                            "oc",
                            "oj",
                            "or",
                            "om",
                            "os",
                            "pi",
                            "ps",
                            "fa",
                            "pl",
                            "pt",
                            "pa",
                            "qu",
                            "ro",
                            "rm",
                            "rn",
                            "ru",
                            "se",
                            "sm",
                            "sg",
                            "sa",
                            "sc",
                            "sr",
                            "sn",
                            "sd",
                            "si",
                            "sk",
                            "sl",
                            "so",
                            "st",
                            "es",
                            "su",
                            "sw",
                            "ss",
                            "sv",
                            "tl",
                            "ty",
                            "tg",
                            "ta",
                            "tt",
                            "te",
                            "th",
                            "bo",
                            "ti",
                            "to",
                            "ts",
                            "tn",
                            "tr",
                            "tk",
                            "tw",
                            "ug",
                            "uk",
                            "ur",
                            "uz",
                            "ve",
                            "vi",
                            "vo",
                            "wa",
                            "cy",
                            "wo",
                            "xh",
                            "yi",
                            "yo",
                            "za",
                            "zu"
                        ],
                        "type": "string",
                        "description": "Restricts tweets to the given language, given by an ISO 639-1 code."
                    },
                    "onlyVerifiedUsers": {
                        "title": "Only verified users",
                        "type": "boolean",
                        "description": "If selected, only returns tweets by users who are verified."
                    },
                    "onlyTwitterBlue": {
                        "title": "Only Twitter Blue",
                        "type": "boolean",
                        "description": "If selected, only returns tweets by users who are Twitter Blue subscribers."
                    },
                    "onlyImage": {
                        "title": "Only image",
                        "type": "boolean",
                        "description": "If selected, only returns tweets that contain images."
                    },
                    "onlyVideo": {
                        "title": "Only video",
                        "type": "boolean",
                        "description": "If selected, only returns tweets that contain videos."
                    },
                    "onlyQuote": {
                        "title": "Only quote",
                        "type": "boolean",
                        "description": "If selected, only returns tweets that are quotes."
                    },
                    "author": {
                        "title": "Tweet author",
                        "type": "string",
                        "description": "Returns tweets sent by the given user. It should be a Twitter (X) Handle."
                    },
                    "inReplyTo": {
                        "title": "In reply to",
                        "type": "string",
                        "description": "Returns tweets that are replies to the given user. It should be a Twitter (X) Handle."
                    },
                    "mentioning": {
                        "title": "Mentioning",
                        "type": "string",
                        "description": "Returns tweets mentioning the given user. It should be a Twitter (X) Handle."
                    },
                    "geotaggedNear": {
                        "title": "Geotagged near",
                        "type": "string",
                        "description": "Returns tweets sent near the given location."
                    },
                    "withinRadius": {
                        "title": "Within radius",
                        "type": "string",
                        "description": "Returns tweets sent within the given radius of the given location."
                    },
                    "geocode": {
                        "title": "Geocode",
                        "type": "string",
                        "description": "Returns tweets sent by users located within a given radius of the given latitude/longitude."
                    },
                    "placeObjectId": {
                        "title": "Place object ID",
                        "type": "string",
                        "description": "Returns tweets tagged with the given place."
                    },
                    "minimumRetweets": {
                        "title": "Minimum retweets",
                        "type": "integer",
                        "description": "Returns tweets with at least the given number of retweets."
                    },
                    "minimumFavorites": {
                        "title": "Minimum favorites",
                        "type": "integer",
                        "description": "Returns tweets with at least the given number of favorites."
                    },
                    "minimumReplies": {
                        "title": "Minimum replies",
                        "type": "integer",
                        "description": "Returns tweets with at least the given number of replies."
                    },
                    "start": {
                        "title": "Start date",
                        "type": "string",
                        "description": "Returns tweets sent after the given date."
                    },
                    "end": {
                        "title": "End date",
                        "type": "string",
                        "description": "Returns tweets sent before the given date."
                    },
                    "includeSearchTerms": {
                        "title": "Include Search Terms",
                        "type": "boolean",
                        "description": "If selected, a field will be added to each tweets about the search term that was used to find it."
                    },
                    "customMapFunction": {
                        "title": "Custom map function",
                        "type": "string",
                        "description": "Function that takes each of the objects as argument and returns data that will be mapped by the function itself. This function is not intended for filtering, please don't use it for filtering purposes or you will get banned automatically."
                    },
                    "proxy": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxies to be used by your crawler.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
