# X (Twitter) Scraper: Tweets, Profiles & Data, No API Key (`scrapers_lat/x-twitter-scraper`) Actor

Scrape X (Twitter) tweets, profiles and posts by handle, tweet ID or URL. No API key or login. Get full text, likes, retweets, replies, quotes, bookmarks, views, media, hashtags, mentions and author data. Filter by date, language, media and engagement. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/scrapers_lat/x-twitter-scraper.md
- **Developed by:** [Scrapers Lat](https://apify.com/scrapers_lat) (community)
- **Categories:** Social media, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 10 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $6.15 / 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) Tweets & Profiles Scraper](https://scrapers.lat/banners/x-twitter-scraper.png)](https://console.apify.com/actors/Xlwg1KJBKKWwDOc7l/input)

## X (Twitter) Scraper: Tweets, Profiles & Data, No API Key

Scrape public **X (Twitter)** data without an API key or login. This X scraper (Twitter scraper) pulls **tweets**, **profiles**, and **posts** by handle, tweet ID, or URL, and returns every field X exposes: full text, likes, retweets, replies, quotes, bookmarks, views, media, hashtags, mentions, links, and complete author data. Export to JSON, CSV, or Excel.

Here is one real result, showing every field a tweet record returns:

```json
{
  "id": "2085865635586912359",
  "url": "https://x.com/OpenAI/status/2085865635586912359",
  "text": "https://t.co/zBh8ck0Gbc",
  "author": {
    "id": "4398626122",
    "handle": "OpenAI",
    "name": "OpenAI",
    "verified": true,
    "followers": 5196598,
    "profileImageUrl": "https://pbs.twimg.com/profile_images/1885410181409820672/ztsaR0JW_normal.jpg"
  },
  "createdAt": "Fri Aug 07 23:08:15 +0000 2026",
  "createdAtISO": "2026-08-07T23:08:15.000Z",
  "conversationId": "2085801349866729975",
  "likeCount": 390,
  "retweetCount": 4,
  "replyCount": 39,
  "quoteCount": 5,
  "bookmarkCount": 20,
  "viewCount": 217398,
  "lang": "zxx",
  "source": "Twitter Web App",
  "isReply": true,
  "inReplyToTweetId": "2085801349866729975",
  "inReplyToUserId": "4398626122",
  "inReplyToHandle": "OpenAI",
  "isRetweet": false,
  "isQuote": true,
  "isQuoteStatus": true,
  "quotedTweetId": "2085862292311396515",
  "retweetedTweetId": null,
  "possiblySensitive": false,
  "place": null,
  "noteTweet": null,
  "media": [],
  "entities": {
    "hashtags": [],
    "mentions": [],
    "urls": ["https://x.com/sama/status/2085862292311396515"]
  },
  "quotedTweet": {
    "id": "2085862292311396515",
    "url": "https://x.com/sama/status/2085862292311396515",
    "text": "astra is a powerful model and we are working to make it generally available. ...",
    "createdAtISO": "2026-08-07T22:54:58.000Z",
    "likeCount": 28472,
    "retweetCount": 1250,
    "replyCount": 1802,
    "viewCount": 2990915,
    "author": { "id": "1605", "handle": "sama", "name": "Sam Altman", "verified": true }
  },
  "retweetedTweet": null,
  "observedAt": "2026-09-04T08:27:12.267Z"
}
```

**📥 [Input](https://apify.com/scrapers_lat/x-twitter-scraper/input-schema) · 📤 [Output](https://apify.com/scrapers_lat/x-twitter-scraper/output-schema) · 💰 [Pricing](https://apify.com/scrapers_lat/x-twitter-scraper/pricing) · ▶️ [Examples](https://apify.com/scrapers_lat/x-twitter-scraper/examples)**

![Apify](https://img.shields.io/badge/Platform-Apify-1CE1CE?logo=apify\&logoColor=white)
![Coverage](https://img.shields.io/badge/Coverage-Worldwide-blue)
![Output](https://img.shields.io/badge/Output-JSON%20%7C%20CSV%20%7C%20Excel-orange)
![Billing](https://img.shields.io/badge/Billing-Pay%20per%20result-brightgreen)

### Table of contents

- [What it does](#what-it-does)
- [Use cases](#use-cases)
- [Quickstart](#quickstart)
- [How it compares](#how-it-compares)
- [Input reference](#input-reference)
- [Output reference](#output-reference)
- [Run via API and CLI](#run-via-api-and-cli)
- [Fetch results](#fetch-results)
- [Billing and limits](#billing-and-limits)
- [FAQ and troubleshooting](#faq-and-troubleshooting)

### What it does

This **Twitter data** scraper reads public X (Twitter) content and writes one normalized record per tweet or profile to the run's dataset. No API key, no developer account, and no login are required. Pick a `mode`:

- **`userTweets`** (default): pull a public account's recent posts (a Twitter timeline scraper). One record per tweet.
- **`userProfile`**: pull profile details (bio, followers, following, counts, verification, location, join date). One record per handle.
- **`tweet`**: fetch specific tweets by numeric ID or full status URL.

Handles can be provided as `@name`, `name`, or a profile URL, and `startUrls` accepts profile or status URLs directly. Duplicates are removed. Missing source values are returned as `null`. Longform note-tweets are returned with their full untruncated text. Optional filters (date range, language, media type, verified authors, minimum engagement) narrow the tweets you collect.

Keyword **`search`** is shown in the input but is **not** available for logged-out reads: X requires a logged-in account for keyword search, so that mode returns a clear error instead of fake or empty data. See the [FAQ](#faq-and-troubleshooting).

### Use cases

- **Social media monitoring** and brand tracking: watch what an account posts and how it performs.
- **Competitor and influencer analysis**: pull tweet engagement (likes, retweets, replies, quotes, bookmarks, views) at scale.
- **Lead and audience research**: collect profile bios, follower counts, websites, and locations.
- **Dataset building for AI/ML and sentiment analysis**: export clean tweet text, language, and entities.
- **News and event tracking**: follow official accounts and capture posts with media and links.
- **Archiving**: keep a structured record of an account's posts as JSON, CSV, or Excel.

### Quickstart

Open the actor, paste this into the input, and press Run. It returns up to 10 recent tweets from the given accounts.

```json
{
  "mode": "userTweets",
  "handles": ["nasa", "OpenAI"],
  "tweetsLimit": 10,
  "maxItems": 10
}
```

Switch `mode` to `userProfile` for profile records, or to `tweet` and pass `tweetIds` (IDs or URLs) to fetch specific tweets. Set `includeReplies` to `true` to include the account's replies. Add filters such as `minimumFavorites`, `onlyVideo`, or `start`/`end` to narrow the results.

### How it compares

For the modes X allows without a login (by handle and by tweet ID/URL), this actor returns a **strict superset** of the fields other tweet scrapers return, and accepts the same input names as the popular tools so you can migrate an existing input with minimal changes.

| Capability | This actor | apidojo/tweet-scraper | kaitoeasyapi (cheapest) | Older quacker/microworlds |
|---|---|---|---|---|
| No API key / no login | Yes | Yes | Yes | Yes |
| Tweets by handle (timeline) | Yes | Yes | Yes | Partial |
| Profile details by handle | Yes | Partial | Partial | Partial |
| Tweet by ID / URL | Yes | Yes | Yes | Partial |
| `startUrls` (profile + status) | Yes | Yes | Yes | Partial |
| Filters (date, lang, media, min engagement, verified) | Yes | Yes | Partial | No |
| Full engagement (likes, RT, replies, quotes, bookmarks, views) | Yes | Yes | Partial | Partial |
| Media variants + duration + alt text | Yes | Partial | Partial | No |
| Quoted / retweeted tweet, enriched | Yes | Partial | Partial | No |
| Longform note-tweet full text | Yes | Partial | Partial | No |
| Author object (id, name, verified, followers, avatar) | Yes | Partial | Partial | Partial |
| ISO 8601 timestamps | Yes | No | No | No |
| Keyword search discovery | No (login-gated by X) | Yes | Yes | Varies |
| Pay per result | Yes | Yes | Yes | Varies |

Note on honesty: keyword **search discovery** (finding tweets by query across all of X) requires a logged-in account, which some tools run behind the scenes. This actor is strictly logged-out and HTTP-only, so it does not offer keyword discovery. Everything else here matches or exceeds the alternatives, and the optional filters let you narrow collected tweets by the same criteria (date, language, media, engagement).

### Input reference

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `mode` | enum | no | `userTweets` | `userTweets`, `userProfile`, `tweet`, or `search` (search returns a login-required error). |
| `handles` | string\[] | for user modes | `["nasa","OpenAI"]` | Public X handles. Accepts `@name`, `name`, or a profile URL. |
| `twitterHandles` | string\[] | no | (empty) | Alias of `handles`, merged with it. |
| `startUrls` | string\[] | no | (empty) | Profile or status URLs. In user modes they add the account handle; in `tweet` mode they add the tweet ID. |
| `tweetsLimit` | integer | no | `100` | For `userTweets`: max tweets per handle (paginated). Range 1 to 3200. |
| `includeReplies` | boolean | no | `false` | For `userTweets`: also include the account's replies. |
| `tweetIds` | string\[] | for `tweet` mode | (sample) | Numeric tweet IDs (for example `20`) or full status URLs. |
| `maxItems` / `maxPosts` | integer | no | (unbounded) | Caps the total records across the whole run. |
| `tweetLanguage` | string | no | (any) | Keep only tweets whose language code matches (for example `en`). |
| `onlyVerifiedUsers` | boolean | no | `false` | Keep only tweets by verified authors. |
| `onlyImage` / `onlyVideo` / `onlyQuote` | boolean | no | `false` | Keep only tweets with an image, with video/GIF, or that quote another tweet. |
| `minimumRetweets` / `minimumFavorites` / `minimumReplies` | integer | no | (none) | Keep only tweets above these engagement thresholds. |
| `start` / `end` | string | no | (none) | Keep only tweets in this ISO 8601 date range. |
| `author` | string | no | (none) | Keep only tweets whose author handle matches. |
| `mentioning` | string | no | (none) | Keep only tweets mentioning this handle. |
| `lang` | string | no | `en` | Two-letter UI language hint sent to X for localized fields. |

Filters apply to the tweets collected in `userTweets` and `tweet` modes. Because X login-gates keyword search, filters narrow (not discover) results.

### Output reference

Tweet records (`userTweets` and `tweet` modes). Types: `string`, `number`, `boolean`, `object`, `object[]`, or `null` when the source value is absent.

| Field | Type | Description |
|---|---|---|
| `id` | string | Tweet ID (unique per tweet). |
| `url` | string | Canonical tweet URL on x.com. |
| `text` | string | Tweet text (full untruncated text for longform note-tweets). |
| `author` | object | `id`, `handle`, `name`, `verified`, `followers`, `profileImageUrl`. |
| `createdAt` | string | Tweet creation timestamp as returned by X. |
| `createdAtISO` | string | Same timestamp normalized to ISO 8601. |
| `conversationId` | string | ID of the conversation (thread root). |
| `likeCount` | number | Number of likes. |
| `retweetCount` | number | Number of retweets. |
| `replyCount` | number | Number of replies. |
| `quoteCount` | number | Number of quote tweets. |
| `bookmarkCount` | number | Number of bookmarks, or `null`. |
| `viewCount` | number | Number of views, or `null` when X does not expose it. |
| `lang` | string | Language code X assigned to the tweet. |
| `source` | string | Posting client label, for example `Twitter Web App`. |
| `isReply` | boolean | Whether the tweet is a reply. |
| `inReplyToTweetId` | string | ID of the tweet being replied to, or `null`. |
| `inReplyToUserId` | string | User ID being replied to, or `null`. |
| `inReplyToHandle` | string | Handle being replied to, or `null`. |
| `isRetweet` | boolean | Whether the tweet is a retweet. |
| `isQuote` | boolean | Whether the tweet quotes another tweet. |
| `isQuoteStatus` | boolean | X's own quote-status flag. |
| `quotedTweetId` | string | ID of the quoted tweet, or `null`. |
| `retweetedTweetId` | string | ID of the retweeted tweet, or `null`. |
| `possiblySensitive` | boolean | X sensitivity flag, or `null`. |
| `place` | object | Geotag: `name`, `fullName`, `country`, `countryCode`, `coordinates`; `null` when absent. |
| `noteTweet` | string | Full longform note-tweet text when present, else `null`. |
| `media` | object\[] | Each item: `type`, `url`, `previewUrl`, `videoUrl`, `durationMillis`, `variants[]`, `width`, `height`, `altText`, `expandedUrl`. |
| `entities` | object | Parsed `hashtags`, `mentions`, `urls`; `null` when the tweet has none. |
| `quotedTweet` | object | Quoted tweet with `id`, `url`, `text`, `createdAtISO`, counts, and `author`, or `null`. |
| `retweetedTweet` | object | Retweeted tweet with the same shape, or `null`. |
| `observedAt` | string | ISO 8601 timestamp of when the record was collected. |

In `userProfile` mode each record instead holds profile fields: `handle`, `name`, `bio`, `website`, `followers`, `following`, `tweetsCount`, `mediaCount`, `listedCount`, `verified`, `protected`, `location`, `joinedAt`, `pinnedTweetId`, `avatar`, `banner`, `url`, `id`, `observedAt`. On any failure, a single item with a populated `error` field is written instead (and is not charged).

### Run via API and CLI

Start a run and read the dataset. Replace `<TOKEN>` with your Apify API token.

Run synchronously and get dataset items in one call:

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~x-twitter-scraper/run-sync-get-dataset-items?token=<TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"mode":"userTweets","handles":["nasa"],"tweetsLimit":25}'
```

Start a run asynchronously:

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~x-twitter-scraper/runs?token=<TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"mode":"tweet","startUrls":["https://x.com/BarackObama/status/266031293945503744"]}'
```

Apify CLI:

```bash
apify call scrapers_lat/x-twitter-scraper \
  --input '{"mode":"userProfile","handles":["OpenAI"]}'
```

### Fetch results

Every run writes to a dataset. Fetch items as JSON, CSV, or Excel by changing `format`:

```bash
## JSON
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"

## CSV
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"

## Paginate large datasets
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&offset=1000&limit=1000"
```

`<DATASET_ID>` is returned as `defaultDatasetId` in the run object. `clean=true` drops empty and internal fields.

### Billing and limits

- **Pay per result.** You are charged per tweet or profile record returned (`result` event). See the [pricing tab](https://apify.com/scrapers_lat/x-twitter-scraper/pricing) for the current per-result price.
- **No charge on failure.** Handles or tweets that cannot be read (not found, suspended, protected, rate-limited) are written with a populated `error` field and are not charged.
- **Filtered-out tweets are not charged.** Only records that pass your filters and are delivered are billed.
- **Spend cap respected.** Set `maxTotalChargeUsd` on the run; once reached, the actor stops emitting and charging further billable results.
- **Free Apify plans** are capped at 10 records per run. Upgrade for more.

### FAQ and troubleshooting

**Why can't I search by keyword?**
X disabled logged-out (guest) keyword search, so the `search` mode returns a clear error rather than fake results. Use `userTweets` to pull a specific account's posts, then narrow with the filter inputs (date, language, media, engagement). This actor is HTTP-only and never uses a logged-in account.

**How many tweets can I get per account?**
Up to `tweetsLimit` (max 3200), paginated through the account timeline. `maxItems` / `maxPosts` caps the whole run across all handles.

**Can I filter by date, language, or engagement?**
Yes. Use `start`/`end` (ISO dates), `tweetLanguage`, `minimumRetweets`, `minimumFavorites`, `minimumReplies`, `onlyImage`, `onlyVideo`, `onlyQuote`, and `onlyVerifiedUsers`. Filters apply to the tweets collected from the timeline.

**Why did a handle or tweet return an `error`?**
The account or tweet is protected, suspended, deleted, or X rate-limited the request at that moment. Error records are not charged. Re-run rate-limited inputs.

**How do I get replies too?**
Set `includeReplies` to `true` in `userTweets` mode. If X's replies timeline is temporarily unavailable, the actor falls back to the default timeline so you still get the account's posts.

**Is this an official X tool?**
No. This actor is independent and has no affiliation with X (formerly Twitter). It reads only data that is publicly available to logged-out users.

### Related scrapers

- [X (Twitter) Profile & Tweets Scraper](https://apify.com/scrapers_lat/x-profile-scraper): profile plus recent tweets in one record per handle.
- [Farcaster Casts Scraper](https://apify.com/scrapers_lat/farcaster-casts-scraper): posts and profiles from the Farcaster network.
- [Hacker News Scraper](https://apify.com/scrapers_lat/hacker-news-scraper): stories, comments, and points from Hacker News.
- [Google News Scraper](https://apify.com/scrapers_lat/google-news-scraper): news articles by query and topic.
- [GDELT News & Events Scraper](https://apify.com/scrapers_lat/gdelt-news-events-scraper): global news events and coverage.

### More scrapers at scrapers.lat

Built and maintained by [scrapers.lat](https://scrapers.lat), where we publish scrapers for US and Latin American public platforms: company registries, government data, finance, e-commerce and more. Browse the catalog or request a custom scraper at [scrapers.lat](https://scrapers.lat).

***

> Independent tool, not affiliated with X (formerly Twitter). Accesses only publicly available data. Keyword search is login-gated by X and is not supported.
>
> </content>

</invoke>

# Actor input Schema

## `maxPosts` (type: `integer`):

Maximum number of posts (tweets) to collect across all inputs. Optional.

## `mode` (type: `string`):

What to scrape. 'User Tweets' pulls a public account's recent posts. 'User Profile' pulls profile details (bio, followers, etc). 'Tweet by ID/URL' fetches specific tweets. Keyword 'Search' is shown but NOT available without a logged-in account — X requires authentication for search, so it returns a clear error instead of fake data.

## `handles` (type: `array`):

Public X (Twitter) handles for the 'User Tweets' and 'User Profile' modes. Accepts @name, name, or a profile URL such as https://x.com/nasa. Add one or more.

## `tweetsLimit` (type: `integer`):

For 'User Tweets' mode: maximum number of tweets to collect per handle (paginated). Default 100.

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

For 'User Tweets' mode: also include the account's replies (uses the tweets-and-replies timeline).

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

For 'Tweet by ID/URL' mode: numeric tweet IDs (for example 20) or full status URLs such as https://x.com/jack/status/20. One record per tweet.

## `searchQuery` (type: `string`):

Keyword/query for 'Search' mode. NOTE: X disabled logged-out search, so this mode returns a clear error explaining the limitation rather than results. Use 'User Tweets' instead.

## `searchType` (type: `string`):

Top or Latest for 'Search' mode. Not used — search is login-gated by X.

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

X (Twitter) URLs to scrape. In User modes, profile or status URLs contribute the account handle; in Tweet mode, status URLs contribute the tweet ID. Accepts plain URL strings.

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

Alternative name for the Handles input, merged with it. Accepts @name, name, or a profile URL.

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

Alternative name for Max posts. Caps the total number of records across the whole run.

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

Keep only tweets whose language code equals this two-letter value (for example en, es, pt). Applied to the tweets collected.

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

Keep only tweets whose author is verified (X Blue / verified).

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

Keep only tweets that include at least one photo.

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

Keep only tweets that include a video or animated GIF.

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

Keep only tweets that quote another tweet.

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

Keep only tweets with at least this many retweets.

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

Keep only tweets with at least this many likes (favorites).

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

Keep only tweets with at least this many replies.

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

Keep only tweets posted on or after this date/time (ISO 8601, for example 2026-01-01).

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

Keep only tweets posted on or before this date/time (ISO 8601, for example 2026-12-31).

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

Keep only tweets whose author handle matches this value (useful when a timeline mixes retweets from other accounts).

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

Keep only tweets that mention this handle.

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

Two-letter UI language hint sent to X for localized fields. Defaults to English.

## Actor input object example

```json
{
  "maxPosts": 10,
  "mode": "userTweets",
  "handles": [
    "nasa",
    "OpenAI"
  ],
  "tweetsLimit": 100,
  "includeReplies": false,
  "tweetIds": [
    "https://x.com/BarackObama/status/266031293945503744"
  ],
  "searchType": "Top",
  "onlyVerifiedUsers": false,
  "onlyImage": false,
  "onlyVideo": false,
  "onlyQuote": false,
  "lang": "en"
}
```

# Actor output Schema

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

No description

# API

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

## JavaScript example

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

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

// Prepare Actor input
const input = {
    "maxPosts": 10,
    "handles": [
        "nasa",
        "OpenAI"
    ],
    "tweetsLimit": 100,
    "tweetIds": [
        "https://x.com/BarackObama/status/266031293945503744"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapers_lat/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 = {
    "maxPosts": 10,
    "handles": [
        "nasa",
        "OpenAI",
    ],
    "tweetsLimit": 100,
    "tweetIds": ["https://x.com/BarackObama/status/266031293945503744"],
}

# Run the Actor and wait for it to finish
run = client.actor("scrapers_lat/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 '{
  "maxPosts": 10,
  "handles": [
    "nasa",
    "OpenAI"
  ],
  "tweetsLimit": 100,
  "tweetIds": [
    "https://x.com/BarackObama/status/266031293945503744"
  ]
}' |
apify call scrapers_lat/x-twitter-scraper --silent --output-dataset

```

## MCP server setup

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