# X (Twitter) Scraper: Tweets, Profiles, Search & Trends (`scrapysocial/x-twitter-scraper`) Actor

Scrape X (Twitter) tweets, profiles, followers, replies, quotes, advanced search, trends by country or city, communities, lists and Spaces. Real-time, no login, clean JSON, auto pagination. Pay only for results.

- **URL**: https://apify.com/scrapysocial/x-twitter-scraper.md
- **Developed by:** [Scrapy Social](https://apify.com/scrapysocial) (community)
- **Categories:** Social media, Lead generation, Automation
- **Features:** Limited permissions
- **Stats:** 3 total users, 0 monthly users, 93.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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) Scraper: Tweets, Profiles, Search & Trends

One actor for the whole public side of X: every tweet, profile, search tab, trend list, community and list the website shows, returned as the same clean JSON whatever endpoint you pick.

**43 endpoints** · real-time data · no X (Twitter) account or cookies needed · automatic pagination · batch input · pay only for results ($0.50 / 1,000 results, down to $0.30 on higher Apify plans).

### What can this scraper do?

- **User**: User Account About, User Followers, User Following, User Info, User Photos, User Posts, User Replies, User Reposts, User Tweets And Replies, Verified Followers, User Videos
- **Post**: Comment Replies, Tweet Comments, Tweet Detail, Tweet Quotes, Tweet Retweeters
- **Trending**: Explore Timeline, Trending Posts, Popular Posts, Trending Topics by Country or City
- **Search**: Search Posts, Search Users
- **Community**: Community About, Explore Communities, Community Info, Community Media, Community Members, Community Moderators, Community Post Search, Community Post Search Latest, Search Communities, Community Tweet Search, Community Tweets
- **List**: List Members, List Subscribers, List Tweets
- **Space**: Audio Space Info
- **Utility**: Search Typeahead, Search Languages, Explore Locations, Explore Page, Community Member Search, Trending Locations

### Use cases

- Brand and keyword monitoring with X Advanced Search fields (language, dates, min likes, media, verified only).
- Track what is trending right now in any of 62 countries or 400+ cities, then pull the posts behind each trend.
- Influencer research: profiles, followers, verified followers, following, and every tweet/reply/repost/media post.
- Conversation analysis: tweet detail, threaded comments, comment replies, quotes and retweeters.
- Community and List intelligence: members, moderators, timelines and in-community search.

### Why this scraper

- **Clean, consistent JSON.** The same fields (`id`, `author`, `stats`, `createdAt` …) across endpoints, so you write your parser once.
- **Real-time.** Every run fetches live data; nothing is served from a stale database.
- **No login, no blocking headaches.** Sessions, proxies, signatures and retries are handled for you.
- **Pagination built in.** Set *Max results per query*; the actor follows cursors for you and de-duplicates.
- **Batch mode.** Many usernames / posts / keywords in one run.
- **Fair billing.** Not-found lookups and failed calls are never charged.

### How to use it

1. Pick **What to scrape** (for example *Search Posts*).
2. Fill the fields that endpoint uses (each field lists the endpoints that use it). Leave the others empty.
3. Set **Max results per query**, then click **Start**.
4. Download the results as JSON, CSV, Excel or HTML, or read them through the Apify API.

#### Input examples

**Advanced search: popular English #bitcoin posts with images**

```json
{
  "endpoint": "search-posts",
  "query": "bitcoin",
  "lang": "en",
  "minLikes": 100,
  "media": "images",
  "product": "Top",
  "maxItems": 100
}
```

**What is trending in Indonesia right now**

```json
{
  "endpoint": "trending-topics",
  "country": "ID",
  "maxItems": 50
}
```

**A user's latest tweets**

```json
{
  "endpoint": "user-posts",
  "username": "NASA",
  "maxItems": 200
}
```

**All comments on a tweet**

```json
{
  "endpoint": "tweet-comments",
  "tweetId": "1815616000068583807",
  "maxItems": 300
}
```

**Several profiles in one run (batch)**

```json
{
  "endpoint": "user-info",
  "batch": [
    {
      "username": "nasa"
    },
    {
      "username": "spacex"
    },
    {
      "username": "elonmusk"
    }
  ],
  "maxItems": 50
}
```

### Output

Each result is one dataset row. List endpoints produce one row per item; lookups produce one row. Every row has a `_meta` object (endpoint, query, page, scrapedAt). Trend lists and similar responses also carry the list's own fields under `_context`. Example row from **Search Posts**:

```json
{
  "id": "2120180683486486622",
  "text": "JUST IN: Bitcoin falls under $73,000\n\n$200,000,000 worth of crypto longs liquidated in the past 15 minutes. https://t.co/ZA6NOe0RqQ",
  "createdAt": "Tue Nov 10 15:44:00 +0000 2026",
  "language": "en",
  "possiblySensitive": false,
  "author": {
    "id": "1387497871751196672",
    "username": "WatcherGuru",
    "name": "Watcher.Guru",
    "bio": "Watcher Guru gives you unparalleled, unbiased coverage of all-things crypto & finance in real-time | Posts Are Not Financial Advice | @BTCPrice",
    "avatar": "https://pbs.twimg.com/profile_images/1641221212578754562/DfiC0KW2_normal.png",
    "banner": "https://pbs.twimg.com/profile_banners/1387497871751196672/1672776767",
    "location": "Texas, USA",
    "createdAt": "Wed Apr 28 20:04:12 +0000 2021",
    "verified": false,
    "blueVerified": true,
    "protected": false,
    "stats": {
      "followers": 4917386,
      "following": 3,
      "tweets": 20618,
      "mediaTweets": 5078,
      "likes": 40841
    }
  },
  "stats": {
    "replies": 383,
    "reposts": 406,
    "quotes": 101,
    "likes": 3204,
    "bookmarks": 64,
    "views": "262294"
  },
  "media": [
    {
      "id": "2120180667858436096",
      "type": "photo",
      "url": "https://pbs.twimg.com/media/HWxlFY9aQAAOcTB.jpg",
      "expandedUrl": "https://x.com/WatcherGuru/status/2120180683486486622/photo/1",
      "thumbnail": "https://pbs.twimg.com/media/HWxlFY9aQAAOcTB.jpg",
      "width": 1320,
      "height": 1956
    }
  ],
  "_meta": {
    "endpoint": "search-posts",
    "query": {
      "query": "bitcoin"
    },
    "page": 1,
    "scrapedAt": "2026-11-11T08:00:00.000Z"
  }
}
```

A run summary (results, pages, not found, failed, stop reason) is saved to the key-value store as `OUTPUT`.

### Endpoints

| Group | Endpoint (`endpoint` value) | What you get | Paginated |
|---|---|---|---|
| User | User Account About (`user-about`) | Get account provenance and transparency details. |  |
| User | User Followers (`user-followers`) | List a user’s followers. | yes |
| User | User Following (`user-following`) | List a user’s followed accounts. | yes |
| User | User Info (`user-info`) | Get a public X profile by username. |  |
| User | User Photos (`user-photos`) | List a user’s photo posts with cursor pagination. | yes |
| User | User Posts (`user-posts`) | List a user’s published tweets with cursor pagination. | yes |
| User | User Replies (`user-replies`) | List a user’s replies with cursor pagination. | yes |
| User | User Reposts (`user-reposts`) | List a user’s reposts with cursor pagination. | yes |
| User | User Tweets And Replies (`user-tweets-replies`) | List a user’s tweets and replies with cursor pagination. | yes |
| User | Verified Followers (`user-verified-followers`) | List a user's verified followers. | yes |
| User | User Videos (`user-videos`) | List a user’s video posts with cursor pagination. | yes |
| Post | Comment Replies (`tweet-comment-replies`) | Get a comment, its parent chain and its replies. | yes |
| Post | Tweet Comments (`tweet-comments`) | List top-level comments on a tweet. | yes |
| Post | Tweet Detail (`tweet-detail`) | Get one tweet and the conversation chain above it. |  |
| Post | Tweet Quotes (`tweet-quotes`) | List posts quoting a tweet. | yes |
| Post | Tweet Retweeters (`tweet-retweeters`) | List users who reposted a tweet. | yes |
| Trending | Explore Timeline (`explore-trending`) | Get ranked trends from an Explore tab (Trending or For You). | yes |
| Trending | Trending Posts (`trending-posts`) | Trending posts worldwide or by country, city, category and tag. | yes |
| Trending | Popular Posts (`popular-posts`) | Most popular posts by likes, replies, quotes, bookmarks, shares or video views. | yes |
| Trending | Trending Topics by Country or City (`trending-topics`) | What is trending now: top trend names worldwide, per country or per city. |  |
| Search | Search Posts (`search-posts`) | Search X posts with Advanced Search form fields (words, accounts, dates, engagement, media). | yes |
| Search | Search Users (`search-users`) | Find X accounts by name or handle. |  |
| Community | Community About (`community-about`) | Get community moderators and featured people. |  |
| Community | Explore Communities (`community-explore`) | Explore public community posts. | yes |
| Community | Community Info (`community-info`) | Get one X community by id. |  |
| Community | Community Media (`community-media`) | List community media posts. | yes |
| Community | Community Members (`community-members`) | List a community's members. | yes |
| Community | Community Moderators (`community-moderators`) | List a community's moderators. | yes |
| Community | Community Post Search (`community-post-search`) | Search community posts by relevance. | yes |
| Community | Community Post Search Latest (`community-post-search-latest`) | Search community posts by newest first. | yes |
| Community | Search Communities (`community-search`) | Find X communities by keyword. | yes |
| Community | Community Tweet Search (`community-tweet-search`) | Search tweets inside one community. | yes |
| Community | Community Tweets (`community-tweets`) | List community tweets. | yes |
| List | List Members (`list-members`) | List X list members. | yes |
| List | List Subscribers (`list-subscribers`) | List X list subscribers. | yes |
| List | List Tweets (`list-tweets`) | List the latest tweets from an X List. | yes |
| Space | Audio Space Info (`space-info`) | Get an X Space by id. |  |
| Utility | Search Typeahead (`search-typeahead`) | Get mixed users, topics, lists and symbols. |  |
| Utility | Search Languages (`search-languages`) | List language codes supported by advanced search. |  |
| Utility | Explore Locations (`explore-locations`) | Autocomplete X Explore locations. |  |
| Utility | Explore Page (`explore-page`) | Get Explore tabs, timeline ids and current trends. | yes |
| Utility | Community Member Search (`community-member-search`) | Search members inside a community. |  |
| Utility | Trending Locations (`trending-locations`) | List every country and city X publishes trends for, with its WOEID. |  |

#### Endpoint reference

##### User

###### User Account About · `user-about`

Returns the public About this account fields for a username. Responds 404 when unavailable.

| Field | Required | Description |
|---|---|---|
| `username` | yes | X/Twitter handle without leading @ (letters, numbers, underscore; 1–15 chars). Case-insensitive. Prefer this over userId when you only know the public handle. |

###### User Followers · `user-followers`

Returns public profiles for a user’s followers. Send username or userId; omit cursor for page one.

| Field | Required | Description |
|---|---|---|
| `username` |  | X handle without @. Send this or userId; usernames are case-insensitive. |
| `userId` |  | Numeric X user rest id. Optional when username is sent — the runtime resolves it from User Info. Pattern: digits only. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Pagination cursor from the previous response; omit for page one. |

###### User Following · `user-following`

Returns public profiles for a user’s followed accounts. Send username or userId; omit cursor for page one.

| Field | Required | Description |
|---|---|---|
| `username` |  | X handle without @. Send this or userId; usernames are case-insensitive. |
| `userId` |  | Numeric X user rest id. Optional when username is sent — the runtime resolves it from User Info. Pattern: digits only. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Pagination cursor from the previous response; omit for page one. |

###### User Info · `user-info`

Returns profile identity, biography, verification and account counters. Responds 404 when the handle is unavailable.

| Field | Required | Description |
|---|---|---|
| `username` | yes | X/Twitter handle without leading @ (letters, numbers, underscore; 1–15 chars). Case-insensitive. Prefer this over userId when you only know the public handle. |

###### User Photos · `user-photos`

Returns clean tweet objects for a user’s photo posts. Send username or userId. Pass cursor from the response for the next page; omit it for page one.

| Field | Required | Description |
|---|---|---|
| `username` |  | X handle without @. Send this or userId; usernames are case-insensitive. |
| `userId` |  | Numeric X user rest id. Optional when username is sent — the runtime resolves it from User Info. Pattern: digits only. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Pagination cursor from the previous response; omit for page one. |

###### User Posts · `user-posts`

Returns clean tweet objects for a user’s published tweets. Send username or userId. Pass cursor from the response for the next page; omit it for page one.

| Field | Required | Description |
|---|---|---|
| `username` |  | X handle without @. Send this or userId; usernames are case-insensitive. |
| `userId` |  | Numeric X user rest id. Optional when username is sent — the runtime resolves it from User Info. Pattern: digits only. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Pagination cursor from the previous response; omit for page one. |

###### User Replies · `user-replies`

Returns clean tweet objects for a user’s replies. Send username or userId. Pass cursor from the response for the next page; omit it for page one.

| Field | Required | Description |
|---|---|---|
| `username` |  | X handle without @. Send this or userId; usernames are case-insensitive. |
| `userId` |  | Numeric X user rest id. Optional when username is sent — the runtime resolves it from User Info. Pattern: digits only. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Pagination cursor from the previous response; omit for page one. |

###### User Reposts · `user-reposts`

Returns a user’s reposts with cursor pagination. Each item is the repost entry (id, createdAt = when it was reposted) and repostOf = the original tweet with its full text, author, stats (incl. views) and media. Send username or userId. Pass cursor from the response for the next page; omit it for page one.

| Field | Required | Description |
|---|---|---|
| `username` |  | X handle without @. Send this or userId; usernames are case-insensitive. |
| `userId` |  | Numeric X user rest id. Optional when username is sent — the runtime resolves it from User Info. Pattern: digits only. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Pagination cursor from the previous response; omit for page one. |

###### User Tweets And Replies · `user-tweets-replies`

Returns clean tweet objects for a user’s tweets and replies. Send username or userId. Pass cursor from the response for the next page; omit it for page one.

| Field | Required | Description |
|---|---|---|
| `username` |  | X handle without @. Send this or userId; usernames are case-insensitive. |
| `userId` |  | Numeric X user rest id. Optional when username is sent — the runtime resolves it from User Info. Pattern: digits only. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Pagination cursor from the previous response; omit for page one. |

###### Verified Followers · `user-verified-followers`

Returns verified followers with cursor pagination. Send username or userId; username resolves through User Info. Empty results are a valid 200 response.

| Field | Required | Description |
|---|---|---|
| `username` |  | X handle without @. Used to resolve userId when userId is omitted. |
| `userId` |  | Numeric X user id. Optional when username is supplied. |
| `count` |  | Page size. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged for the next page. |

###### User Videos · `user-videos`

Returns clean tweet objects for a user’s video posts. Send username or userId. Pass cursor from the response for the next page; omit it for page one.

| Field | Required | Description |
|---|---|---|
| `username` |  | X handle without @. Send this or userId; usernames are case-insensitive. |
| `userId` |  | Numeric X user rest id. Optional when username is sent — the runtime resolves it from User Info. Pattern: digits only. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Pagination cursor from the previous response; omit for page one. |

##### Post

###### Comment Replies · `tweet-comment-replies`

Returns comment (the requested comment), thread (the parent chain from the original tweet down to the comment; last item = comment) and replies (tweets replying to the comment), with cursor, hasMore and hiddenCursor. X often folds replies behind "Show more replies": when replies is empty but hiddenCursor is set, call again with cursor=hiddenCursor (that page has replies only; comment/thread are empty). Use the numeric id from comments\[].id of the matching endpoint Empty replies are a valid 200 response.

| Field | Required | Description |
|---|---|---|
| `commentId` | yes | Numeric comment tweet id. Get it from comments\[].id returned by the matching endpoint |
| `ranking` |  | Reply ranking. Allowed: Relevance = recommended, Recency = newest first, Likes = most liked first. Values are case-sensitive; omit = Relevance. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged for the next page. |

###### Tweet Comments · `tweet-comments`

Returns top-level comments as clean tweets (stats incl. views) plus cursor, hasMore and hiddenCursor. ranking is case-sensitive: Relevance, Recency, or Likes. hiddenCursor is set when X folds low-quality / possibly-spam replies behind "Show more replies" — pass it as cursor to load them. For the replies under one comment call the "Comment Replies" endpoint with comments\[].id. Empty comments are a valid 200 response.

| Field | Required | Description |
|---|---|---|
| `tweetId` | yes | Numeric tweet/status id (snowflake). Get it from Search Posts, a user timeline, or the digits after /status/ in an X URL. |
| `ranking` |  | Reply ranking. Allowed: Relevance = recommended, Recency = newest first, Likes = most liked first. Values are case-sensitive; omit = Relevance. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged for the next page. |

###### Tweet Detail · `tweet-detail`

Returns tweet (the requested tweet as a clean object: text, author, stats incl. views, media) and thread (conversation root down to this tweet; the last item is the tweet itself, a single item for a non-reply). Get tweetId from Search Posts or a user timeline. Responds 404 for removed or private tweets. For replies under it use the matching endpoint

| Field | Required | Description |
|---|---|---|
| `tweetId` | yes | Numeric tweet/status id (snowflake). Get it from Search Posts, a user timeline, or the digits after /status/ in an X URL. |

###### Tweet Quotes · `tweet-quotes`

Returns quote posts with cursor pagination. product is case-sensitive: Top = relevance, Latest = newest first; omit = Top. Empty results are a valid 200 response.

| Field | Required | Description |
|---|---|---|
| `tweetId` | yes | Numeric tweet/status id (snowflake). Get it from Search Posts, a user timeline, or the digits after /status/ in an X URL. |
| `product` |  | Result order. Allowed: Top = relevance; Latest = newest first. Values are case-sensitive; omit = Top. |
| `count` |  | Page size. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged for the next page. |

###### Tweet Retweeters · `tweet-retweeters`

Returns public user profiles with cursor pagination. Omit cursor for page one; an empty list is a valid result.

| Field | Required | Description |
|---|---|---|
| `tweetId` | yes | Numeric tweet/status id (snowflake). From a status URL …/status/<id> or from Search/User timeline items. Digits only. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Opaque pagination cursor from the previous response (cursor field). Omit entirely on page one — do not send an empty string. |

##### Trending

###### Explore Timeline · `explore-trending`

Returns the trend list of an X Explore tab: name, rank, context such as "Politics · Trending", url and related grouped trend names, plus cursor. Trends follow the account’s Explore location; for trends of a specific country use the "Trending Posts" endpoint?country=…. Empty tabs are a valid 200 response. Trends here follow the session account's Explore location; for a specific country or city use the matching endpoint

| Field | Required | Description |
|---|---|---|
| `tab` |  | Explore tab. Allowed (case-sensitive): trending = ranked trend list (30 trends), for_you = Explore home mix (about 12 trends). Omit = trending. X serves its News / Sports / Entertainment tabs empty over this API — use the "Trending Posts" endpoint?category=ne… |
| `count` |  | Posts per page. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged (with the same filters) for the next page. |

###### Trending Posts · `trending-posts`

X Global Trending: posts trending right now (last 24 hours). Omit every filter for worldwide trends. Filter by country (ISO code) (68 supported countries) or any other country via placeId from the "Explore Locations" endpoint, narrow to a category (news, crypto, sports, …) and/or a single trending tag such as a person, team or topic name. Filters combine: e.g. country=US\&category=sports or country=ID\&tag=Prabowo Subianto. Returns clean posts with cursor pagination.

| Field | Required | Description |
|---|---|---|
| `country` |  | Country whose trends to return (ISO 3166-1 alpha-2, case-insensitive). Omit = worldwide. Ignored when placeId is set. Allowed: US = United States, DZ = Algeria, AR = Argentina, AU = Australia, AT = Austria, BD = Bangladesh, BE = Belgium, BR = Brazil, CA = Can… |
| `placeId` |  | X place id of a country, for countries not in the country list — take place_id of a location_type=Country result from the "Explore Locations" endpoint?prefix=… (e.g. 8529328623192576872 = Myanmar). Overrides country. City/region ids return an empty list: X Gl… |
| `category` |  | Trending category. Omit = all categories. Allowed: news = News, crypto = Cryptocurrency, gaming = Gaming, business = Business & Finance, memes = Memes, technology = Technology, relationships = Relationships, movies_tv = Movies & TV, health_fitness = Health &… |
| `tag` |  | One trending tag (person, team, brand, topic name as shown by X, e.g. "Donald Trump", "Minnesota Vikings"). Omit = all tags. Case and spacing should match X’s tag. |
| `count` |  | Posts per page. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged (with the same filters) for the next page. |

###### Popular Posts · `popular-posts`

X Creator Inspiration “top posts”: the most engaging posts for a period, ranked by the chosen engagement type, for one country and/or post language. Returns clean posts (stats incl. views) with cursor pagination. Note: omitting country returns the logged-in account’s own country (X offers no worldwide option here); pass country explicitly for predictable results.

| Field | Required | Description |
|---|---|---|
| `engagement` |  | Ranking metric. Allowed (case-sensitive): Likes = most liked, Replies = most replied, Quotes = most quoted, Bookmarks = most bookmarked, Shares = most shared, VideoQualityViews = most-watched videos (quality video views). Omit = Likes. |
| `period` |  | Time window. Allowed (case-sensitive): Daily = last 24 hours, Weekly = last 7 days, Monthly = last 30 days. Omit = Daily. |
| `country` |  | Country of the audience. ISO 3166-1 alpha-2 from this list (case-insensitive): US = United States, DZ = Algeria, AR = Argentina, AU = Australia, AT = Austria, BD = Bangladesh, BE = Belgium, BR = Brazil, CA = Canada, CL = Chile, CO = Colombia, CZ = Czech Repub… |
| `language` |  | Post language, ISO 639-1 lowercase (en, id, ja, es, pt, ar, …; see the "Search Languages" endpoint). Omit = all languages. |
| `count` |  | Posts per page. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged (with the same filters) for the next page. |

###### Trending Topics by Country or City · `trending-topics`

Returns X's current trend list (up to 50, in rank order) for one location, without touching the account's Explore settings. Pick the location with `country` (ISO-2) or `woeid` (any country or city from the "Trending Locations" endpoint); omit both for worldwide. Feed a trend `name` into the "Search Posts" endpoint?query=… or the "Trending Posts" endpoint?tag=… to read the posts behind it. `tweetVolume` is often null because X no longer publishes volumes for most trends.

| Field | Required | Description |
|---|---|---|
| `country` |  | Country whose trends to return (ISO 3166-1 alpha-2, uppercase). Omit (with no woeid) = worldwide. Ignored when woeid is set. Allowed: DZ = Algeria, AR = Argentina, AU = Australia, AT = Austria, BH = Bahrain, BY = Belarus, BE = Belgium, BR = Brazil, CA = Canad… |
| `woeid` |  | Yahoo WOEID of a country or city from the "Trending Locations" endpoint (e.g. 1047378 = Jakarta, 2459115 = New York, 1118370 = Tokyo, 1 = Worldwide). Takes priority over country. Unsupported ids return 404. |

##### Search

###### Search Posts · `search-posts`

Same as X Advanced Search: every field is optional and they are combined with AND, so fill only what you need (at least one). Accounts accept @ or not; word lists accept spaces or commas. Example: query=bitcoin, lang=en, minLikes=100, media=images, since=2026-01-01. Raw X operators can still be typed in `query`. Pick the result tab with `product` (Top, Latest, People, Media, Lists).

| Field | Required | Description |
|---|---|---|
| `query` |  | All of these words — free text, matched anywhere in the post. Raw X operators still work here (e.g. `bitcoin OR btc`, `from:elonmusk`, `filter:safe`). Optional when any other filter below is set; send at least one search field. |
| `exactPhrase` |  | This exact phrase — sent as "…" (e.g. `happy hour`). |
| `anyWords` |  | Any of these words — space/comma separated, combined with OR (e.g. `cats dogs` → (cats OR dogs)). |
| `excludeWords` |  | None of these words — space/comma separated, each excluded with - (e.g. `giveaway promo` → -giveaway -promo). |
| `hashtags` |  | These hashtags — space/comma separated, with or without # , combined with OR (e.g. `ThrowbackThursday crypto`). |
| `from` |  | From these accounts — Username(s) without or with @, separated by spaces or commas; combined with OR (e.g. `elonmusk, x`). |
| `to` |  | Replying to these accounts — Username(s) without or with @, separated by spaces or commas; combined with OR. |
| `mentions` |  | Mentioning these accounts — Username(s) without or with @, separated by spaces or commas; combined with OR. |
| `lang` |  | Post language, ISO 639-1 code (e.g. en, id, ja, es). Full list: the matching endpoint Omit = any language. |
| `since` |  | Posted on or after this date, YYYY-MM-DD (UTC). |
| `until` |  | Posted before this date, YYYY-MM-DD (UTC, exclusive). |
| `minLikes` |  | Minimum likes (min_faves). Integer ≥ 0. |
| `minReplies` |  | Minimum replies (min_replies). Integer ≥ 0. |
| `minReposts` |  | Minimum reposts (min_retweets). Integer ≥ 0. |
| `replies` |  | Replies. Allowed: include = posts and replies (default), exclude = original posts only, only = replies only. |
| `links` |  | Links. Allowed: include = any (default), exclude = posts without links, only = posts with links. |
| `media` |  | Media. Allowed: any (default), media = with any photo/video, images = with photos, videos = with videos, none = text-only posts. |
| `verifiedOnly` |  | true = only posts from verified (X Premium / blue check) accounts. Omit or false = everyone. |
| `product` |  | Result tab. Allowed: Top = relevance, Latest = newest, People = accounts, Media = media posts, Lists = lists. Case-sensitive; omit = Top. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Opaque pagination cursor from the previous response (cursor field). Omit entirely on page one — do not send an empty string. |

###### Search Users · `search-users`

Returns account suggestions from X typeahead. Use username from a result with User Info and all user timelines.

| Field | Required | Description |
|---|---|---|
| `query` | yes | Name or @handle prefix for people search (typeahead users). Short prefixes return ranked account suggestions. |

##### Community

###### Community About · `community-about`

Returns public profiles shown by the community About timeline. An empty people list remains a successful response.

| Field | Required | Description |
|---|---|---|
| `communityId` | yes | Numeric X Communities id from /i/communities/<id> or Community Search results. |

###### Explore Communities · `community-explore`

Returns public community tweets from X's community Explore timeline with cursor pagination. Empty results are a valid 200 response.

| Field | Required | Description |
|---|---|---|
| `count` |  | Page size. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged for the next page. |

###### Community Info · `community-info`

Returns community metadata, rules and member counts. Responds 404 when the community is unavailable.

| Field | Required | Description |
|---|---|---|
| `communityId` | yes | Numeric X Communities id from /i/communities/<id> or Community Search results. |

###### Community Media · `community-media`

Returns clean media posts with cursor pagination. Omit cursor for page one.

| Field | Required | Description |
|---|---|---|
| `communityId` | yes | Numeric X Communities id from /i/communities/<id> or Community Search results. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Opaque pagination cursor from the previous response (cursor field). Omit entirely on page one — do not send an empty string. |

###### Community Members · `community-members`

Returns community members (id, username, name, avatar, verification, protected, role = Admin / Moderator / Member) with cursor pagination. X’s member slice is slim — call the "User Info" endpoint with the username for bio, counts and banner. Get communityId from the matching endpoint Empty results are a valid 200 response.

| Field | Required | Description |
|---|---|---|
| `communityId` | yes | Numeric community id from the "Search Communities" endpoint or /x/community/info. |
| `count` |  | Page size. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged for the next page. |

###### Community Moderators · `community-moderators`

Returns community admins and moderators (id, username, name, avatar, verification, protected, role) with cursor pagination. Call the "User Info" endpoint with the username for the full profile. Get communityId from the matching endpoint

| Field | Required | Description |
|---|---|---|
| `communityId` | yes | Numeric community id from the "Search Communities" endpoint or /x/community/info. |
| `count` |  | Page size. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged for the next page. |

###### Community Post Search · `community-post-search`

Returns relevant community posts with cursor pagination. Empty results are a valid 200 response.

| Field | Required | Description |
|---|---|---|
| `query` | yes | Search text sent to X community post search. |
| `count` |  | Page size. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged for the next page. |

###### Community Post Search Latest · `community-post-search-latest`

Returns newest community posts with cursor pagination. Empty results are a valid 200 response.

| Field | Required | Description |
|---|---|---|
| `query` | yes | Search text sent to X community post search. |
| `count` |  | Page size. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged for the next page. |

###### Search Communities · `community-search`

Returns community ids, names, topics and member counts. Pass cursor for the next page; omit for page one.

| Field | Required | Description |
|---|---|---|
| `query` | yes | Keyword to find public Communities by name/topic. |
| `cursor` |  | Opaque pagination cursor from the previous response (cursor field). Omit entirely on page one — do not send an empty string. |

###### Community Tweet Search · `community-tweet-search`

Searches one community and returns clean tweets with cursor pagination. ranking is case-sensitive: Likes = most liked, Recency = newest; these are the only values captured in the HAR. Empty results are a valid 200 response.

| Field | Required | Description |
|---|---|---|
| `communityId` | yes | Numeric community id from the "Search Communities" endpoint or /x/community/info. |
| `query` | yes | Search text within the selected community. |
| `ranking` |  | Timeline order. Allowed captured values: Likes = most liked; Recency = newest. Values are case-sensitive; omit = Likes. |
| `count` |  | Page size. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged for the next page. |

###### Community Tweets · `community-tweets`

Returns clean tweets with cursor pagination. Omit cursor for page one.

| Field | Required | Description |
|---|---|---|
| `communityId` | yes | Numeric X Communities id from /i/communities/<id> or Community Search results. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Opaque pagination cursor from the previous response (cursor field). Omit entirely on page one — do not send an empty string. |

##### List

###### List Members · `list-members`

Returns public profiles of list members. Omit cursor for page one.

| Field | Required | Description |
|---|---|---|
| `listId` | yes | Numeric X List id from /i/lists/<id> or list URLs. Digits only. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Opaque pagination cursor from the previous response (cursor field). Omit entirely on page one — do not send an empty string. |

###### List Subscribers · `list-subscribers`

Returns public profiles of list subscribers. Omit cursor for page one.

| Field | Required | Description |
|---|---|---|
| `listId` | yes | Numeric X List id from /i/lists/<id> or list URLs. Digits only. |
| `count` |  | Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form. |
| `cursor` |  | Opaque pagination cursor from the previous response (cursor field). Omit entirely on page one — do not send an empty string. |

###### List Tweets · `list-tweets`

Returns tweets from a numeric X List id with cursor pagination. Empty lists are a valid 200 response.

| Field | Required | Description |
|---|---|---|
| `listId` | yes | Numeric X List id from a list URL or the matching endpoint |
| `count` |  | Page size. Allowed integer range: 1–40; omit = 20. |
| `cursor` |  | Opaque cursor returned by this endpoint. Omit on page one; pass it unchanged for the next page. |

##### Space

###### Audio Space Info · `space-info`

Returns metadata, creator and participants for a live, ended or replayable Space. Responds 404 when unavailable.

| Field | Required | Description |
|---|---|---|
| `spaceId` | yes | X Spaces id from /i/spaces/<id> (not the numeric tweet id). Copy the path segment after /spaces/. |

##### Utility

###### Search Typeahead · `search-typeahead`

Returns X search-box suggestions. `resultTypes` is the exact, case-sensitive platform bundle documented below.

| Field | Required | Description |
|---|---|---|
| `query` | yes | Live search-box prefix (as typed). Returns mixed suggestions controlled by resultTypes. |
| `resultTypes` |  | Suggestion bundle. Allowed: `cashtags,events,users,topics,lists` = all captured suggestion categories; `users` = accounts only. Values are case-sensitive. Omit = the full bundle. |

###### Search Languages · `search-languages`

Returns dynamic language codes and labels for X advanced-search lang: filters.

*No parameters.*

###### Explore Locations · `explore-locations`

Returns dynamic place ids and labels used by Explore settings. Use placeId from this utility wherever an Explore location id is needed. place_id values feed the "Trending Posts" endpoint?placeId=… (countries and cities).

| Field | Required | Description |
|---|---|---|
| `prefix` | yes | Location name prefix for Explore trend geography. Returns place_id + name — pass place_id into Explore settings/page flows. Empty string is rejected; send at least one character when filtering. |

###### Explore Page · `explore-page`

Returns the X Explore tab labels with opaque timeline ids (pass tabs\[].timelineId to the "Explore Timeline" endpoint) and the trends shown on the first tab (rank is empty on the For You tab). X normally returns everything on the first load; cursor is kept for parity but the next page is usually empty.

| Field | Required | Description |
|---|---|---|
| `cursor` |  | Explore timeline cursor from the previous Explore Page response. Omit on first load. |

###### Community Member Search · `community-member-search`

Typeahead utility for community member selectors. prefix accepts a name or @handle prefix.

| Field | Required | Description |
|---|---|---|
| `communityId` | yes | Numeric X Communities id from /i/communities/<id> or Community Search results. |
| `prefix` | yes | Member name or @handle prefix inside the community. Used to resolve members for moderation/search UIs. |

###### Trending Locations · `trending-locations`

Returns the ~470 locations (Worldwide, countries, cities) that have trend lists. Use `woeid` in the "Trending Topics by Country or City" endpoint?woeid=… Filter client-side by `countryCode` or `type` (Supername = worldwide, Country, Town).

*No parameters.*

### Pagination, limits and batch

- **Max results per query** (`maxItems`) and **Max pages per query** (`maxPages`) bound each query; the actor stops at whichever comes first or when the source has no more pages.
- **Batch** (`batch`) runs the selected endpoint once per object, e.g. `[{"username":"a"},{"username":"b"}]`. Form fields act as defaults for every batch entry.
- **Parallel queries** (`concurrency`) controls how many batch entries run at once.
- To continue a previous run manually, pass the last `cursor` from the response (with *One row per result* off) as the `cursor` field.

### Pricing

This actor uses **pay per event** pricing: you pay for the results you get, not for compute time.

Higher Apify plans get an automatic Store discount:

| Apify plan | Per 1,000 results | Actor start |
|---|---|---|
| Free | $0.50 | $0.005 |
| Bronze | $0.40 | $0.004 |
| Silver | $0.35 | $0.003 |
| Gold | $0.30 | $0.0025 |
| Platinum | $0.30 | $0.0025 |
| Diamond | $0.30 | $0.0025 |

Example on the Free plan: 1,000 results in one run cost $0.505. Platform usage (compute, proxy, storage) is included; you pay only the events above. The start event is charged once per run at the default 512 MB memory.

Not-found lookups and failed calls are free. With *One row per result* off, a row holding a page of N items counts as N results.

Set **Maximum cost per run** in the run options to cap spending; the actor stops cleanly at that limit and keeps everything it already saved.

### Integrations and API

Run it from code with the Apify API or clients and get results as JSON:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('<username>/x-twitter-scraper').call({"endpoint":"search-posts","query":"bitcoin","lang":"en","minLikes":100,"media":"images","product":"Top","maxItems":100});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

It also works with schedules, webhooks, Make, Zapier, n8n, Google Sheets and every other Apify integration.

### FAQ

**Do I need a X (Twitter) account, cookies or an API key?** No. Just pick an endpoint and run.

**Is scraping X (Twitter) legal?** This actor only returns publicly available data. You are responsible for how you use it: respect privacy laws (GDPR, CCPA), the platform's terms, and do not collect personal data without a legitimate reason.

**Why did a query return nothing?** The account, post or keyword may not exist, may be private, or may have no public results. Those queries are reported in the `OUTPUT` summary as *not found* and are not charged.

**Can I get more than the maximum?** Raise *Max results per query* and *Max pages per query*. Very large pulls are best split with *Batch*.

**How fresh is the data?** Real time: each run reads the platform at that moment.

### Changelog and support

See the **Changelog** tab. Found a bug or need a field or endpoint? Open an issue in the **Issues** tab; we usually reply within a day.

# Changelog

This Actor's version history is a separate document: https://apify.com/scrapysocial/x-twitter-scraper/changelog.md

# Actor input Schema

## `endpoint` (type: `string`):

Pick the X (Twitter) data you want. Then fill only the fields that endpoint uses (each field says which endpoints use it). Full list with descriptions: see the README tab.

## `username` (type: `string`):

X/Twitter handle without leading @ (letters, numbers, underscore; 1–15 chars). Case-insensitive. Prefer this over userId when you only know the public handle.<br><br><b>Used by:</b> User Account About, User Followers, User Following, User Info, User Photos, User Posts +5 more. <b>Required by:</b> User Account About, User Info. <b>Example:</b> <code>howellc4</code>

## `userId` (type: `string`):

Numeric X user rest id. Optional when username is sent — the runtime resolves it from User Info. Pattern: digits only.<br><br><b>Used by:</b> User Followers, User Following, User Photos, User Posts, User Replies, User Reposts +3 more.

## `count` (type: `integer`):

Page size for this list. Integer. Use the endpoint minimum/maximum; omit to use the default shown in the form.<br><br><b>Used by:</b> User Followers, User Following, User Photos, User Posts, User Replies, User Reposts +20 more. <b>Example:</b> <code>20</code>

## `cursor` (type: `string`):

Opaque pagination cursor from the previous response (cursor field). Omit entirely on page one — do not send an empty string.<br><br><b>Used by:</b> User Followers, User Following, User Photos, User Posts, User Replies, User Reposts +24 more.

## `commentId` (type: `string`):

Numeric comment tweet id. Get it from comments\[].id returned by the matching endpoint<br><br><b>Used by:</b> Comment Replies. <b>Required by:</b> Comment Replies. <b>Example:</b> <code>1826148320252735806</code>

## `ranking` (type: `string`):

Reply ranking. Allowed: Relevance = recommended, Recency = newest first, Likes = most liked first. Values are case-sensitive; omit = Relevance.<br><br><b>Used by:</b> Comment Replies, Tweet Comments, Community Tweet Search.

## `tweetId` (type: `string`):

Numeric tweet/status id (snowflake). Get it from Search Posts, a user timeline, or the digits after /status/ in an X URL.<br><br><b>Used by:</b> Tweet Comments, Tweet Detail, Tweet Quotes, Tweet Retweeters. <b>Required by:</b> Tweet Comments, Tweet Detail, Tweet Quotes, Tweet Retweeters. <b>Example:</b> <code>1815616000068583807</code>

## `product` (type: `string`):

Result tab. Allowed: Top = relevance, Latest = newest, People = accounts, Media = media posts, Lists = lists. Case-sensitive; omit = Top.<br><br><b>Used by:</b> Tweet Quotes, Search Posts.

## `tab` (type: `string`):

Explore tab. Allowed (case-sensitive): trending = ranked trend list (30 trends), for_you = Explore home mix (about 12 trends). Omit = trending. X serves its News / Sports / Entertainment tabs empty over this API — use the "Trending Posts" endpoint?category=news, sports or movies_tv instead.<br><br><b>Used by:</b> Explore Timeline.

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

Country of the audience. ISO 3166-1 alpha-2 from this list (case-insensitive): US = United States, DZ = Algeria, AR = Argentina, AU = Australia, AT = Austria, BD = Bangladesh, BE = Belgium, BR = Brazil, CA = Canada, CL = Chile, CO = Colombia, CZ = Czech Republic, DK = Denmark, EC = Ecuador, EG = Egypt, ET = Ethiopia, FI = Finland, FR = France, DE = Germany, GH = Ghana, GR = Greece, HU = Hungary, IN = India, ID = Indonesia, IR = Iran, IQ = Iraq, IE = Ireland, IL = Israel, IT = Italy, JM = Jamaica, JP = Japan, JO = Jordan, KE = Kenya, KW = Kuwait, LB = Lebanon, MY = Malaysia, MX = Mexico, MA = Morocco, NL = Netherlands, NZ = New Zealand, NG = Nigeria, NO = Norway, OM = Oman, PK = Pakistan, PE…<br><br><b>Used by:</b> Trending Posts, Popular Posts, Trending Topics by Country or City.

## `placeId` (type: `string`):

X place id of a country, for countries not in the country list — take place_id of a location_type=Country result from the "Explore Locations" endpoint?prefix=… (e.g. 8529328623192576872 = Myanmar). Overrides country. City/region ids return an empty list: X Global Trending is country-level only.<br><br><b>Used by:</b> Trending Posts.

## `category` (type: `string`):

Trending category. Omit = all categories. Allowed: news = News, crypto = Cryptocurrency, gaming = Gaming, business = Business & Finance, memes = Memes, technology = Technology, relationships = Relationships, movies_tv = Movies & TV, health_fitness = Health & Fitness, food = Food, fashion = Fashion, science = Science, celebrity = Celebrity, sports = Sports, music = Music, dance = Dance, cars = Cars, nature_outdoors = Nature & Outdoors, home_garden = Home & Garden, travel = Travel, pets = Pets, beauty = Beauty, anime = Anime, religion = Religion.<br><br><b>Used by:</b> Trending Posts.

## `tag` (type: `string`):

One trending tag (person, team, brand, topic name as shown by X, e.g. "Donald Trump", "Minnesota Vikings"). Omit = all tags. Case and spacing should match X’s tag.<br><br><b>Used by:</b> Trending Posts.

## `engagement` (type: `string`):

Ranking metric. Allowed (case-sensitive): Likes = most liked, Replies = most replied, Quotes = most quoted, Bookmarks = most bookmarked, Shares = most shared, VideoQualityViews = most-watched videos (quality video views). Omit = Likes.<br><br><b>Used by:</b> Popular Posts.

## `period` (type: `string`):

Time window. Allowed (case-sensitive): Daily = last 24 hours, Weekly = last 7 days, Monthly = last 30 days. Omit = Daily.<br><br><b>Used by:</b> Popular Posts.

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

Post language, ISO 639-1 lowercase (en, id, ja, es, pt, ar, …; see the "Search Languages" endpoint). Omit = all languages.<br><br><b>Used by:</b> Popular Posts.

## `woeid` (type: `string`):

Yahoo WOEID of a country or city from the "Trending Locations" endpoint (e.g. 1047378 = Jakarta, 2459115 = New York, 1118370 = Tokyo, 1 = Worldwide). Takes priority over country. Unsupported ids return 404.<br><br><b>Used by:</b> Trending Topics by Country or City. <b>Example:</b> <code>1047378</code>

## `query` (type: `string`):

All of these words — free text, matched anywhere in the post. Raw X operators still work here (e.g. `bitcoin OR btc`, `from:elonmusk`, `filter:safe`). Optional when any other filter below is set; send at least one search field.<br><br><b>Used by:</b> Search Posts, Search Users, Community Post Search, Community Post Search Latest, Search Communities, Community Tweet Search +1 more. <b>Required by:</b> Search Users, Community Post Search, Community Post Search Latest, Search Communities, Community Tweet Search, Search Typeahead. <b>Example:</b> <code>bitcoin</code>

## `exactPhrase` (type: `string`):

This exact phrase — sent as "…" (e.g. `happy hour`).<br><br><b>Used by:</b> Search Posts.

## `anyWords` (type: `string`):

Any of these words — space/comma separated, combined with OR (e.g. `cats dogs` → (cats OR dogs)).<br><br><b>Used by:</b> Search Posts.

## `excludeWords` (type: `string`):

None of these words — space/comma separated, each excluded with - (e.g. `giveaway promo` → -giveaway -promo).<br><br><b>Used by:</b> Search Posts.

## `hashtags` (type: `string`):

These hashtags — space/comma separated, with or without # , combined with OR (e.g. `ThrowbackThursday crypto`).<br><br><b>Used by:</b> Search Posts.

## `from` (type: `string`):

From these accounts — Username(s) without or with @, separated by spaces or commas; combined with OR (e.g. `elonmusk, x`).<br><br><b>Used by:</b> Search Posts.

## `to` (type: `string`):

Replying to these accounts — Username(s) without or with @, separated by spaces or commas; combined with OR.<br><br><b>Used by:</b> Search Posts.

## `mentions` (type: `string`):

Mentioning these accounts — Username(s) without or with @, separated by spaces or commas; combined with OR.<br><br><b>Used by:</b> Search Posts.

## `lang` (type: `string`):

Post language, ISO 639-1 code (e.g. en, id, ja, es). Full list: the matching endpoint Omit = any language.<br><br><b>Used by:</b> Search Posts. <b>Example:</b> <code>en</code>

## `since` (type: `string`):

Posted on or after this date, YYYY-MM-DD (UTC).<br><br><b>Used by:</b> Search Posts.

## `until` (type: `string`):

Posted before this date, YYYY-MM-DD (UTC, exclusive).<br><br><b>Used by:</b> Search Posts.

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

Minimum likes (min_faves). Integer ≥ 0.<br><br><b>Used by:</b> Search Posts.

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

Minimum replies (min_replies). Integer ≥ 0.<br><br><b>Used by:</b> Search Posts.

## `minReposts` (type: `integer`):

Minimum reposts (min_retweets). Integer ≥ 0.<br><br><b>Used by:</b> Search Posts.

## `replies` (type: `string`):

Replies. Allowed: include = posts and replies (default), exclude = original posts only, only = replies only.<br><br><b>Used by:</b> Search Posts.

## `links` (type: `string`):

Links. Allowed: include = any (default), exclude = posts without links, only = posts with links.<br><br><b>Used by:</b> Search Posts.

## `media` (type: `string`):

Media. Allowed: any (default), media = with any photo/video, images = with photos, videos = with videos, none = text-only posts.<br><br><b>Used by:</b> Search Posts.

## `verifiedOnly` (type: `boolean`):

true = only posts from verified (X Premium / blue check) accounts. Omit or false = everyone.<br><br><b>Used by:</b> Search Posts.

## `communityId` (type: `string`):

Numeric community id from the "Search Communities" endpoint or /x/community/info.<br><br><b>Used by:</b> Community About, Community Info, Community Media, Community Members, Community Moderators, Community Tweet Search +2 more. <b>Required by:</b> Community About, Community Info, Community Media, Community Members, Community Moderators, Community Tweet Search …. <b>Example:</b> <code>1508567430188126209</code>

## `listId` (type: `string`):

Numeric X List id from /i/lists/<id> or list URLs. Digits only.<br><br><b>Used by:</b> List Members, List Subscribers, List Tweets. <b>Required by:</b> List Members, List Subscribers, List Tweets. <b>Example:</b> <code>131207519</code>

## `spaceId` (type: `string`):

X Spaces id from /i/spaces/<id> (not the numeric tweet id). Copy the path segment after /spaces/.<br><br><b>Used by:</b> Audio Space Info. <b>Required by:</b> Audio Space Info. <b>Example:</b> <code>1mdRdpOmoQvvOr</code>

## `resultTypes` (type: `string`):

Suggestion bundle. Allowed: `cashtags,events,users,topics,lists` = all captured suggestion categories; `users` = accounts only. Values are case-sensitive. Omit = the full bundle.<br><br><b>Used by:</b> Search Typeahead.

## `prefix` (type: `string`):

Location name prefix for Explore trend geography. Returns place_id + name — pass place_id into Explore settings/page flows. Empty string is rejected; send at least one character when filtering.<br><br><b>Used by:</b> Explore Locations, Community Member Search. <b>Required by:</b> Explore Locations, Community Member Search. <b>Example:</b> <code>ame</code>

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

Stop paginating a query after this many results. Each saved result is one billable "result-item" event.

## `maxPages` (type: `integer`):

Upper bound on API pages fetched per query (a page is usually 10–50 results).

## `batch` (type: `array`):

Optional JSON array. Each object is one query for the selected endpoint; its keys override the form fields above. Example: <code>\[{"username":"nasa"},{"username":"spacex"}]</code>

## `splitItems` (type: `boolean`):

On (recommended): every post/user/comment is its own dataset row. Off: one row per API page (the list stays nested). Billing is per result either way.

## `concurrency` (type: `integer`):

How many batch queries run at the same time.

## Actor input object example

```json
{
  "endpoint": "search-posts",
  "username": "howellc4",
  "commentId": "1826148320252735806",
  "tweetId": "1815616000068583807",
  "query": "bitcoin",
  "communityId": "1508567430188126209",
  "listId": "131207519",
  "spaceId": "1mdRdpOmoQvvOr",
  "prefix": "ame",
  "maxItems": 100,
  "maxPages": 10,
  "splitItems": true,
  "concurrency": 3
}
```

# Actor output Schema

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

Scraped X (Twitter) items. One dataset row per result (post, user, comment, hotel …) with a `_meta` object.

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

Summary of the run: results, pages, not found, failed queries and stop reason.

# 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 = {
    "username": "howellc4",
    "commentId": "1826148320252735806",
    "tweetId": "1815616000068583807",
    "query": "bitcoin",
    "communityId": "1508567430188126209",
    "listId": "131207519",
    "spaceId": "1mdRdpOmoQvvOr",
    "prefix": "ame"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapysocial/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 = {
    "username": "howellc4",
    "commentId": "1826148320252735806",
    "tweetId": "1815616000068583807",
    "query": "bitcoin",
    "communityId": "1508567430188126209",
    "listId": "131207519",
    "spaceId": "1mdRdpOmoQvvOr",
    "prefix": "ame",
}

# Run the Actor and wait for it to finish
run = client.actor("scrapysocial/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 '{
  "username": "howellc4",
  "commentId": "1826148320252735806",
  "tweetId": "1815616000068583807",
  "query": "bitcoin",
  "communityId": "1508567430188126209",
  "listId": "131207519",
  "spaceId": "1mdRdpOmoQvvOr",
  "prefix": "ame"
}' |
apify call scrapysocial/x-twitter-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapysocial/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/4rpaPgchfD90kCsUS/builds/w3NSlCV8l5g1ZkLyy/openapi.json
