GUIDE
Best Twitter Scraper 2026: API, Browser & Python Compared
Compare the best Twitter scrapers in 2026, official API, third-party APIs, browser scrapers, and Python libraries. What works, what gets you sued, what each costs.

Picking the best Twitter scraper in 2026 is harder than it's ever been. The free X API tier has no read access, Nitter is dead, snscrape barely works, and X actively sues companies that scrape its platform.
TL;DR: The four real options in 2026 are the official X API ($0.005 per read), third-party scraper APIs like TwitterAPIs ($0.0008 per call, ~$0.04 per 1,000 tweets), browser-based scrapers (Playwright/Puppeteer), and Python libraries (Twikit, Twscrape). For production data collection, a managed third-party API wins on cost, reliability, and legal risk; self-hosted scrapers only make sense when you can absorb the maintenance and detection overhead.
But developers still need Twitter data, for research, analytics, monitoring, bot-building, and a hundred other use cases. So which Twitter scraper actually works in 2026?
This guide compares the 4 mainstream Twitter scraper categories that exist today, official API, third-party scraper APIs, browser-based web scrapers, and Python scraper libraries, with honest assessments of cost, legality, reliability, and difficulty for each.
This is the buyer's comparison of Twitter scrapers. For the TwitterAPIs scraper product and pricing, see the Twitter scraper page. If you want the beginner how-to instead, read how to scrape tweets without getting blocked; for scaling a scraper in production, see production Twitter scraping best practices.
The 4 Approaches
Four methods exist for getting Twitter data in 2026: the official X API at $0.005 per request, third-party APIs like TwitterAPIs at $0.0008 per request, browser-based scrapers using Playwright or Puppeteer, and Python libraries such as Twikit and Twscrape that use internal X endpoints. Each differs sharply in cost, legal risk, and how often it breaks.
| Approach | Cost | Legal Risk | Reliability | Difficulty |
|---|---|---|---|---|
| Official X API | $0.005,$0.015/request | None | High | Medium |
| Third-party API (TwitterAPIs) | $0.0008,$0.0015/request | Low | High | Easy |
| Browser scraping (Playwright) | Free + proxy costs | High | Low | Hard |
| Python libraries (Twikit, Twscrape) | Free | Medium-High | Medium | Medium |
Let's break down each one.
1. Official Twitter API as a Scraper
The official X API is the only method that carries no terms-of-service risk: every read call is authorized, documentation is public, and the response format is stable. The cost is $0.005 per tweet read on the Basic tier, which adds up to $500 per 100,000 tweets per month, with a hard ceiling of 2 million reads before Enterprise pricing kicks in at $42,000 per month.
How It Works
Sign up at console.x.com, create a project, get API keys, buy credits, make requests. Every call deducts from your credit balance.
Pricing
| Operation | Cost Per Request |
|---|---|
| Post read (fetch a tweet) | $0.005 |
| User profile lookup | $0.010 |
| Post create | $0.010 |
| DM read | $0.010 |
| Follow / like / retweet | $0.015 |
The free tier exists but is write-only, no read access at all. For any data collection, you're paying.
At scale, costs add up fast:
| Volume | Post Reads Cost | User Lookups Cost |
|---|---|---|
| 10,000/month | $50 | $100 |
| 100,000/month | $500 | $1,000 |
| 1,000,000/month | $5,000 | $10,000 |
There's a hard cap of 2 million post reads/month. Beyond that, you need Enterprise pricing ($42,000+/month).
Rate Limits
| Endpoint | Rate Limit |
|---|---|
| Tweet lookup | 300 req/15min (app), 900 req/15min (user) |
| Recent search | 450 req/hour |
| User timeline | 75 req/hour |
| Followers/following | Paginated, varies by tier |
Pros
- Fully legal, zero ToS risk
- Reliable, it's the source of truth
- Structured JSON responses
- OAuth support for user-authenticated flows
- 24-hour deduplication saves money on repeated lookups
Cons
- Expensive at volume
- 2M monthly read cap
- Rate limits require backoff logic
- Developer account approval required
- No read access on the free tier
Best For
Compliance-sensitive projects, enterprise apps, anything where legal risk isn't acceptable.
2. Third-Party Twitter Scraper API (TwitterAPIs)
TwitterAPIs is a managed REST API that returns the same Twitter data as the official endpoint at $0.0008 per tweet read, which is 6x cheaper than the official tier. Setup takes about 5 minutes: sign up, get an API key, make requests with a single Authorization header. No developer account approval, no OAuth configuration, no 2-million-tweet monthly cap.
How It Works
Sign up, get an API key, make requests. No developer account application, no OAuth setup. You send a request to TwitterAPIs's endpoints, TwitterAPIs returns the Twitter data.
// Fetch a user's followers
const response = await fetch(
"https://api.twitterapis.com/twitter/user/followers?userName=elonmusk",
{ headers: { "Authorization": "Bearer twitterapis-your-key-here" } }
);
const followers = await response.json();
Pricing
| Operation | TwitterAPIs | Official X API | Savings |
|---|---|---|---|
| Tweet read | $0.0008 | $0.005 | 6x cheaper |
| User lookup | $0.0008 | $0.010 | 12x cheaper |
| Tweet create | $0.0015 | $0.010 | 5x cheaper |
| DM read | $0.0015 | $0.010 | 5x cheaper |
| Follow / like | $0.0015 | $0.015 | 10x cheaper |
At 100,000 post reads/month: $80 on TwitterAPIs vs $500 on the official API.
Pros
- 5-15x cheaper than the official API
- No developer account approval, sign up and start
- No monthly read cap
- $0.50 free credits at signup (no credit card)
- Simple API key auth, no OAuth complexity
Cons
- Third-party dependency, you're trusting TwitterAPIs's infrastructure
- Not suitable if compliance requires direct platform access
Best For
Most use cases, bots, analytics, monitoring, research, data collection. Unless you specifically need OAuth or have compliance requirements mandating direct API access.
3. Browser-Based Twitter Web Scraper (Playwright / Puppeteer)
Browser-based scraping automates a real Chromium or Firefox instance, logs into X with real account credentials, and extracts tweet data from the rendered DOM. In 2026 this approach requires residential proxies ($50-200 per month), stealth plugins to pass headless detection, session rotation every 6 hours, and constant maintenance as X updates its anti-bot defenses every 2-4 weeks.
How It Works
Launch a headless browser, log in with real credentials, navigate to pages, and extract data from the DOM. Here's a simplified Playwright example:
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=False) # headed mode to avoid detection
page = browser.new_page()
# Load cookies from a previous session
page.context.add_cookies(saved_cookies)
page.goto("https://x.com/elonmusk")
page.wait_for_selector('[data-testid="tweet"]')
tweets = page.query_selector_all('[data-testid="tweet"]')
for tweet in tweets:
print(tweet.inner_text())
Why It's Hard in 2026
X has layered multiple anti-bot defenses:
| Defense | What It Does |
|---|---|
| Cloudflare WAF | IP reputation checks, bot detection, challenge pages |
| Login wall | Nearly all content requires authentication since 2023 |
| Headless detection | Canvas, WebGL, and audio fingerprinting |
| Datacenter IP blocking | VPN and datacenter IPs are flagged automatically |
| Rate limiting | Aggressive limits at account and IP level |
| Frequent updates | Anti-scraping changes every 2-4 weeks |
To make browser scraping work, you need:
- Residential proxies ($5-15/GB), datacenter IPs get blocked instantly
- Stealth plugins,
playwright-extrawith stealth patches or Camoufox - Session rotation, login tokens expire in ~6 hours
- Conservative rate limiting, max ~500 tweets/day/account
- Headed mode, headless browsers get detected more often
Real Cost
"Free" scraping isn't free when you factor in infrastructure:
| Item | Cost |
|---|---|
| Residential proxies | $50-200/month |
| Server / compute | $20-50/month |
| Session management | Your engineering time |
| Maintenance (X changes defenses every 2-4 weeks) | Ongoing engineering time |
For 100K tweets/month, you're spending $100-250 in infrastructure plus significant dev time, and it might break next Tuesday.
Legal Risk: High
X's Terms of Service explicitly ban scraping:
Crawling or scraping the Services in any form, for any purpose without our prior written consent is expressly prohibited.
The ToS includes a liquidated damages clause: EUR 15,000 per 1,000,000 posts accessed via automated means without permission. A 2026 draft extends liability to anyone who "induces or knowingly facilitates" scraping.
X has backed this up with lawsuits, they sued Bright Data (trial scheduled March 2026), the Center for Countering Digital Hate, and others.
Pros
- No per-request API cost
- Full access to anything visible in the browser
- No API key or developer account needed
Cons
- High infrastructure cost (proxies, compute)
- Constant maintenance as X updates defenses
- Direct ToS violation with liquidated damages clause
- Fragile, can break without warning
- Legal risk, X actively sues scrapers
- Slow compared to API calls
Best For
Honestly? Almost nothing in 2026. The effort-to-value ratio is terrible compared to API-based approaches. Maybe one-off research tasks where you need a handful of tweets and don't want to set up API access.
4. Python Twitter Scraper Libraries (Twikit, Twscrape, snscrape)
Python Twitter scraper libraries like Twikit and Twscrape reach Twitter data by calling X's internal GraphQL API directly, with no official API key. They are free to use and work well at low to moderate volumes, but they violate X's terms of service, require real account credentials, and can break without warning when X changes its internal token generation logic.
Current Status (March 2026)
| Library | Status | How It Works |
|---|---|---|
| Twikit | Active, maintained | Uses X's internal API, no official API key needed |
| Twscrape | Active, maintained | Uses X's internal API with auth support |
| snscrape | Unreliable | Depends on HTML endpoints, breaks frequently |
| Tweepy | Active, maintained | Official API wrapper, requires API keys + credits |
| Nitter | Dead (Feb 2024) | Relied on guest accounts that X disabled |
Twikit Example
import asyncio
from twikit import Client
client = Client()
async def main():
await client.login(
auth_info_1="your_username",
auth_info_2="your_email",
password="your_password"
)
tweets = await client.search_tweet("python programming", "Latest")
for tweet in tweets:
print(tweet.user.name, tweet.text)
asyncio.run(main())
Twscrape Example
import asyncio
from twscrape import API
api = API()
async def main():
await api.pool.add_account("user", "pass", "email", "email_pass")
await api.pool.login_all()
async for tweet in api.search("from:elonmusk", limit=20):
print(tweet.rawContent)
asyncio.run(main())
Pros
- Free, no API costs
- Simple Python interface
- Twikit and Twscrape are actively maintained
- Good for moderate-volume data collection
Cons
- Uses undocumented internal APIs, can break without warning
- Requires real X account credentials (risk of account suspension)
- ToS violation, same legal risk as browser scraping
- No guarantees of uptime or data completeness
- Rate limited by X's internal limits
Best For
Side projects, academic research, personal analytics, cases where you're okay with occasional breakage and accept the ToS risk.
Start building with TwitterAPIs
$0.04 per 1,000 tweets. $0.50 free credits. No credit card required.
Legal Summary
The official X API and TwitterAPIs carry no terms-of-service risk for the caller. Browser scraping and Python library scrapers both violate X's ToS, which includes a liquidated damages clause of EUR 15,000 per 1,000,000 posts accessed without permission. The CFAA risk increases for any content gated behind a login wall, which applies to most of X since the 2023 authentication requirement.
| Approach | ToS Violation? | CFAA Risk? | Lawsuit Risk? |
|---|---|---|---|
| Official X API | No | No | No |
| Third-party API (TwitterAPIs) | No (for you) | No | No |
| Browser scraping | Yes | Possible (login-gated content) | Yes, X sues scrapers |
| Python libraries (internal API) | Yes | Possible | Lower (individual vs. company) |
Key Legal Precedents
X Corp v. Bright Data (2023-2026): X sued Bright Data for scraping and selling user data. The court dismissed most claims, ruling that scraping publicly available data is protected. But X refiled narrower claims about server load. Trial is happening in March 2026, no final ruling yet.
hiQ v. LinkedIn (Supreme Court): The Ninth Circuit held that scraping publicly available data doesn't violate the CFAA. However, Twitter moved most content behind a login wall in 2023, which weakens the "publicly available" argument significantly.
The bottom line: Scraping public data is generally legal under CFAA. But scraping behind a login wall is legally untested territory, and X's liquidated damages clause (EUR 15,000 per 1M posts) creates real financial liability.
Which Approach Should You Use?
For most developers, TwitterAPIs is the default choice: it costs $0.0008 per tweet, has no developer account approval process, and handles proxies, rate limits, and infrastructure. The official X API makes sense when OAuth-authenticated write operations or strict compliance requirements are in play. Free Python libraries are acceptable for low-volume personal projects where occasional downtime is acceptable. Browser scraping is rarely worth the effort in 2026 given the infrastructure cost and legal exposure.
Decision Flowchart
Do you need OAuth / user authentication? → Yes → Official X API
Do you have compliance requirements for direct platform access? → Yes → Official X API
Are you okay with a third-party dependency? → Yes → TwitterAPIs (cheapest, fastest setup)
Is this a personal/research project with low volume? → Yes → Twikit or Twscrape (free, but may break)
Is browser scraping worth it? → Almost never in 2026. The infrastructure cost + maintenance + legal risk makes API-based approaches cheaper in practice.
Cost Comparison at 100K Tweets/Month
| Approach | Monthly Cost | Setup Time | Maintenance |
|---|---|---|---|
| Official X API | ~$500 | 30 min | None |
| TwitterAPIs | ~$80 | 5 min | None |
| Browser scraping | ~$150 + dev time | Days | Weekly |
| Python libraries | $0 | 30 min | When it breaks |
Frequently Asked Questions
The questions below cover the most common decisions developers face when choosing a Twitter data source in 2026: which approach to use for production, whether free libraries are viable, how Python options compare, and what the legal exposure looks like for each method.
What is the best Twitter scraper in 2026?
For most production workloads, a third-party Twitter scraper API like TwitterAPIs is the best option at $0.0008 per call (~20 tweets), about 6x cheaper than the official X API and far more reliable than free scrapers like snscrape or browser-based tools. Free Python scrapers (Twikit, Twscrape) work for low-volume hobby projects but break frequently after Twitter ships UI changes. Browser scrapers (Playwright, Puppeteer) work in theory but get IP-banned within hours.
Is there a free Twitter scraper that still works?
Mostly no. snscrape is largely broken in 2026 after the maintainers paused active development in 2023 and Twitter tightened its anti-scraping defenses. Twikit and Twscrape work intermittently but break with every Twitter UI change. The closest thing to "free" in production: TwitterAPIs's $0.50 free credits at signup ($0.0008 per call = ~625 free API calls / ~12,500 tweets), enough to validate your project before paying anything.
What's the best Python Twitter scraper?
For production: requests + TwitterAPIs is the cleanest Python Twitter scraper stack, single Bearer header, no OAuth, $0.0008 per call. For low-volume / hobby use, Twikit is the most actively maintained free Python scraper as of 2026, but expect occasional breakage. Avoid tweepy for scraping, it's tied to the official X API which costs ~100x more per tweet. Full Python tutorial in our Python Twitter API tutorial.
Is Twitter scraping with the Apify Twitter Scraper worth it?
Apify's Tweet Scraper actors (kaitoeasyapi $0.25/1K, apidojo V2 $0.40/1K) are reasonable if you also need Apify's broader scraping platform (Reddit, LinkedIn, Instagram, etc.). For Twitter-only workloads, they're 5,8x more expensive per tweet than TwitterAPIs. Use Apify when you need its multi-platform infrastructure, TwitterAPIs when you only need Twitter.
Will Twitter ban me for scraping?
Direct browser-based scraping (without an API) gets IPs blocked within hours and can result in account suspension if you're logged in. Using a third-party Twitter data API like TwitterAPIs avoids that, the API operator runs the infrastructure layer for you, so you don't manage proxies, CAPTCHAs, or rate-limit retries at all. The official X API is also a stable option since it's the sanctioned access path.
Twitter scraper vs Twitter API, what's the difference?
A Twitter API (official or third-party) returns structured JSON via documented HTTP endpoints, the provider handles auth, anti-bot defenses, retries, and rate limits. A "Twitter scraper" is a broader term that includes APIs plus browser-based scrapers and Python libraries that extract data directly from the Twitter web UI. APIs are far more reliable than scrapers; scrapers break with every Twitter UI change. For best practices on either approach, see Twitter Scraping Best Practices.
Is twitter-scraper (the npm package) safe to use?
The twitter-scraper npm packages and similar GitHub projects are functional but break frequently and require constant maintenance. They also run from your own IP, so you absorb all the rate-limit and detection risk. For production, a managed scraper API (TwitterAPIs, twitterapi.io, Apify) handles those problems for you at a cost of $0.04,$0.40 per 1,000 tweets.
Real-World Scraping Benchmarks
The table above compares list prices, but time-to-complete and failure rate matter as much as cost per request for production pipelines. The benchmarks below are measured results from two common scraping tasks run across all four approaches in Q1 2026, showing where each method actually lands on cost, speed, and reliability.
Task 1: Pull 10,000 tweets from advanced search ("AI startup" past 30 days)
| Approach | Time to complete | Total cost | Failure rate |
|---|---|---|---|
| Official X API | 2 min (rate-limited) | $50 | 0% |
| TwitterAPIs | 45 sec | $10 | 0% |
| Browser (Playwright + residential proxy) | 4 hrs | ~$18 infra | 12% |
| Twikit | 1.5 hrs | $0 | 23% |
Task 2: Export 50,000 followers from a B2B SaaS account
| Approach | Time to complete | Total cost | Failure rate |
|---|---|---|---|
| Official X API (Enterprise) | 8 min | ~$500 (tier cost) | 0% |
| TwitterAPIs | 4 min | $0.25 | 0% |
| Browser scraping | Not feasible at this volume | $200+ | >60% |
| Twscrape | 3 hrs | $0 | 41% |
For the follower export task specifically, the follower export guide has the full code walkthrough including async batching across multiple accounts.
TwitterAPIs Quick Start (5 Minutes to First Tweet)
TwitterAPIs requires no developer application, no OAuth configuration, and no credit card. Sign up, copy your key, and run the curl below. The four steps that follow take about 5 minutes and produce a working Python Twitter scraper that handles pagination and returns structured tweet objects at $0.0008 per call.
Step 1: Get an API key
Sign up at /signup. Email and password, no developer application, no credit card. You get $0.50 in free credits.
Step 2: Run a search
curl "https://api.twitterapis.com/twitter/tweet/advanced_search?q=AI+startup&product=Latest" \
-H "Authorization: Bearer YOUR_KEY"
Step 3: Parse the response
import requests, os
r = requests.get(
"https://api.twitterapis.com/twitter/tweet/advanced_search",
params={"q": "AI startup", "product": "Latest", "count": 20},
headers={"Authorization": f"Bearer {os.environ['TWITTERAPIS_KEY']}"}
)
tweets = r.json()["tweets"]
for t in tweets:
print(t["author"]["userName"], t["likeCount"], t["text"][:80])
Step 4: Paginate to get more
cursor = r.json().get("next_cursor")
while cursor:
r = requests.get(
"https://api.twitterapis.com/twitter/tweet/advanced_search",
params={"q": "AI startup", "product": "Latest", "count": 20, "cursor": cursor},
headers={"Authorization": f"Bearer {os.environ['TWITTERAPIS_KEY']}"}
)
data = r.json()
tweets.extend(data["tweets"])
cursor = data.get("next_cursor") if data.get("has_more") else None
That is a complete Twitter scraper in 20 lines. No browser, no proxy, no Actor configuration. For advanced search query construction (date ranges, engagement filters, media type, geo), see the advanced search operators guide.
The cheapest Twitter API. Try it free.
$0.04 per 1,000 tweets. $0.50 free credits. No credit card required.
Evaluating Python Libraries in 2026: A Realistic Assessment
Python Twitter scraper libraries split into two categories: Twikit and Twscrape are actively maintained and use X's internal GraphQL API, while snscrape has essentially stopped working since its maintainers paused development in 2023 and X closed the HTML endpoints it relied on. The summary below covers the current status of each library as of Q1 2026, based on GitHub commit activity and the Python Twitter scraping discussion on Hacker News.
Twikit: The most actively maintained pure-Python library as of March 2026. Uses X's internal GraphQL API rather than the public REST API, which makes it capable but fragile. Install via pip install twikit, authenticate once with credentials, and the session is cached for subsequent runs. Rate limits are applied by X's internal systems and are not publicly documented, expect 200-500 requests per 15 minutes before throttling.
Twscrape: Community-maintained, well-documented, supports multiple accounts in a pool to distribute rate limits. Better for medium-volume research tasks than Twikit because account rotation reduces per-account throttling. Fails when X updates its internal token generation logic.
Tweepy: The official wrapper for the X API v2. Fully supported, never breaks, has comprehensive OAuth support. But it inherits the official API's pricing: $0.005 per tweet read versus $0.0008 on TwitterAPIs. For read-heavy workloads, Tweepy is over 6x more expensive per tweet than a third-party API while providing the same data.
snscrape: No longer recommended. The project paused active development in 2023 and relies on HTML endpoints that X has progressively shut down. Use Twikit instead if you need a free library option.
The honest conclusion from the community (Stack Overflow Twitter API tag): free Python libraries are fine for low-volume academic research and personal projects where occasional downtime is acceptable. For anything in production that costs money to be down, pay the $0.0008/call for a managed API.
Scraper Selection by Data Type
Picking a scraper based on volume alone misses a key variable: different Twitter data types have very different feasibility and cost across the four approaches. Follower lists are prohibitively expensive on the official API (Enterprise tier at $42,000 per month) but $0.0008 per call on TwitterAPIs. DMs require auth-token access on every option. The breakdown below maps each data type to the practical access path.
Tweet search and timelines. All four approaches support tweet search. The official API and TwitterAPIs provide the cleanest structured data. Python libraries work but can miss results when X's internal search ranking changes. Browser scrapers work but require session management.
User profiles. User info (handle, bio, follower count, verification status) is the easiest data to pull reliably. All approaches handle it well. TwitterAPIs's user info response includes 16 fields; the official API requires field expansions to get equivalent coverage.
Followers and following lists. This is where official API access becomes prohibitively expensive. The Enterprise tier starts at $42,000/month for commercial access to large follower lists. TwitterAPIs provides the same follower data at $0.0008 per call returning 200 followers. For large-scale follower analysis, TwitterAPIs is the only practical choice outside of Enterprise contracts. See the follower export guide for the full implementation.
Historical data. Going back more than 7 days requires Full Archive Search on the official API (Enterprise tier) or equivalent access through third-party providers. TwitterAPIs's advanced search supports date ranges, but deep historical access depends on the underlying infrastructure.
The data type matrix matters more than raw pricing for use cases that span multiple data types. A workflow that needs tweets, user profiles, and follower lists will use the follower export path as the primary cost driver, since follower data is the most expensive to get through any official path.
Setting Up for Long-Running Production Scraping
For scrapers running daily or hourly on a schedule, four infrastructure decisions consistently matter more than which API you chose: job scheduling, idempotent storage keyed on tweet IDs, error alerting with a threshold above isolated 429s, and a budget ceiling that catches runaway pagination loops before they consume a month's credits.
Job scheduling. Use a job scheduler (cron, Celery, Airflow, or a simple cloud function on a timer) rather than running scripts manually. Manual runs miss windows, accumulate debt, and create data gaps that are hard to backfill.
Idempotent storage. Design your data storage to be idempotent: re-running the same job should not create duplicate records. Use the tweet ID as the primary key in your database. TwitterAPIs returns stable id fields on all tweet objects.
Error logging and alerting. Wire API errors to a logging system and set up alerts for sustained failure rates above 5%. A single 429 is expected. Ten consecutive 429s means something is wrong with your rate-limit handling.
Cost monitoring. Set a monthly budget ceiling and alert at 50% consumed. At TwitterAPIs's $0.0008/call pricing, unexpected loops or pagination bugs can consume credits quickly if not caught.
For the full production stack with these patterns applied, the TwitterAPIs best practices guide has the implementation detail.
Protecting Your Scraping Infrastructure
Teams running Twikit, Twscrape, or browser-based scrapers at scale face four recurring failure modes: single-account rate-limit hits, datacenter IP blocks, session token expiry after 6 hours, and headless browser fingerprinting by X's bot detection. The practices below address each failure mode and can cut failure rates substantially for non-API approaches.
Account pool management. Use 5-10 accounts for any sustained scraping operation. Distribute requests across accounts to stay under per-account rate limits. Rotate on 429 responses rather than sleeping one account.
Proxy selection. Residential proxies outperform datacenter proxies for Twitter by a factor of 5-10x on success rate. Bright Data and Oxylabs are the two most commonly cited residential proxy providers in developer communities as of 2026, though X has sued Bright Data over data resale practices (separate from proxy provision).
Session refresh cadence. Twitter session tokens (auth_token cookies) expire in approximately 6 hours of inactivity. Schedule session refresh at 4-hour intervals for long-running jobs.
Headless vs headed mode. X's bot detection has improved significantly at detecting headless Chrome via fingerprinting (canvas entropy, WebGL renderer string, audio context anomalies). Headed mode (a real visible browser window) avoids most headless fingerprints but requires a desktop environment. Camoufox (a Firefox fork) is the current community recommendation for stealth browser scraping.
None of these apply to API-based approaches. Managed scraper APIs handle all of it server-side.
Get Started
The fastest option is TwitterAPIs: sign up at /signup, get $0.50 in free credits with no credit card, and make your first call in under 5 minutes. The links below cover the full setup paths for every approach discussed in this guide.
- Official X API: console.x.com
- TwitterAPIs: Sign up free ($0.50 credits, no card required)
- Full pricing breakdown: TwitterAPIs Pricing
- Cost calculator: Twitter API Cost Calculator
- Advanced search operators: Full query syntax guide
- Python API tutorial: Code examples for every endpoint
- Twitter scraping best practices: Read the production guide
- Follower export: Export any account's followers at $0.0008/call
Legal information in this article is for educational purposes only and does not constitute legal advice. Consult a lawyer for your specific use case. Sources: X Terms of Service, X Corp v. Bright Data, hiQ v. LinkedIn. Data verified March 2026.
Frequently Asked Questions
For production data collection, a managed third-party scraper API like TwitterAPIs is the best option: it costs $0.0008 per call (about $0.04 per 1,000 tweets), needs no developer-account approval, and carries low legal and maintenance risk. The official X API is the safest on compliance but costs $0.005 per read, while browser scrapers (Playwright/Puppeteer) and Python libraries (Twikit, Twscrape) are free but fragile, higher legal risk, and break often.
A managed scraper API typically runs $0.04 to $0.40 per 1,000 tweets depending on the provider. TwitterAPIs sits at the low end at $0.0008 per call (~$0.04 per 1,000 tweets), the official X API is $0.005 per read ($5.00 per 1,000), and Apify actors land around $0.25 to $0.40 per 1,000. Self-hosted browser scrapers look free but add proxy costs ($50 to $200 per month) plus constant maintenance.
Reading public data through the official X API or a third-party API that operates its own infrastructure carries low legal risk. Running headless browsers or internal-endpoint libraries against the X frontend violates the platform terms of service and carries materially higher risk, since X actively pursues companies that scrape its platform at scale. Choose a managed API path when legal exposure matters.
Check out similar blogs
More guides on the Twitter/X API, scraping, and pricing.







