# Tweet Scraper V2 - X Scraper / Twitter Scraper / X.com Scraper (`apidojo/tweet-scraper`) Actor

Lightning-fast search, URL, list, and profile scraping, with customizable filters. At $0.40 per 1000 tweets, and 30-80 tweets per second, it is ideal for researchers, entrepreneurs, and businesses! Get comprehensive insights from Twitter (X) now!

- **URL**: https://apify.com/apidojo/tweet-scraper.md
- **Developed by:** [API Dojo](https://apify.com/apidojo) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 132,482 total users, 10,823 monthly users, 100.0% runs succeeded, 1,502 bookmarks
- **User rating**: 3.86 out of 5 stars

## Pricing

from $0.40 / 1,000 tweets

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Tweet Scraper: Last Tweet Scraper you will ever need

Twitter Scraper - X Scraper - X.com Scraper

## TL;DR

This actor supports [Twitter advanced search queries](https://github.com/igorbrigadir/twitter-advanced-search) - the most powerful way to use it. You can use the same query syntax that works on Twitter's search. Just put your query in the `searchTerms` input and the scraper will fetch exactly what you'd see on Twitter. Single queries can return **100K+ tweets** when there's enough data.

Don't know the query syntax? Use the **Query Wizard** in the actor's interface - it builds queries for you through simple filters.

**Quick start example:**

```json
{
    "searchTerms": ["from:NASA"],
    "sort": "Latest"
}
```

### How It Works

This actor is optimized for **large-scale data extraction**. The most powerful way to use it is through [Twitter advanced search queries](https://github.com/igorbrigadir/twitter-advanced-search) using the `searchTerms` input. Single queries can return **100K+ tweets** when there's enough data available.

**Pro tip**: You can test your queries directly on Twitter's search before running them here - the scraper fetches what you see.

> ### ⚠️ IMPORTANT NOTE ABOUT PRICING
>
> Please familiarize yourself with the [pricing](https://apify.com/apidojo/tweet-scraper/pricing?fpr=yhdrb) before using this actor.
>
> - **Pricing**: $0.40 per 1,000 tweets
> - **Minimum requirement**: Each query must return **at least 50 tweets**
> - **Free users**: Limited to **5 runs per month**, each capped at **10 items**
> - **Single tweet fetching and conversation scraping are not allowed** on this actor
>
> 📌 **Need fewer than 50 tweets, single tweets, or conversation threads?** Use [Twitter Scraper Unlimited](https://apify.com/apidojo/twitter-scraper-lite?fpr=yhdrb) instead - it has event-based pricing that supports all use cases with no restrictions.
>
> ⚠️ **Heads up:** If you are getting low results with your queries, try using `sort: Top` instead of `Latest`. We have recently noticed lower result counts especially when using `until` in queries — you can also try removing `until` to maximize results.
>
> We also added a new sort option called **Latest + Top**. When selected, the actor runs both Latest and Top searches simultaneously to maximize results. Note that this may produce some duplicate tweets since both modes can return the same tweet.

#### Query Wizard

Don't know Twitter query syntax? No problem! This actor includes a **Query Wizard** that lets you build complex queries through a simple interface. Just fill in the filters (author, date range, engagement minimums, etc.) and the wizard generates the query for you.

#### About Missing Tweets

Some tweets may not appear in search results due to Twitter's shadow banning or content filtering. This is outside our control. If you're missing tweets from a specific account, try:

- Using different date ranges
- Checking if the account is shadow-banned on Twitter directly

> **Note:** This actor returns raw data exactly as Twitter serves it—we apply no filters or modifications. Twitter may change its search behavior, pagination, or filters at any time without notice, which can affect result counts or content. We strongly recommend testing your queries on [Twitter's web search](https://x.com/search) before initiating large runs.

### Examples

#### Fetch tweets from a profile

```json
{
    "searchTerms": ["from:NASA"],
    "sort": "Latest"
}
```

#### Fetch tweets with date ranges

```json
{
    "searchTerms": [
        "from:NASA since:2024-01-01 until:2024-06-01",
        "from:NASA since:2024-06-01 until:2024-12-01"
    ],
    "sort": "Latest"
}
```

#### Search for keywords

```json
{
    "searchTerms": ["artificial intelligence"],
    "tweetLanguage": "en",
    "sort": "Latest"
}
```

#### Tweets with media from a user

```json
{
    "searchTerms": ["from:NASA filter:media"]
}
```

#### Exclude retweets

```json
{
    "searchTerms": ["from:elonmusk -filter:retweets"]
}
```

#### Mentions of a user

```json
{
    "searchTerms": ["@NASA"]
}
```

#### Tweets with specific hashtags

```json
{
    "searchTerms": ["#AI lang:en"],
    "sort": "Latest"
}
```

#### Tweets from verified users on a topic

```json
{
    "searchTerms": ["cryptocurrency filter:verified"],
    "sort": "Top"
}
```

For more query options, see the [Twitter Advanced Search documentation](https://github.com/igorbrigadir/twitter-advanced-search).

### Important Note

1. **Minimum 50 tweets per query** - If your query might return fewer results, use [Twitter Scraper Unlimited](https://apify.com/apidojo/twitter-scraper-lite?fpr=yhdrb) instead
2. **Max 1 concurrent run** with up to 5 batched queries
3. **No monitoring** - Don't run the same query repeatedly in short intervals
4. **No single tweet fetching** - Use [Twitter Scraper Unlimited](https://apify.com/apidojo/twitter-scraper-lite?fpr=yhdrb) for this
5. **No conversation/reply scraping** - Use [Twitter Scraper Unlimited](https://apify.com/apidojo/twitter-scraper-lite?fpr=yhdrb) for fetching replies to specific tweets

> 💡 **When to use Twitter Scraper Unlimited instead:**
>
> - Fetching single tweets or tweet URLs
> - Scraping conversation threads / replies to tweets
> - Queries that might return fewer than 50 results
> - Any use case requiring flexibility without restrictions

### ℹ️ Why Choose This Actor?

- **Daily maintenance** by a dedicated team of engineers ensures maximum stability and reliability.
- **Battle-tested infrastructure** with multiple scraping mechanisms, automatic retries, and fallback strategies - the most robust solution available.
- **Enterprise-grade trust** - our clients fetch millions of tweets daily, relying on this actor for critical business operations.

No bullsh\*t - just data. You name it, we get it.

### 🐉 Features and Functionality

- Incredibly speedy, highly efficient, and suitable for all types of applications.
- **Query Wizard**: Create queries effortlessly without requiring knowledge of complex search terms.
- A wide array of filters at your disposal, including options for timeframes, targeting, and more.
- In-depth user information for thorough data analysis.
- Support for multiple languages to accommodate global requirements.
- Precise data pinpointing through geo-targeting and geolocation support.

### 🆓 Demo Mode & Free Users

Users on the Free Plan can use the actor only in Demo Mode. **Free users can run the actor up to 5 times per month**, with each run capped at a maximum of 10 items — just enough to test it out. Free users also cannot use the actor via API. To use this actor without limitations, subscribe to a paid plan on Apify. [Subscribe here](https://apify.com/pricing?fpr=yhdrb).

### 👹 Competitors

Well, this is the place where we should go crazy. But we don't. Try it, and you will see the difference. Please be aware that although all the tests used identical inputs and resources, the recorded speeds and costs may differ and might not accurately reflect the real metrics.

| Feature | 🏯 Tweet Scraper | Microworlds Twitter Scraper | Quacker Twitter-scraper
| ----- | ---- | ----------- | -------------|
| Working Twitter Search | ✔️ | ✔️ | ✔️ |
| Query Wizard  | ✔️ | ❌ | ❌ |
| Search Data Range | Unlimited | Unlimited | N/A |
| Price Per 100k Results (Tweet URL)  | $40 | $150 | $9.56	 |
| Price Per 100k Results (Profile)  | $40 | $150 | $2.25 |
| Price Per 100k Results (Profile with Filtering) | $40 | $150 | N/A |
| Price Per 100k Results (Search) | $40 | $150 | N/A |
| Tweets Per Second (URL) | 64 | 24 | 7 |
| Tweets Per Second (Profile) | 58 | 13 | 15 |
| Tweets Per Second (Search)  | 49 | 14 | N/A |
| Pricing Plan  | $0.40 per 1k results | $1 per 1k results | Pay for Usage |
| Maximum Tweets Per Input Limit  | ✔️ | ✔️ | ✔️ |
| Maximum Tweets Total Limit  | ✔️ | ✔️ | ❌ |
| Maximum Profiles Scraped Limit  | ✔️ | ✔️ | ❌ |
| Language Detection  | ✔️ | ✔️ | ❌ |
| Collect Detailed User Info  | ✔️ | ✔️ | ✔️ |
| Scrape Specific Profiles  | ✔️ | ✔️ | ✔️ |
| Scrape From Tweet URLs  | ✔️ | ✔️ | ✔️ |
| Scrape From Twitter List URLs | ✔️ | ❌ | ✔️ |
| Advanced User Information | ✔️ | ✔️ | ❌ |
| Advanced Filtering Options in Interface | ✔️ | ✔️ | ❌ |
| Date Range Interface  | ✔️ | ✔️ | ✔️ |
| Maximum Attempts  | ✔️ | ✔️ | ❌ |
| No Proxy Required | ✔️ | ✔️ | ❌ |

### 🎎 Who needs this?

Tweet Scraper is designed for **large-scale data extraction**:

- **Data Analysts** engaged in extensive scraping tasks - Tweet Scraper handles large data volumes efficiently and cost-effectively.
- **Data Enthusiasts** who need detailed, filtered scraping with robust filtering capabilities.
- **Researchers** conducting comprehensive search scraping to unearth valuable insights.
- **Entrepreneurs** with time-sensitive tasks who benefit from Tweet Scraper's lightweight design and swift startup.

While Tweet Scraper excels at large-scale tasks, for smaller or more flexible use cases, consider [Twitter Scraper Unlimited](https://apify.com/apidojo/twitter-scraper-lite?fpr=yhdrb).

### 🍜 Output Example

```json
{
	"type": "tweet",
	"id": "1728108619189874825",
	"url": "https://x.com/elonmusk/status/1728108619189874825",
	"twitterUrl": "https://twitter.com/elonmusk/status/1728108619189874825",
	"text": "More than 10 per human on average",
	"retweetCount": 11311,
	"replyCount": 6526,
	"likeCount": 104121,
	"quoteCount": 2915,
	"createdAt": "Fri Nov 24 17:49:36 +0000 2023",
	"lang": "en",
	"quoteId": "1728107610631729415",
	"bookmarkCount": 702,
	"isReply": false,
	"card": {},
	"place": {},
	"source:": "Twitter for Android",
	"author": {
		"type": "user",
		"userName": "elonmusk",
		"url": "https://x.com/elonmusk",
		"twitterUrl": "https://twitter.com/elonmusk",
		"id": "44196397",
		"name": "Elon Musk",
		"isVerified": true,
		"isBlueVerified": true,
		"verifiedType": "business",
		"profilePicture": "https://pbs.twimg.com/profile_images/1683325380441128960/yRsRRjGO_normal.jpg",
		"followers": 172669889,
		"following": 538
	},
	"isRetweet": false,
	"isQuote": true,
	"article": {
      "id": "2023439310499033089",
      "title": "Human 3.0 – A Map To Reach The Top 1%",
      "previewText": "As corny as this may sound, I've always wanted to become an absolute unit of an individual.\nNot just having a nice and muscular body, but to be fully developed in every domain of life.\nI wanted to",
      "coverImage": "https://pbs.twimg.com/media/HBUzlGwbcAUboWU.jpg",
      "firstPublishedAt": "2026-02-17T15:19:19.000Z",
      "modifiedAt": "2026-02-17T15:19:19.000Z",
      "contentState": {
        "blocks": [
          {
            "text": "As corny as this may sound, I've always wanted to become an absolute unit of an individual.",
            "type": "unstyled"
          },
          {
            "text": "Not just having a nice and muscular body, but to be fully developed in every domain of life.",
            "type": "unstyled"
          },
          {
            "text": "I wanted to become multidimensionally jacked. I wanted to max out all of my stats. I didn't want to be an NPC. I wanted to be a level 100 player. All areas of the map unlocked. Maxed out physicality, intellect, and professions. Bank overflowing with gold. I wanted to do it all. Mind, body, spirit, relationships, money.",
            "type": "unstyled"
          },
          {
            "text": "This desire has drastically influenced my life.",
            "type": "unstyled"
          },
          {
            "text": "As a teenager, I became obsessed with fitness. Then, I wanted to absorb as much knowledge as possible. Then I wanted to be free, so I failed at various business models until I finally made one work. I've had various spiritual and philosophical stints that I believe have helped me see “superficial pursuits” like money and fitness in a completely different light than the average person.",
            "type": "unstyled"
          }
        ],
        "media": [
          "https://pbs.twimg.com/media/HBS03csaQfAAS2XG.jpg",
          "https://pbs.twimg.com/media/HBS0p4jaAsAAlVJq.jpg",
          "https://pbs.twimg.com/media/HBS0hdea8aAA3BNH.jpg",
          "https://pbs.twimg.com/media/HBS0t9sbacAUW8wX.jpg",
          "https://pbs.twimg.com/media/HBS0x6abacAUYi4G.jpg"
        ]
      }
    }
}
```

### 🍚 Input Parameters

| Field | Type | Description | Default value
| ----- | ---- | ----------- | -------------|
startUrls | array | Twitter (X) URLs. Paste the URLs and get the results immediately. Tweet, Profile, Search or List URLs are supported. | `[]` |
searchTerms | array | Search terms you want to search from Twitter (X). You can refer to [this](https://github.com/igorbrigadir/twitter-advanced-search) documentation. | `[]` |
twitterHandles | array | Twitter handles that you want to search on Twitter (X) | `[]` |
tweetLanguage | String | Restricts tweets to the given language, given by an ISO 639-1 code. | `null` |
maxItems | number | Maximum number of items that you want to receive as output | `Infinity` |
onlyVerifiedUsers | Boolean | If selected, only returns tweets by users who are verified. | `false` |
onlyTwitterBlue | Boolean | If selected, only returns tweets by users who are Twitter Blue subscribers. | `false` |
onlyImage | Boolean | If selected, only returns tweets that contain images. | `false` |
onlyVideo | Boolean | If selected, only returns tweets that contain videos. | `false` |
onlyQuote | Boolean | If selected, only returns tweets that are quotes. | `false` |
author | String | Returns tweets sent by the given user. It should be a Twitter (X) Handle. | `null` |
inReplyTo | String | Returns tweets that are replies to the given user. It should be a Twitter (X) Handle. | `null` |
mentioning | String | Returns tweets mentioning the given user. It should be a Twitter (X) Handle. | `null` |
geotaggedNear | String |Returns tweets sent near the given location. | `null` |
withinRadius | String | Returns tweets sent within the given radius of the given location. | `null` |
geocode | String | Returns tweets sent by users located within a given radius of the given latitude/longitude. | `null` |
placeObjectId | String | Returns tweets tagged with the given place. | `null` |
minimumRetweets | Number | Returns tweets with at least the given number of retweets. | `null` |
minimumFavorites | Number | Returns tweets with at least the given number of favorites. | `null` |
minimumReplies | Number | Returns tweets with at least the given number of replies. | `null` |
start | String | Returns tweets sent after the given date. Only works with searchTerms — does not apply to startUrls or twitterHandles. If you want to filter by date, the best way is to use Twitter queries. | `null` |
end | String | Returns tweets sent before the given date. Only works with searchTerms — does not apply to startUrls or twitterHandles. If you want to filter by date, the best way is to use Twitter queries. | `null` |
includeSearchTerms | Boolean | If selected, a field will be added to each tweets about the search term that was used to find it. | `false` |
customMapFunction | 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. | `null` |
outputConnector | string | Optional MCP connector to deliver the results to. See the MCP connectors section below. | `null` |
deliverTarget | string | Where the connector writes: a page or database URL or ID (Notion example: `https://www.notion.so/My-Posts-24f8a1b2c3d44e5f8a9b0c1d2e3f4a5b`). Some services need none. | `null` |
deliverMode | string | `perPost` writes one record per item, `summary` one roll-up per run. | `perPost` |
deliverMaxItems | number | Optional cap on how many records `perPost` delivers. Ignored in `summary`. | `null` |

### 🔌 Send Results to Notion, Todoist and More (MCP Connectors)

The Tweet Scraper can deliver its results straight into the tools you already use, through [Apify MCP Connectors](https://apify.com/store/collections/mcp-connectors).

1. Authorize a connector (Notion, Todoist, or any service whose MCP server offers non-destructive write tools) once in [Console → Settings → API & Integrations → MCP connectors](https://console.apify.com/settings/integrations).
2. Pick it in the **Send results to Notion, Todoist, …** field.
3. Fill in where and how to write:
   - **Destination target:** the page or database URL or ID (Notion example: `https://www.notion.so/My-Posts-24f8a1b2c3d44e5f8a9b0c1d2e3f4a5b`). Share it with your connector first through Notion's **••• → Connections** menu. Some services need no target.
   - **Write mode:** `perPost` writes one record per tweet; `summary` writes a single roll-up for the run.
   - **Max records to deliver** (optional): a cap on how many records `perPost` delivers.

**Notion:** point the target at a Notion **page** and the Actor creates a database with one typed column per field (URL, number, date, text). An **existing database** gets its matching columns filled by name. The connector can't add columns to it, so an empty database receives only titles and the rest of each record goes to the row's page body. Nested fields become columns too: an `author` object becomes `author.userName`, `author.name` and so on. Fields without a column go to the row's page body, so nothing is lost.

Your credentials stay with you: the Actor writes only through your own connector and only uses non-destructive write tools, so it can't delete or overwrite anything. Delivery runs after the scrape and is best-effort. If it fails, the run still finishes normally with all results in the dataset, and the run log says what went wrong. If the run is close to its timeout, delivery stops early so the run still succeeds, and the log says how many records were delivered.

### 🔧 Troubleshooting

- **Getting Few Results?** Check "Maximum number of items on output" (`maxItems`) field. Leaving it empty will result in unlimited results.
- **Are Some Outputs Missing?** Ensure that you review all fields, not just the overview. Navigate to the "Storage" tab and select either "Download the results" or "Open in a New Tab."
- **Getting No Results?** Confirm that your parameters are not overly restrictive.
- **Missing Tweets?** Some tweets may be shadow-banned or filtered by Twitter. This is outside our control.
- **Need fewer than 50 tweets?** Use [Twitter Scraper Unlimited](https://apify.com/apidojo/twitter-scraper-lite?fpr=yhdrb) which has no minimum requirements.

### 📞 Contact and Feature Requests

If you need any sort of support, please send an email to <apidojo10@gmail.com>. You name it, we get it.

### 🈴 Other Actors you might want to check

- [Twitter Scraper Unlimited](https://apify.com/apidojo/twitter-scraper-lite?fpr=yhdrb) - Event-based pricing, no restrictions
- [Twitter Profile Scraper](https://apify.com/apidojo/twitter-profile-scraper?fpr=yhdrb)
- [Twitter List Scraper](https://apify.com/apidojo/twitter-list-scraper?fpr=yhdrb)
- [Twitter User Scraper](https://apify.com/apidojo/twitter-user-scraper?fpr=yhdrb)

### Discord Verifications

- Misτer_Cole ττ - 🫡

# Actor input Schema

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

Twitter (X) URLs. Paste the URLs and get the results immediately. Tweet, Profile, Search or List URLs are supported.

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

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

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

Twitter handles that you want to search on Twitter (X)

## `conversationIds` (type: `array`):

Conversation IDs that you want to search on Twitter (X)

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

Maximum number of items that you want as output.

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

Sorts search results. If you are getting low results, try Top instead of Latest. Latest + Top runs both simultaneously to maximize results but may return some duplicate tweets.

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

## `outputConnector` (type: `string`):

Pick an MCP connector you authorized in Console → Settings → API & Integrations → MCP connectors (e.g. Notion, Todoist — any service whose MCP server offers non-destructive write tools works best-effort). The scraped results are written through your own connector — the Actor never sees your third-party credentials. Only non-destructive write tools are used; it can never delete or overwrite your existing data.

## `deliverTarget` (type: `string`):

Where to write into the connector — paste the URL or ID. Notion example: https://www.notion.so/My-Posts-24f8a1b2c3d44e5f8a9b0c1d2e3f4a5b. Leave empty for services that need no target (e.g. Todoist Inbox, Slack). For Notion, share the page or database with your connector first (Notion's ••• → Connections menu), and point at a PAGE for structured columns (the Actor builds the database for you) — an empty database receives only the title (the rest of each record goes to the row's body).

## `deliverMode` (type: `string`):

perPost writes one record per scraped item; summary writes a single roll-up for the run.

## `deliverMaxItems` (type: `integer`):

Cap on how many records perPost mode writes to the connector; ignored in summary mode. Leave empty to deliver everything scraped.

## Actor input object example

```json
{
  "startUrls": [
    "https://twitter.com/apify",
    "https://twitter.com/search?q=apify%20&src=typed_query",
    "https://twitter.com/i/lists/78783491",
    "https://twitter.com/elonmusk/with_replies"
  ],
  "searchTerms": [
    "web scraping",
    "scraping from:apify"
  ],
  "twitterHandles": [
    "elonmusk",
    "taylorswift13"
  ],
  "maxItems": 1000,
  "sort": "Latest",
  "tweetLanguage": "en",
  "customMapFunction": "(object) => { return {...object} }",
  "deliverMode": "perPost"
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        "https://twitter.com/apify",
        "https://twitter.com/search?q=apify%20&src=typed_query",
        "https://twitter.com/i/lists/78783491",
        "https://twitter.com/elonmusk/with_replies"
    ],
    "searchTerms": [
        "web scraping",
        "scraping from:apify"
    ],
    "twitterHandles": [
        "elonmusk",
        "taylorswift13"
    ],
    "maxItems": 1000,
    "sort": "Latest",
    "tweetLanguage": "en",
    "customMapFunction": (object) => { return {...object} }
};

// Run the Actor and wait for it to finish
const run = await client.actor("apidojo/tweet-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://twitter.com/apify",
        "https://twitter.com/search?q=apify%20&src=typed_query",
        "https://twitter.com/i/lists/78783491",
        "https://twitter.com/elonmusk/with_replies",
    ],
    "searchTerms": [
        "web scraping",
        "scraping from:apify",
    ],
    "twitterHandles": [
        "elonmusk",
        "taylorswift13",
    ],
    "maxItems": 1000,
    "sort": "Latest",
    "tweetLanguage": "en",
    "customMapFunction": "(object) => { return {...object} }",
}

# Run the Actor and wait for it to finish
run = client.actor("apidojo/tweet-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "startUrls": [
    "https://twitter.com/apify",
    "https://twitter.com/search?q=apify%20&src=typed_query",
    "https://twitter.com/i/lists/78783491",
    "https://twitter.com/elonmusk/with_replies"
  ],
  "searchTerms": [
    "web scraping",
    "scraping from:apify"
  ],
  "twitterHandles": [
    "elonmusk",
    "taylorswift13"
  ],
  "maxItems": 1000,
  "sort": "Latest",
  "tweetLanguage": "en",
  "customMapFunction": "(object) => { return {...object} }"
}' |
apify call apidojo/tweet-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apidojo/tweet-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/61RPP7dywgiy0JPD0/builds/2EIJz7HdA5shY2tUh/openapi.json
