# X (Twitter) Scraper — Tweets, Profiles & Lists (`arjun_code/x-twitter-scraper`) Actor

Search X (Twitter) Tweets, profiles, and Lists for market research and audience discovery. Export followers, following, replies, retweeters, quotes, List members, and subscribers with available author details, metrics, and media links. Download JSON, CSV, or Excel. No X login or API key required.

- **URL**: https://apify.com/arjun_code/x-twitter-scraper.md
- **Developed by:** [ArjunAI Data](https://apify.com/arjun_code) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.32 / 1,000 tweet search or details

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

### X (Twitter) data for market research and audience discovery

**Search Tweets, discover people and Lists, and export the audiences behind public X conversations.** Use keywords to explore a subject, enter an account to collect its profile or followers, or paste a Tweet link to collect its details, replies, retweeters, or quotes. Choose from **15 collection tasks** in one Actor.

Research competitors, find relevant accounts, review customer conversations, or discover curated Lists and their members. Results include available profiles, engagement counts, media links, and the account or search they came from. **No X login, cookies, X API key, or proxy setup required.** Download JSON, CSV, or Excel, save repeatable Tasks, or connect the data to your workflow.

**Try it first:** the prefilled **AI agents** search saves up to 10 Tweets. At FREE pricing and the default memory, 10 saved search results cost **$0.005 including the start fee**. See [Pricing](#pricing) for the other tasks and subscription discounts.

- **Research a topic.** [Search AI agent Tweets with author profiles](https://apify.com/arjun_code/x-twitter-scraper/examples/search-ai-agent-tweets-with-author-profiles) to export recent posts and the public accounts that wrote them.
- **Find curated Lists.** [Find AI Twitter Lists and curators](https://apify.com/arjun_code/x-twitter-scraper/examples/find-ai-twitter-lists-and-curators) to compare relevant Lists, their sizes, and their owners.

### 🚀 How to use

1. Choose **What do you want to collect?** One task runs at a time.
2. Fill in the matching keywords, accounts, Tweet links, or List links. Enter multiple items one per line.
3. Set **Results per input**. Start with 10 to review a small sample; the limit applies separately to each input.
4. Click **Start**, then open **Output** and select a view for your data.
5. Export the results. JSON preserves nested author, user, media, and List owner objects.

**One task per run.** For example, choose **Get followers** and enter an account, or choose **Get List members** and enter a List link. You do not need search keywords for an account or link lookup. Leave inputs for other tasks empty.

### Choose what to collect

| Your goal | Choose | Fill in |
| --- | --- | --- |
| Find Tweets about a subject | Search Tweets | Search keywords, Tweets from accounts, and/or Tweets mentioning accounts |
| Get a known Tweet and its author | Get Tweet details | Tweet links or IDs |
| Find people by keyword | Search people | Search keywords |
| Get profiles and account background | Get user profiles | X usernames or profile links and/or X user IDs |
| Export an account's followers | Get followers | Account usernames and/or IDs |
| Export accounts a user follows | Get following | Account usernames and/or IDs |
| Collect a conversation | Get replies | Tweet links or IDs |
| Find users who retweeted | Get retweeters | Tweet links or IDs |
| Collect quotes and their authors | Get quote Tweets | Tweet links or IDs |
| Discover curated Lists | Search Lists | Search keywords |
| Get Lists an account created | Get Lists created by accounts | Account usernames and/or IDs |
| Get Lists an account follows | Get Lists followed by accounts | Account usernames and/or IDs |
| Find Lists containing an account | Get Lists containing accounts | Account usernames and/or IDs |
| Export users included in a List | Get List members | List links or IDs |
| Export users who follow a List | Get List subscribers | List links or IDs |

**Members and subscribers are different:** members are accounts included in a List; subscribers are users who follow it. Quote results contain quote Tweets, so two quotes by one author remain two results. Retweeter results contain user profiles.

### 📊 Inputs and result limits

| Input | Accepted format | Maximum per run |
| --- | --- | --- |
| `searchQueries` | One search per line | 25 unique searches |
| `usernames` + `userIds` | `apify`, `@apify`, a profile URL, or a numeric ID in the ID field | 100 combined identifiers for profiles; 25 for followers/following; 50 for account Lists |
| `tweets` | Tweet URLs or numeric Tweet IDs | 100 unique Tweets for details; 50 for replies, retweeters, or quotes |
| `listIds` | List URLs or numeric List IDs | 50 unique Lists |
| `maxResultsPerInput` | Whole number; default 100 | Applied separately to each search, account, Tweet, or List |

**Two accounts × 100 results can save up to 200 follower profiles.** There is no additional global result limit. Set `maxResultsPerInput` to **0** to continue through results X makes available. **Search people and Search Lists require 1–1,000 results per search**, so they do not accept 0. Profile and Tweet-detail tasks check every input once, regardless of this result setting.

Blank lines and repeated equivalent inputs are ignored. Tweet and List links identifying the same item are collected once. Equivalent username/ID inputs are treated as one source account. The account input limit applies before resolving username/ID pairs, so a pair uses two input slots. In JSON, put IDs in quotes. For an X Article, use the Tweet URL containing it rather than a direct Article link.

#### 🎯 Refine a Tweet search

These options apply to **Search Tweets only** and work together across every search in the run.

| Option | What it does |
| --- | --- |
| `searchMode` | `Latest` for recent results first; `Top` for X relevance ranking |
| `postType` | Any type, exclude retweets, originals only, replies, quotes, or retweets |
| `mediaType` | Any content, images or videos, images, videos, or links |
| `language` | Select a Tweet language; empty means any language |
| `startDate`, `endDate` | Inclusive UTC dates in `YYYY-MM-DD` format; the same date searches one entire day |
| `minLikes`, `minRetweets`, `minReplies` | Minimum engagement counts; 0 means no minimum |
| `excludeWords` | Words or phrases to exclude, one per line |
| `fromUsers` | Tweets from any listed account; accepts usernames, handles, or profile URLs |
| `mentionUsers` | Tweets mentioning any listed account |

Start with keywords or either account-search field. Other options narrow that search. When both account fields are filled in, a Tweet must come from a selected author **and** mention a selected account. An account-only search is one combined search, so its limit applies to all selected accounts together. Engagement minimums select popular Tweets; they do not collect their replies or retweeters.

For exact phrases, hashtags, or more detailed controls, use [X Advanced Search](https://apify.com/arjun_code/x-twitter-advanced-search-scraper).

### Input examples

#### Search Tweets with author details

Copy this input to reproduce the prefilled search. It requests up to **10 Tweets in total for the AI agents search**, with an author profile attached to each result. See the [real Tweet example](#example-tweet-result) below.

```json
{
  "operation": "search_tweets",
  "searchQueries": ["AI agents"],
  "maxResultsPerInput": 10,
  "searchMode": "Latest"
}
```

#### Find popular Tweets from selected accounts

This searches for **original video Tweets from either account with at least 20 likes**. It saves up to 20 matching Tweets across both accounts together. Remove a condition if the search is too narrow.

```json
{
  "operation": "search_tweets",
  "fromUsers": ["OpenAI", "AnthropicAI"],
  "postType": "originals",
  "mediaType": "videos",
  "minLikes": 20,
  "maxResultsPerInput": 20
}
```

#### Look up a user profile

Enter the account you want to check. **No search keywords are needed.**

```json
{
  "operation": "user_profiles",
  "usernames": ["https://x.com/poezhao0605"]
}
```

This returns the account's current profile and available account background in a `user` object. You can use `"userIds": ["1914596734023688194"]` instead of the username, or combine usernames and IDs. See the [complete user profile result](#example-user-profile-result) below.

#### Export followers using a username and a user ID

This collects up to **100 followers of @apify and 100 followers of user ID 44196397**. Each returned `user` is a follower; `source` identifies the account they follow.

```json
{
  "operation": "followers",
  "usernames": ["apify"],
  "userIds": ["44196397"],
  "maxResultsPerInput": 100
}
```

#### Export List members

This collects up to **100 accounts included in the specified List**. To collect the people following the List instead, change `operation` to `list_subscribers`.

```json
{
  "operation": "list_members",
  "listIds": ["https://x.com/i/lists/1455191294725312517"],
  "maxResultsPerInput": 100
}
```

#### Discover Lists by keyword

This finds up to **5 Lists about AI**, returning their descriptions, member/subscriber counts, and owners. See the [real List example](#example-list-result) below. Finding a List does not automatically export its members; copy a returned List link into **Get List members** for that next step.

```json
{
  "operation": "search_lists",
  "searchQueries": ["AI"],
  "maxResultsPerInput": 5
}
```

For Lists belonging to an account, choose `owned_lists` (created by it), `subscribed_lists` (followed by it), or `list_memberships` (containing it), and provide usernames or user IDs.

#### Account profiles and background

**Get user profiles** returns one record per account, combining its current public profile with available account-background information. Use it to compare a profile's self-reported location with X's reported account region, or review the username-change information X provides.

- `user.about_profile.account_based_in`: the country or region X reports for the account.
- `user.about_profile.source`: the app/source channel X reports, such as Web or an App Store region. It does not identify an exact phone model.
- `user.about_profile.username_changes`: X's native change count and latest change timestamp, not a complete list of past usernames.
- `user.username_last_changed_at`: the latest change time converted to ISO 8601 UTC.

The account's self-reported `location` and X's reported account region can differ. Account background is included with **Get user profiles**; it is not included for every user found in a follower, search, or conversation export. Optional fields can be empty when X does not provide them.

### What the results contain

| Result | Available data |
| --- | --- |
| Tweets, details, replies, and quotes | Text, URL, creation date, language, likes, retweets, quotes, replies, views, media links, author profile, and applicable reply or quote relationships |
| Retweets and quotes | Original content in `retweeted_tweet` or `quoted_tweet`, with its own author when X includes it |
| User profiles, followers, following, and retweeters | Account ID, username, name, bio, location, creation date, follower/following counts, verification, avatar, website, and other returned profile fields |
| Lists | Name, description, URL, creation date, visibility, member/subscriber counts, available banner, and owner profile |
| List members and subscribers | User profile, source List, and the relationship to that List |

Each result includes `status`, `record_type`, `operation`, `source`, and `collected_at`. `source` connects a row to its input. An account profile is in `user`; a Tweet author is in `author`; a List owner is in `list.owner`.

For replies, the result identifies the parent Tweet and the account being replied to when available. For retweets and quotes, the original content and its author have their own `retweeted_tweet` or `quoted_tweet` object. This keeps the search result's author and engagement counts separate from those of the original Tweet.

Dates use UTC, such as `2026-10-01T12:00:00Z`. A missing count appears as `null`, which means **not provided**, not zero. Available fields vary by result type and by what X exposes for that account or Tweet.

#### Example Tweet result

One real result from the **AI agents** search shown in the first input example. The excerpt shows the Tweet, its engagement counts, and its author together. Full records contain additional fields; counts and search results change over time.

```json
{
  "status": "success",
  "record_type": "tweet",
  "operation": "search_tweets",
  "source": {
    "requested_input": "AI agents",
    "field": "searchQueries",
    "query": "AI agents"
  },
  "collected_at": "2026-10-30T14:13:13Z",
  "tweet_id": "2116171527750344872",
  "tweet_url": "https://x.com/jeffsutherland/status/2116171527750344872",
  "text": "Before your AI agent gets more access, check the machine it runs on.\nEight steps, with the read-only commands to see where you stand:\nhttps://t.co/ReANmaGlUs\n\nWant an AI agent on your Scrum Team? Join our beta:\n https://t.co/sWYkKaeZyn\n\n#scrum #AIagents #security",
  "created_at": "2026-10-30T14:13:03Z",
  "language": "en",
  "post_type": "original",
  "like_count": 0,
  "retweet_count": 0,
  "quote_count": 0,
  "reply_count": 0,
  "view_count": null,
  "author": {
    "user_id": "14550388",
    "username": "jeffsutherland",
    "name": "Jeff Sutherland",
    "profile_url": "https://x.com/jeffsutherland",
    "description": "Co-Creator of #Scrum and #ScrumatScale and Developer of the #TEHS Scrum Framework for Health and Performance",
    "created_at": "2008-04-26T19:23:56Z",
    "followers_count": 49020,
    "following_count": 1361,
    "verified": false,
    "is_blue_verified": true
  },
  "media": []
}
```

#### Example List result

A real result for the **AI** List search above. The List has **626 members** (accounts included in it) and **7,329 subscribers** (users following it) at collection time. `list.owner` identifies its creator. All List fields are shown below; the owner profile is shortened for readability.

```json
{
  "status": "success",
  "record_type": "list",
  "operation": "search_lists",
  "source": {
    "requested_input": "AI",
    "field": "searchQueries",
    "query": "AI"
  },
  "collected_at": "2026-10-30T11:29:22Z",
  "list": {
    "list_id": "1585430245762441216",
    "url": "https://x.com/i/lists/1585430245762441216",
    "name": "AI High Signal",
    "description": "AI twitter accounts that are high signal",
    "created_at": "2022-10-27T00:36:41Z",
    "visibility": "Public",
    "member_count": 626,
    "subscriber_count": 7329,
    "banner_url": "https://pbs.twimg.com/list_banner_img/1613505644405075970/9VRDCFnW?format=jpg&name=orig",
    "owner": {
      "user_id": "33521530",
      "username": "swyx",
      "name": "swyx",
      "profile_url": "https://x.com/swyx",
      "followers_count": 208831,
      "is_blue_verified": true
    }
  }
}
```

#### Example user profile result

A complete real result for **@poezhao0605** from the combined account-background and profile lookup, matching the username input above. `user` contains the profile and background; `source` identifies the requested account. Counts and profile details can change after collection.

| Inside `user` | What to look for |
| --- | --- |
| `user_id`, `username`, `name`, `profile_url` | Identify the account and open its profile |
| `description`, `location`, `website_url` | Bio, self-reported location, and website |
| `created_at` | Account creation time in UTC; outer `collected_at` is the snapshot time |
| `followers_count`, `following_count`, `tweets_count`, `media_count`, `listed_count` | Audience and activity counts, and Lists containing the account |
| `favourites_count` | Likes given by this account, not likes received |
| `verified`, `is_blue_verified`, `verified_type` | Separate X verification attributes |
| `can_media_tag`, `profile_image_shape`, `subscription_eligible` | Media-tag permissions, avatar shape, and subscription eligibility when returned |
| `description_entities`, `bio_urls`, `bio_mentions`, `bio_hashtags` | Full native profile entity containers and convenient bio-only lists |
| `about_profile` | X-reported account region, app/source channel, and native username-change metadata |
| `username_last_changed_at` | Latest username-change time converted to UTC |

<details>
<summary>View the complete user profile JSON</summary>

```json
{
  "status": "success",
  "record_type": "user",
  "operation": "user_profiles",
  "source": {
    "requested_input": "https://x.com/poezhao0605",
    "field": "usernames",
    "username": "poezhao0605",
    "user_id": "1914596734023688194"
  },
  "collected_at": "2026-10-30T11:15:04Z",
  "user": {
    "user_id": "1914596734023688194",
    "username": "poezhao0605",
    "name": "Poe Zhao",
    "profile_url": "https://x.com/poezhao0605",
    "description": "China tech analyst. I read Chinese-language filings and policy papers on AI, chips, robotics and EVs. Cited by Bloomberg, Reuters, FT and The Economist.",
    "location": "Beijing",
    "created_at": "2025-04-22T08:27:07Z",
    "followers_count": 9751,
    "following_count": 209,
    "tweets_count": 4749,
    "media_count": 1348,
    "favourites_count": 910,
    "listed_count": 246,
    "verified": false,
    "is_blue_verified": true,
    "verified_type": null,
    "protected": false,
    "possibly_sensitive": false,
    "profile_image_url": "https://pbs.twimg.com/profile_images/1994020525732139008/yWxv0hlw_normal.jpg",
    "profile_banner_url": "https://pbs.twimg.com/profile_banners/1914596734023688194/1748240318",
    "website_url": "https://hellochinatech.com/",
    "description_entities": {
      "description": {},
      "url": {
        "urls": [
          {
            "display_url": "hellochinatech.com",
            "expanded_url": "https://hellochinatech.com/",
            "indices": [
              0,
              23
            ],
            "url": "https://t.co/7F6ysMuYgC"
          }
        ]
      }
    },
    "bio_urls": [],
    "bio_mentions": [],
    "bio_hashtags": [],
    "account_label": null,
    "pinned_tweet_ids": [
      "2115733829046423920"
    ],
    "can_media_tag": true,
    "profile_interstitial_type": "",
    "profile_image_shape": "Circle",
    "subscription_eligible": false,
    "creator_subscriptions_count": 0,
    "default_profile_image": false,
    "profile_description_language": null,
    "affiliates_highlighted_label": {},
    "identity_profile_labels_highlighted_label": {},
    "verification_info": {
      "id": "VXNlclZlcmlmaWNhdGlvbkluZm86MTkxNDU5NjczNDAyMzY4ODE5NA==",
      "is_identity_verified": false,
      "reason": {
        "verified_since_msec": "1747619754527"
      }
    },
    "business_account": {},
    "default_profile": true,
    "withheld_scope": "",
    "withheld_description": "",
    "about_profile": {
      "account_based_in": "United States",
      "created_country_accurate": true,
      "learn_more_url": "https://help.twitter.com/managing-your-account/about-twitter-verified-accounts",
      "location_accurate": false,
      "source": "China App Store",
      "username_changes": {
        "count": "2",
        "last_changed_at_msec": "1748240405560"
      }
    },
    "username_last_changed_at": "2025-05-26T06:20:05.560000Z"
  }
}
```

</details>

In this example, `verified` is false while `is_blue_verified` is true; these describe different verification attributes. `location` is the account's own profile text, while `about_profile.account_based_in` is the region reported by X. An app/source such as China App Store is not an exact device model. Missing numeric values remain null.

The same common `user` fields appear in several tasks, with different relationships to the input:

| Task | `source` identifies | `user` contains |
| --- | --- | --- |
| Get user profiles | The requested account | Its detailed profile and available account background |
| Search people | Search keywords | One matching account |
| Get followers | A source account | One account following it |
| Get following | A source account | One account it follows |
| Get retweeters | A source Tweet | One user who retweeted it |
| Get List members / subscribers | A source List | One member or subscriber |

Account background is included only with **Get user profiles**. Other exports include available user information, so optional fields can differ. Tweet authors appear in `author`, and List owners appear in `list.owner`.

#### Choose an Output view

| View | Best for |
| --- | --- |
| Overview | Quickly check saved results, their inputs, and any messages |
| Tweets | Text, author links, posting dates, and engagement counts for Tweets, replies, and quotes |
| User profiles | Avatars, bios, audience counts, profile location, and verification attributes |
| Account background | X-reported region, app/channel, username changes, and the latest change time |
| Lists & owners | List descriptions, member/subscriber counts, and owner links |
| Relationships | See which returned user relates to the source account, Tweet, or List |
| Status & messages | Inspect input and collection outcomes and their explanations |
| All fields | Use Apify's built-in view for complete records, including nested media, Article, author, and owner objects |

Every focused table keeps Status, Input, and Message columns. Dates are labeled UTC, links are clickable, and avatars appear as images. The tables show selected columns; the saved records and full JSON export retain all fields. CSV and Excel are convenient for selected columns; JSON preserves nested objects.

### Empty results and helpful messages

If an input is invalid, unavailable, or has no results, the output explains what happened and which input it concerns. **A valid input returning no data does not fail the run.** In a batch, valid entries continue even if another entry has a problem. A setting that affects the whole run, such as an end date before the start date, must be corrected first.

| Status | Meaning and next step |
| --- | --- |
| `no_results` | No visible results matched. Broaden the search, remove a filter, or try another source. Empty Lists have their own explanations. |
| `invalid_input` | Correct the named field or individual entry and run again. |
| `not_found` | X confirmed that the account or Tweet was not found. Check its username or ID. |
| `suspended` | X explicitly reports that the account is suspended. |
| `unavailable` | X cannot expose the content. A List may be private, deleted, or inaccessible. |
| `request_failed` | X could not complete this input. Other inputs continue; retry the affected input later. |
| `partial` | Some results were saved before this input could not finish. Download the saved rows and review the message. |
| `charge_limit_reached` | Collection stopped at the configured spending limit. |

Apify may ask you to correct an input before starting the run. For API inputs, use the JSON examples above and send account IDs as a list of strings, such as `"userIds": ["3510729917"]`.

X's displayed counts may include private, deleted, filtered, or inaccessible results. **0 means all results X makes available through collection**, not a guarantee that an export equals every displayed counter. Large exports take longer; begin with a small sample for a new source.

### Pricing

**Pay for the task you choose, with platform usage included.** The Actor uses pay-per-event pricing. The seven groups below are alternatives for different tasks; they are not seven charges added to every run. Prices are **USD per 1,000 saved results or completed individual lookups**.

| Task group | FREE | BRONZE | SILVER | GOLD / PLATINUM / DIAMOND |
| --- | ---: | ---: | ---: | ---: |
| User profiles with account background; quote Tweets | $0.60 | $0.54 | $0.48 | $0.42 |
| Tweet search; individual Tweet details | $0.45 | $0.41 | $0.36 | $0.32 |
| Retweeters | $0.45 | $0.36 | $0.28 | $0.25 |
| People search; List search | $0.40 | $0.38 | $0.35 | $0.35 |
| Replies | $0.32 | $0.27 | $0.23 | $0.18 |
| Account Lists; List members and subscribers | $0.20 | $0.19 | $0.18 | $0.18 |
| Followers and following | $0.15 | $0.10 | $0.09 | $0.08 |

Each run has a **$0.0005 start fee** at the default 512 MB memory. Choosing more than 1 GB adds start fees according to Apify's memory rules. For example, a BRONZE run saving 1,000 search Tweets at the default memory costs **$0.4105**: $0.41 for results plus $0.0005 to start.

**What counts as one result?** A search Tweet, reply, quote Tweet, List, or user profile saved for its source. Two quote Tweets by the same author count as two results. A user returned for two different source accounts or Lists can appear once for each source.

**Individual lookups:** Get user profiles and Get Tweet details charge for each completed lookup, including an account or Tweet that X explicitly confirms is missing or suspended. A successful account lookup includes its profile and available account background in **one charge**. Equivalent username and ID inputs do not create a second account lookup charge within the run.

**Included at no extra result charge:** embedded Tweet authors, List owners, media links, and original quoted or retweeted content. Input errors, empty searches, request failures, and unconfirmed unavailability do not add result fees; the start fee still applies if the run starts. Saved results remain chargeable if collection later stops. Status messages have no additional fee, apart from the confirmed unavailable individual lookups described above.

### 🤖 Use this Actor with AI agents via MCP

In your MCP client, add `https://mcp.apify.com/?tools=call-actor` as a remote **Streamable HTTP** server. Sign in with **Apify OAuth**. If your client uses request headers, set `Authorization: Bearer <APIFY_TOKEN>` in its credential settings. [Apify MCP setup](https://docs.apify.com/mcp#connect-and-authorize)

> Run `arjun_code/x-twitter-scraper` to find up to 10 recent English-language X posts about AI agents. Return the post text, link, and author for each result.

Pass these arguments to `call-actor`.

```json
{
  "actor": "arjun_code/x-twitter-scraper",
  "input": {
    "operation": "search_tweets",
    "searchQueries": [
      "AI agents"
    ],
    "searchMode": "Latest",
    "language": "en",
    "maxResultsPerInput": 10
  },
  "waitSecs": 0
}
```

If the run is still active, pass its `runId` to `get-actor-run` until it finishes. Use that run's `storages.datasets.default.id` as `datasetId` in `get-dataset-items`. Use `limit` and `offset` when you need more than one page. [Apify MCP tools](https://docs.apify.com/mcp#available-tools)

This example selects the `search_tweets` operation. For its `success` rows, use `tweet_url`, `text`, and `author`. To see per-query outcomes, call `get-key-value-store-record` with `storages.keyValueStores.default.id` as `keyValueStoreId` and `RUN_SUMMARY` as `recordKey`.

### API, schedules, and integrations

Save a successful input as an **Apify Task** to rerun it or schedule regular collection. Connect through Apify integrations, Make, n8n, or your own application. Apify run webhooks can notify your workflow when collection finishes.

Need to compare changes between runs? Use [Post Performance Monitor](https://apify.com/arjun_code/x-twitter-post-performance-monitor) for Tweet engagement growth or [Profile Change Monitor](https://apify.com/arjun_code/x-twitter-profile-username-history-monitor) for account changes and alerts.

<details>
<summary>API example: start a search and download the results</summary>

Set `APIFY_TOKEN` to your Apify API token, then start the same 10-Tweet search:

```bash
curl -X POST 'https://api.apify.com/v2/actors/arjun_code~x-twitter-scraper/runs' \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"operation":"search_tweets","searchQueries":["AI agents"],"maxResultsPerInput":10}'
```

This starts a run; the first response is run information, not the collected Tweets. Check `/v2/actor-runs/RUN_ID` until the run finishes. From the completed run, copy `defaultDatasetId` and replace `DATASET_ID` below to download the saved results:

```bash
curl 'https://api.apify.com/v2/datasets/DATASET_ID/items?format=json&clean=true' \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

The JSON export preserves the full `author`, `user`, `media`, and `list.owner` objects. An empty API request returns guidance; use the example input explicitly when calling the API.

</details>

### Related X Twitter Actors

**Start here for a broad export; choose a specialized Actor for a focused workflow.** These tools accept the same kinds of X usernames, Tweet links, or List links, making it easy to continue from a result you have already collected.

| Need | Specialized Actor |
| --- | --- |
| Detailed Tweet search conditions | [X Advanced Search](https://apify.com/arjun_code/x-twitter-advanced-search-scraper) |
| Filter user profiles | [People Search](https://apify.com/arjun_code/x-twitter-people-search-scraper) |
| Filter followers and following | [Followers & Following Scraper](https://apify.com/arjun_code/x-twitter-followers-followings-scraper) |
| Store images, video, GIFs, and Article content | [Media Downloader](https://apify.com/arjun_code/x-twitter-media-downloader) |
| Search Lists with List and owner filters | [List Search](https://apify.com/arjun_code/x-twitter-list-search-scraper) |
| Account Lists, members, and subscribers | [Lists Scraper](https://apify.com/arjun_code/x-twitter-lists-scraper) |
| Dedicated replies and thread context | [Replies Scraper](https://apify.com/arjun_code/x-twitter-replies-scraper) |
| Account-origin information | [Account Origin](https://apify.com/arjun_code/x-twitter-account-origin-scraper) |

#### Discover Communities and trends, or monitor changes

| Your next step | Related Actor |
| --- | --- |
| Find Communities by keyword or look up a Community's details | [Community Search & Details](https://apify.com/arjun_code/x-twitter-communities-search) |
| Export available Community members and moderators | [Community Members & Moderators](https://apify.com/arjun_code/x-twitter-community-members) |
| Discover trending topics by country or city | [Trends Scraper](https://apify.com/arjun_code/x-twitter-trends-scraper) |
| Track Tweet engagement growth and receive alerts | [Post Performance Monitor](https://apify.com/arjun_code/x-twitter-post-performance-monitor) |
| Monitor profile and username changes over time | [Profile Change Monitor](https://apify.com/arjun_code/x-twitter-profile-username-history-monitor) |

### FAQ and support

#### Can I collect several types of data in one run?

Choose one task per run. Batch multiple inputs for that task, then use returned IDs or URLs in another task. For example, search Lists first and pass selected IDs to a member export.

#### Does this download media files?

It returns available media metadata and source URLs. Use Media Downloader to store files and choose image or video quality.

#### Do I need an X account or API key?

No X login details are required as input. Calls to the Apify API still require an Apify token and access to the Actor.

#### Why are there fewer results than I requested?

The result count is a maximum. X may expose fewer matches or stop returning additional visible results. Review Status & messages when no data was saved or collection could not finish.

#### Where can I report a problem?

Use the Actor's Issues tab or contact the developer through Apify. Include the run URL, selected task, and an input that reproduces the issue. Keep tokens and credentials out of support messages. Use collected data responsibly and within the permissions and rules applicable to your project. This Actor is independent of X Corp.

# Actor input Schema

## `operation` (type: `string`):

<strong>Start here.</strong> Choose one task per run. You can enter multiple items for that task. A List search returns Lists and their owners; choose Get List members or Get List subscribers to export the people in a known List. Get user profiles includes available account-background information: the region and app/source reported by X, plus username-change counts and the latest change time.

## `searchQueries` (type: `array`):

<strong>Use for Search Tweets, Search people, or Search Lists.</strong> Enter up to 25 unique searches, one per line, such as AI agents or venture capital. Each line is searched separately. Blank lines and repeated identical searches are ignored. For Search Tweets, you can leave this empty when using Tweets from accounts or Tweets mentioning accounts. <a href="https://apify.com/arjun_code/x-twitter-people-search-scraper" target="_blank">People Search</a> offers more profile filters.

## `usernames` (type: `array`):

<strong>Use for user profiles, followers, following, or account Lists.</strong> Enter apify, @apify, or https://x.com/apify, one account per line. You can also use the X user IDs field below. Combined limit across both fields: <strong>100</strong> account inputs for profiles, <strong>25</strong> for followers/following, or <strong>50</strong> for account Lists. Equivalent usernames are processed once; a username and ID resolving to the same account produce one export. For Get user profiles, the Actor combines account-background and detailed profile data; no keyword search is performed.

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

<strong>Optional alternative to usernames for account tasks.</strong> Enter numeric account IDs, one per line, such as 3510729917. In JSON, put each ID in quotes. You can use usernames and IDs together within the combined account limit above. These are account IDs, not Tweet or List IDs. Get user profiles combines the detailed profile with available account-background information for the same account.

## `tweets` (type: `array`):

<strong>Use for Tweet details, replies, retweeters, or quote Tweets.</strong> Enter one Tweet link or ID per line, such as https://x.com/OpenAI/status/2107909792945832070. Up to <strong>100 unique Tweets</strong> for details, or <strong>50</strong> for the other three tasks. Equivalent links and IDs are processed once. For downloadable images and videos, use <a href="https://apify.com/arjun_code/x-twitter-media-downloader" target="_blank">Media Downloader</a>.

## `listIds` (type: `array`):

<strong>Use only for Get List members or Get List subscribers.</strong> Enter up to <strong>50 unique Lists</strong>, one per line, such as https://x.com/i/lists/1455191294725312517 or 1455191294725312517. Members appear in the List; subscribers follow it. To find Lists created by, followed by, or containing an account, use its username or user ID instead. For dedicated List workflows, try <a href="https://apify.com/arjun_code/x-twitter-lists-scraper" target="_blank">Lists Scraper</a>.

## `maxResultsPerInput` (type: `integer`):

<strong>The limit applies separately to every search, account, Tweet, or List.</strong> For example, 2 accounts × 100 can save up to 200 follower profiles. Enter <strong>0 for all results X makes available</strong>. ⚠️ <strong>Search people and Search Lists require 1–1,000</strong>; 0 is not supported for these two tasks. User profiles and Tweet details check every input once, regardless of this setting. Default: 100.

## `searchMode` (type: `string`):

<strong>Search Tweets only.</strong> Latest first finds recent Tweets. Top results uses X relevance ranking. If you want a time period, set the date fields below.

## `postType` (type: `string`):

<strong>Search Tweets only.</strong> All Tweet types includes original Tweets, replies, quotes, and retweets. Exclude retweets keeps the first three. Original Tweets only excludes replies, quotes, and retweets. Choose Replies, Quote Tweets, or Retweets to request just that type.

## `mediaType` (type: `string`):

<strong>Search Tweets only.</strong> Choose images, videos, or links, or keep No requirement to also allow text-only Tweets. This selects matching Tweets and returns available media links. To save media files with quality choices, use <a href="https://apify.com/arjun_code/x-twitter-media-downloader" target="_blank">Media Downloader</a>.

## `language` (type: `string`):

<strong>Search Tweets only.</strong> Choose a language or Any language. This selects Tweets in that language; it does not translate them.

## `startDate` (type: `string`):

<strong>Search Tweets only.</strong> Include this entire date and later dates, using UTC. Select a date or enter YYYY-MM-DD in JSON. Leave empty for no starting date. It must be on or before Posted on or before.

## `endDate` (type: `string`):

<strong>Search Tweets only.</strong> Include Tweets through the end of this entire date, using UTC. Leave empty for no ending date. Use the same date in both fields to search one day.

## `minLikes` (type: `integer`):

<strong>Search Tweets only.</strong> Keep Tweets with at least this many likes. Enter 20 for 20 or more likes, or 0 for no minimum. All selected engagement minimums apply together.

## `minRetweets` (type: `integer`):

<strong>Search Tweets only.</strong> Keep Tweets retweeted at least this many times. Enter 10 for 10 or more retweets, or 0 for no minimum. This checks popularity; it does not select retweet-type Tweets or export retweeter profiles.

## `minReplies` (type: `integer`):

<strong>Search Tweets only.</strong> Keep Tweets with at least this many replies. Enter 5 for 5 or more replies, or 0 for no minimum. This checks popularity; choose Get replies to collect the replies themselves.

## `excludeWords` (type: `array`):

<strong>Search Tweets only.</strong> Enter one word or phrase per line, such as giveaway or free trial. Matching Tweets are excluded; a multi-word entry is treated as a phrase. Avoid excluding the same words you are searching for. Leave empty to exclude nothing.

## `fromUsers` (type: `array`):

<strong>Search Tweets only.</strong> Enter usernames, @handles, or profile links, such as OpenAI or @AnthropicAI. Tweets can come from any listed author. Leave Search keywords empty for one combined account search, or add keywords to narrow each separate search. The result limit applies to the combined account search, not separately to every author. Duplicate accounts are ignored.

## `mentionUsers` (type: `array`):

<strong>Search Tweets only.</strong> Enter usernames, @handles, or profile links, such as @OpenAI. Tweets must mention at least one listed account. Works alone or with keywords. If Tweets from accounts is also filled in, Tweets must come from a selected author <strong>and</strong> mention a selected account. Multiple accounts in either field mean any of those accounts.

## Actor input object example

```json
{
  "operation": "search_tweets",
  "searchQueries": [
    "AI agents"
  ],
  "listIds": [],
  "maxResultsPerInput": 10,
  "searchMode": "Latest",
  "postType": "any",
  "mediaType": "any",
  "language": "",
  "minLikes": 0,
  "minRetweets": 0,
  "minReplies": 0,
  "excludeWords": [],
  "fromUsers": [],
  "mentionUsers": []
}
```

# Actor output Schema

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

Saved records with all nested fields. Output views provide focused tables without deleting source fields.

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

Per-input results, completion reasons, and request statistics. This record is not a customer result row.

# 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 = {
    "searchQueries": [
        "AI agents"
    ],
    "maxResultsPerInput": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("arjun_code/x-twitter-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 = {
    "searchQueries": ["AI agents"],
    "maxResultsPerInput": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("arjun_code/x-twitter-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 '{
  "searchQueries": [
    "AI agents"
  ],
  "maxResultsPerInput": 10
}' |
apify call arjun_code/x-twitter-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,arjun_code/x-twitter-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/I84AbLOL0Ks6JgN2u/builds/jOR8pc4qNF9TLtQez/openapi.json
