How to Use X.com Twitter API Scraper: Step-by-Step Tutorial with Screenshots

X.com Twitter API Scraper extracts structured tweets and reply threads from X (Twitter) by keyword, advanced search query, handle, profile URL, hashtag, list, or conversation ID — with no X login and no proxy setup. It also runs as a real-time HTTP API in Standby server mode and connects directly to AI agents over MCP.

For this walkthrough I ran the default query ("web scraping", English, sorted by Top, maxItems: 50) in Apify Console. It returned 50 tweets in 9 seconds for $0.251 on the Free plan (about $0.013 at the Gold+ rate of $0.25 per 1,000 tweets).

Below is the full step-by-step walkthrough with real Apify Console screenshots, plus the Standby HTTP API, MCP config, and Python/Node examples.

What you can scrape

Input field Example What you get
startUrls https://x.com/NASA, /with_replies, /media, search, hashtag or list URL Timeline or matching tweets from any x.com or twitter.com URL
searchTerms web scraping, from:NASA moon since:2026-01-01 Tweets matching keywords and X advanced search operators
twitterHandles NASA, @apify Latest tweets from each public profile
tweetIds + scrapeReplies ["1630332507265589248"] with scrapeReplies: true Replies in that tweet’s conversation, newest first
conversationIds ["1630332507265589248"] Conversation replies directly, without toggling scrapeReplies

Every tweet record includes full_text (and full_text_extended for long posts), viewCount, favorite_count, retweet_count, reply_count, quote_count, bookmark_count, timestamps, media/URL entities, quoted tweets, and the full author profile object (screen_name, followers_count, is_blue_verified, bio, and more).

Step 1: Open the Actor and click “Try for free”

Open X.com Twitter API Scraper on Apify and click Try for free. If you don’t have an Apify account yet, sign up here — the Free plan includes $5 of monthly platform credit, enough to test your queries immediately.

X.com Twitter API Scraper page on the Apify Store with the Try for free button

Step 2: Add your queries

Apify Console opens on the Input tab with "web scraping" prefilled under Search terms. You can combine multiple inputs in a single run, and the Actor executes queries in parallel:

Apify Console input form showing Start URLs, Search terms, Twitter handles, Tweet IDs and Scrape replies

Step 3: Set limits, sorting and filters

Scroll down to configure Maximum number of items per query (maxItems, set to 50 here) and Sort By (Top, Latest, or Both). Note that maxItems applies to each query separately; if you choose Both, it applies to Top and Latest separately and deduplicates overlapping tweets.

Open Filter Tweets to narrow down searchTerms results without memorizing operators:

Maximum items per query, Sort By and Filter Tweets section in Apify Console

Filters and date fields apply to searchTerms. If you already write an operator inside a search term, that inline operator takes priority.

Step 4: Or paste the input as JSON

Switch the toggle at the top of the form from Form to JSON to inspect, copy, or paste the exact input payload. Here is the JSON configuration used for this run:

{
  "searchTerms": ["web scraping"],
  "maxItems": 50,
  "sort": "Top",
  "tweetLanguage": "en",
  "includeSearchTerms": false,
  "onlyImage": false,
  "onlyVideo": false,
  "onlyQuote": false,
  "onlyVerifiedUsers": false,
  "onlyTwitterBlue": false,
  "onlyNewTweets": false,
  "scrapeReplies": false
}

JSON input editor in Apify Console for X.com Twitter API Scraper

Step 5: Run it and inspect the Tweets table

Click Save & start. The test run finished in 9 seconds with 50 tweets and cost $0.251 on the Free plan.

On the Output tab, the built-in Tweets view displays the key columns cleanly: Tweet URL, full text, author handle and display name, author follower count, views, likes, retweets, replies, quotes, bookmarks, language, and timestamp. Switch to All fields to inspect the raw nested objects (author, entities, extended_entities, quote).

Succeeded run showing 50 tweets in 9 seconds with the structured Tweets table

Here is a real shortened record returned by this run (row 4, @RoundtableSpace, 236,688 views and 2,265 likes):

{
  "id": "2068639188396744937",
  "url": "https://x.com/RoundtableSpace/status/2068639188396744937",
  "full_text": "Web scraping is dead.\n\nPixelRAG skips HTML parsing completely. It screenshots the page and a vision model reads the answer straight off the pixels.\n\n100% open-source. Comes with a Claude Code plugin that gives Claude eyes.\n\nhttps://t.co/smH63qX6qp",
  "viewCount": 236688,
  "favorite_count": 2265,
  "retweet_count": 243,
  "reply_count": 74,
  "quote_count": 12,
  "bookmark_count": 2937,
  "lang": "en",
  "created_at": "Sun Jun 21 10:16:30 +0000 2026",
  "author": {
    "screen_name": "RoundtableSpace",
    "name": "0xMarioNawfal",
    "followers_count": 274876,
    "is_blue_verified": true
  }
}

Step 6: Export to JSON, CSV, or Excel

Click Export in the top-right corner of the run page to download the dataset in JSON, CSV, XML, Excel, HTML Table, RSS, or JSONL. You can pick either the flattened Tweets view (ideal for spreadsheets) or All fields (ideal for JSON pipelines), and include or omit specific columns before downloading.

Export dataset dialog showing JSON, CSV, XML, Excel, HTML Table, RSS and JSONL formats

Real-time HTTP API (Standby Server Mode)

Need live tweets inside an app or webhook without waiting for a batch run to spin up? Call the Actor’s Standby endpoint directly over HTTP and get tweets straight back in the JSON response:

# GET by handle
curl -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  "https://xtdata--twitter-x-scraper.apify.actor/tweets?handle=NASA&maxItems=20&sort=Latest"

# POST with searchTerms and filters
curl -X POST "https://xtdata--twitter-x-scraper.apify.actor/tweets" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["from:NASA"], "maxItems": 20, "sort": "Latest", "tweetLanguage": "en"}'

Single-query responses return meta.nextCursor and meta.hasMore so you can paginate older pages by passing cursor=<nextCursor>. Standby requests support up to 200 tweets per query and 5 queries per request (5-minute request timeout), and idle time between requests is not charged.

Connect to AI agents via MCP

Add X data directly to Claude Desktop, Cursor, or any MCP-compatible client:

{
  "mcpServers": {
    "apify-twitter-x": {
      "url": "https://mcp.apify.com/?tools=xtdata/twitter-x-scraper",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}

Run it from code (Python & Node.js)

Grab your token from Settings > API & Integrations in Apify Console and call the Actor with apify-client.

Python (pip install apify-client):

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("xtdata/twitter-x-scraper").call(run_input={
    "searchTerms": ["web scraping"],
    "maxItems": 50,
    "sort": "Top",
    "tweetLanguage": "en",
})

for tweet in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(tweet["author"]["screen_name"], tweet["viewCount"], tweet["favorite_count"], tweet["url"])

Node.js (npm install apify-client):

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('xtdata/twitter-x-scraper').call({
    searchTerms: ['web scraping'],
    maxItems: 50,
    sort: 'Top',
    tweetLanguage: 'en',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Fetched ${items.length} tweets`);

Scheduled monitoring (only new tweets)

To track brand mentions or key accounts continuously without duplicates, enable Only new tweets (monitoring) (onlyNewTweets: true), give the monitor a unique monitorName, and attach an Apify Schedule:

{
  "searchTerms": ["from:NASA"],
  "onlyNewTweets": true,
  "monitorName": "nasa-updates",
  "maxItems": 200
}

The first run stores up to 10,000 seen tweet IDs per query in the x-twitter-monitor-state key-value store in your account; every scheduled run after that returns and charges only newly posted tweets.

Pricing

X.com Twitter API Scraper uses Pay Per Event pricing with no separate Actor subscription. Rates drop significantly on paid Apify plans:

Event Free plan Bronze Silver Gold / Platinum / Diamond
Each tweet (result-item) $5.00 / 1,000 ($0.005) $0.80 / 1,000 ($0.0008) $0.60 / 1,000 ($0.0006) $0.25 / 1,000 ($0.00025)
Actor start (start, once per run) $0.0005 $0.00047 $0.00043 $0.0004

Duplicates within a query are not saved or charged, and you can set a Maximum cost per run under Run options to enforce a hard budget cap.

Tips

FAQ

Do I need an X (Twitter) account or cookies? No. The Actor reads only publicly available data without logging in.

Do I need to configure proxies? No proxies are needed on your side.

Can I scrape private or protected accounts? No — only public tweets and public profiles are accessible.

Does maxItems cap the whole run or each query? It caps each query (startUrls entry, search term, handle, or conversation). To cap total spending across all queries, set Maximum cost per run in Run options.

Ready to try it? Open X.com Twitter API Scraper on Apify and run your first search with the free monthly credit.