Twitter (X) Scraper : Tweets, Profiles & Data avatar

Twitter (X) Scraper : Tweets, Profiles & Data

Pricing

from $9.30 / 1,000 results

Go to Apify Store
Twitter (X) Scraper : Tweets, Profiles & Data

Twitter (X) Scraper : Tweets, Profiles & Data

Scrape tweets from any X (Twitter) profile or tweet URL, no official API needed. Get text, engagement metrics, media, hashtags & author data as JSON, CSV or Excel.

Pricing

from $9.30 / 1,000 results

Rating

0.0

(0)

Developer

Techforce Global

Techforce Global

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

X / Twitter Scraper (Profiles & Tweets)

Scrape tweets from any public X/Twitter profile or individual tweet URL and get clean, structured JSON — text, engagement metrics, author details, media, hashtags, mentions, and links. This Actor drives a real Chromium browser and intercepts X's internal GraphQL API, so you get the same rich data the website itself receives, without relying on the paid X API.

Built on the Apify platform, it gives you scheduling, a REST API, integrations (Zapier, Make, Google Sheets, etc.), automatic proxy rotation, and run monitoring out of the box.

Why use this X / Twitter Scraper?

  • Track brands, competitors, or public figures by pulling their latest tweets on a schedule.
  • Social listening & research — collect tweets and their engagement for analysis or dashboards.
  • Archive tweets before they disappear, with full metrics and media URLs.
  • Feed downstream tools — export to JSON, CSV, or Excel, or pull via the Apify API.

How to use the X / Twitter Scraper

  1. Add one or more profiles (handles like nasa, @apify, or full profile URLs) and/or tweet URLs.
  2. Set Max tweets per profile and toggle Include replies if you want reply/thread coverage.
  3. Leave Proxy configuration on the default (Apify Proxy — recommended and available on the free plan).
  4. Click Start and download results from the Output/Storage tab when the run finishes.

One-time setup: authentication (required)

X requires a logged-in session to view almost all content. This Actor keeps authentication out of the input form — the operator supplies it once via secrets, so end users never touch credentials.

Recommended — auto-login (set it once, never refresh again). Store the account's login credentials as secrets and the Actor logs in for you, captures a fresh auth_token / ct0, saves them in a key-value store (twitter-session), reuses them on later runs, and re-logs in automatically when they expire:

apify secrets add x_email "you@example.com"
apify secrets add x_username "your_handle" # without the @
apify secrets add x_password 'your-password'

These map to X_EMAIL, X_USERNAME, X_PASSWORD in .actor/actor.json. The account must not have two-factor auth or e-mail/SMS login verification enabled — the Actor cannot solve those challenges and will abort with a clear log message if one appears (in that case, log in once manually, then fall back to the cookie method below).

Alternative — supply cookies manually. Get them from a browser logged into a throwaway X account (DevTools → Application → Cookies → x.com) and store them as a secret. Two options:

Option A — individual cookies:

apify secrets add twitter_auth_token "<auth_token cookie value>"
apify secrets add twitter_csrf_token "<ct0 cookie value>"

Option B — a full cookie bundle (JSON array of Playwright cookies, a {"name":"value"} map, or an a=1; b=2 header string):

$apify secrets add twitter_cookies '{"auth_token":"...","ct0":"..."}'

These are already wired to the TWITTER_AUTH_TOKEN, TWITTER_CSRF_TOKEN, and TWITTER_COOKIES environment variables in .actor/actor.json. Use a dedicated/disposable account — automated access can get accounts rate-limited or suspended.

Input

Configure the run from the Input tab or via JSON:

{
"profiles": ["nasa", "@apify"],
"tweetUrls": ["https://x.com/apify/status/1780000000000000000"],
"maxTweetsPerProfile": 100,
"includeReplies": false,
"maxScrolls": 25,
"proxyConfiguration": { "useApifyProxy": true }
}
FieldTypeDescription
profilesarrayHandles (nasa, @apify) or profile URLs to scrape timelines from.
tweetUrlsarrayIndividual tweet/status URLs to scrape.
maxTweetsPerProfileintegerMax tweets per profile (0 = unlimited, bounded by pagination).
includeRepliesbooleanAlso load the "with replies" timeline / conversation replies.
maxScrollsintegerSafety cap on scroll-based pagination per page.
proxyConfigurationobjectProxy settings; defaults to Apify Proxy (recommended).

Output

Each item is one tweet. Download as JSON, CSV, Excel, or HTML from the dataset.

{
"id": "1780000000000000000",
"url": "https://x.com/apify/status/1780000000000000000",
"text": "We just shipped a new feature!",
"createdAt": "Wed Apr 10 12:34:56 +0000 2024",
"lang": "en",
"likeCount": 128,
"retweetCount": 24,
"replyCount": 9,
"quoteCount": 3,
"bookmarkCount": 12,
"viewCount": 18452,
"isRetweet": false,
"isQuote": false,
"isReply": false,
"conversationId": "1780000000000000000",
"hashtags": ["scraping"],
"mentions": [],
"urls": ["https://apify.com"],
"media": [{ "type": "photo", "imageUrl": "https://pbs.twimg.com/media/....jpg", "videoUrl": null }],
"authorUsername": "apify",
"authorName": "Apify",
"authorId": "123456",
"authorVerified": true,
"authorFollowers": 25000,
"scrapedFrom": "profile:apify"
}

Data fields

FieldDescription
id, urlTweet ID and canonical URL.
textFull tweet text (long-form note tweets included).
createdAt, lang, sourceTimestamp, language, posting client.
likeCount, retweetCount, replyCount, quoteCount, bookmarkCount, viewCountEngagement metrics.
isRetweet, isQuote, isReplyTweet type flags.
conversationId, inReplyToUsername, inReplyToTweetIdThread/reply context.
hashtags, mentions, urls, mediaExtracted entities and media (image/video URLs).
authorUsername, authorName, authorId, authorVerified, authorFollowers, authorProfileImageUrlAuthor details.

Pricing / cost estimation

This Actor is priced by Apify compute usage — you don't pay for a Twitter API subscription. Because it runs a browser, cost scales with how many tweets you scrape and how many scrolls are needed. To keep runs cheap: lower maxTweetsPerProfile and maxScrolls, and scrape only the profiles you need. Heavy resources (images, video, fonts) are blocked automatically to reduce proxy bandwidth.

Tips & advanced options

  • Use a dedicated account for the cookie secret; rotate it if it gets challenged.
  • Latest vs. exhausted timelines — the scraper stops after several idle scrolls (no new tweets), so unlimited runs still terminate.
  • Proxies matter — keep Apify Proxy enabled; scraping X from a raw datacenter IP without proxying gets blocked quickly.
  • Schedule it in the Apify Console for recurring monitoring.

FAQ, disclaimers & support

Is scraping X/Twitter legal? This Actor collects publicly available data. You are responsible for complying with X's Terms of Service, applicable laws (including GDPR/CCPA), and for not collecting private or personal data without a lawful basis. Use responsibly.

Why are my results empty? Almost always missing/expired authentication cookies, a protected account, or aggressive rate limiting. Refresh the cookie secret and keep proxying on.

Limitations — X changes its internal API frequently; if extraction drifts, open an issue. Very large timelines are bounded by how far X lets a session paginate.

For bugs or feature requests, use the Issues tab on the Actor page.