X.com killed its free API, then spent two years systematically breaking every workaround. Guest tokens expire. Doc_ids rotate every few weeks. Rate limits tighten without warning. If you're scraping X.com manually today, you're basically signing up for a part-time debugging job—10 to 15 hours a month just keeping your scraper alive.
This guide cuts through the noise. We'll show you exactly what breaks, why it breaks, and how to skip the maintenance cycle entirely.
X.com still delivers real-time signal that matters:
Real-time news monitoring. Breaking stories hit X.com first. By the time they reach traditional outlets, you've already missed the window.
Market sentiment tracking. Finance and crypto communities post decisions before they execute trades. If you're tracking market signals, X.com conversations are leading indicators.
Brand monitoring without the PR filter. People complain on X.com before they file support tickets. You see unfiltered customer sentiment in real time.
Competitor research. Watch what competitors announce, how audiences react, and which messaging actually lands.
The data is public. The challenge is getting it consistently without your scraper breaking every other week.
February 2025: X.com shut down free API access. The replacement? A paid tier starting at $42,000 per year for basic access to 100 tweets. That's not a typo.
For anyone scraping at scale, the official API is dead on arrival. So everyone moved to scraping. Then X.com started breaking scrapers.
X.com has rolled out defensive changes roughly every 2-4 weeks since killing the API:
February 2025: Free API dies. Paid tiers start at $42K/year.
March 2025: Rate limits drop. Free-tier apps stop working overnight.
June 2025: Guest token acquisition methods change. Existing scrapers break.
August 2025: Rate limits fall from 450 to 300 requests/hour. Datacenter IPs start getting blocked faster.
November 2025: GraphQL endpoint changes require doc_id updates across all query types.
January 2025: Guest token format shifts. TLS fingerprinting detection tightens.
April 2025: Doc_ids rotate again. Anti-scraping headers added to responses.
July 2025: Cookie validation requirements change. Session handling becomes stricter.
October 2025: IP reputation scoring tightens. Rotating proxies get flagged earlier.
January 2025: Guest tokens now bind to browser fingerprints. Datacenter IPs are permanently banned within seconds.
This isn't slowing down.
1. Guest Tokens
Every API call to X.com's GraphQL backend requires a guest token. These tokens:
Expire every 2-4 hours
Are tied to your IP address
Have acquisition methods that shift every few weeks
Require reverse engineering each time X.com changes its approach
When a token expires, your scraper stops. Acquiring a new one means catching up with X.com's latest obfuscation tactics.
2. Doc_ids
X.com's GraphQL queries use doc_ids—identifiers that tell the backend which operation to execute. These:
Rotate every 2-4 weeks
Require tracking 8-12 different IDs simultaneously
Need reverse engineering from X.com's frontend JavaScript
Have zero public documentation
Without current doc_ids, your queries fail silently or return empty results.
3. Rate Limits & IP Blocking
X.com enforces:
300 requests per hour per IP
Instant blocking of datacenter IPs (detected within 1-2 requests)
Increasing TLS fingerprinting checks to detect browser automation
Cookie validation that flags rotating proxy behavior
Even with correct tokens and doc_ids, you'll hit blocks faster than expected.
Running a DIY X.com scraper demands:
Monitoring for when things break (daily checks, alert setup)
Reverse engineering new guest token flows (2-4 hours per change)
Extracting new doc_ids from obfuscated JavaScript (1-3 hours)
Testing and deploying fixes before data gaps widen (1-2 hours)
Managing proxy rotation, session logic, and rate limiting (ongoing)
This typically costs 10-15 hours per month just to keep a scraper running. For teams with one engineer, it becomes a permanent side project.
If you're tired of chasing X.com's defensive updates every few weeks, there's a smarter way. Instead of maintaining your own scraper, you can use a solution that's already battle-tested and automatically updated when X.com changes its defenses. 👉 Skip the maintenance cycle and start scraping X.com data reliably—no reverse engineering required.
Profiles: Username, bio, follower count, verification status, profile picture URL.
Tweets: Text content, timestamps, media URLs, engagement counts (likes, retweets, replies).
Search Results: Tweets matching your query, ranked by relevance and recency.
Threads: Replies, quote tweets, and conversation chains connected to a parent tweet.
Engagement Metrics: Likes, retweets, replies, quotes, and bookmark counts.
Followers: User lists following a given account (where publicly available).
Scraping without authentication gives you limited data. You can get:
Public tweets and profiles
Follower counts and basic engagement metrics
You cannot get:
Private or protected account data
Detailed search results (limited without login)
Complete user timelines (incomplete without authentication)
Bookmarks, lists, or other account-specific data
This is why many scrapers require login, which introduces account suspension risk and session management complexity.
X.com is a React application that loads minimal HTML, then uses JavaScript to fetch data via GraphQL queries.
Here's the flow:
Load X.com page
JavaScript initializes and requests a guest token
Guest token is returned (valid for 2-4 hours)
Page JavaScript makes GraphQL queries using the token
Queries include doc_ids to identify which operation to execute
Backend returns JSON data, frontend renders it
Without a guest token, you can't make queries. Without the right doc_id, your query doesn't match any backend operation. Without working residential proxies and rate limiting, X.com blocks your IP.
A scraper needs to replicate this flow: get token, craft queries with current doc_ids, handle rate limits, and rotate IPs intelligently.
What they are: Temporary credentials that prove you're a user (not a bot).
Why they expire: X.com limits token lifetime to prevent token reuse and API abuse.
How they're tied to IP: X.com validates that requests using a token come from the same IP that requested it. Rotating IPs breaks token validity.
How to handle them: Automatically acquire new tokens, maintain them per IP session, and rotate them before expiration. Most scraping solutions manage guest tokens, IP sessions, and retries automatically—you provide the URL and the system handles the rest.
What they are: Unique identifiers for GraphQL operations. Each query type (fetch profile, get tweets, search) has its own doc_id.
Why they change: X.com rotates doc_ids every 2-4 weeks to break reverse-engineered scrapers. There's no pattern—they're essentially random identifiers.
How many are active: You typically need to track 8-12 doc_ids simultaneously:
UserByScreenName
UserByRestId
TweetDetail
TweetResultByRestId
SearchTimeline
UserTweets
Followers
Following
Likes
Bookmarks
ListLatestTweetsTimeline
HomeTimeline
How to find them: Reverse-engineer X.com's JavaScript bundle, intercept GraphQL calls with browser dev tools, or monitor X.com's API patterns. It's manual work, and it repeats every few weeks.
Scraping X.com without proxies will fail in minutes:
Rate limit: 300 requests per hour per IP
IP blocking: Datacenter IPs are blocked instantly (within 1-2 requests)
Detection: X.com tracks request patterns and flags suspicious behavior
You cannot scrape X.com at any meaningful scale using a single datacenter IP.
Why residential: Requests come from real residential IP addresses, making them indistinguishable from regular users. X.com's detection systems accept them.
Cost: $1-3 per gigabyte of traffic.
Rotation strategy: Use sticky sessions that last 10-15 minutes. This keeps the guest token and IP session stable while giving you enough coverage to avoid triggering rate limits on a single IP.
Scraping 10,000 tweets:
API calls: ~50-100 requests (1-2 per tweet for detail fetching)
Data transferred: 5-10 MB
Proxy cost: $5-8 at standard residential rates
For price-tracking or sentiment-analysis projects, this is reasonable. For continuous monitoring, managed scraping services with built-in proxy infrastructure are more cost-effective than managing your own setup.
When you're evaluating proxy solutions for X.com scraping, look for services that handle residential proxy rotation, session management, and rate limiting automatically. 👉 Get reliable X.com data without managing proxy pools yourself—residential proxies and anti-bot bypass included.
Every 2-4 weeks, X.com rolls out changes to guest tokens, doc_ids, rate limits, or detection patterns. There's no predictable schedule—changes happen when they happen.
X.com blocks datacenter IPs on sight. They detect datacenter IP ranges and reject requests immediately. Even with perfect tokens and doc_ids, a datacenter proxy will fail within seconds.
Yes, public tweets and profiles are scrappable without login. However, you'll have limited access to search, timelines, and engagement data. For full functionality, authenticated sessions are necessary, though they carry account suspension risk.
Scraping public data is generally legal. However, X.com's terms of service prohibit automated access without permission. Legally, it's a gray area. Use scraped data responsibly and review compliance requirements for your use case.
The free API is gone. Manual scraping breaks every 2-4 weeks due to guest tokens expiring, doc_ids rotating, and rate limits shifting. Maintaining a DIY scraper costs 10-15 hours per month.
The practical solution: use a maintained scraper. Guest tokens are handled automatically. Doc_ids are tracked and updated within 24 hours of rotation. Residential proxies are included. Rate limiting and anti-bot bypass are built in.
When X.com changes its defenses, the scraper updates automatically. You don't maintain anything. That's why 👉 X.com scraping with managed infrastructure makes sense when you need reliable data without the ongoing reverse engineering work.
Legal Disclaimer and Precautions
This tutorial covers popular web scraping techniques for education. Interacting with public servers requires diligence and respect. Here's a good summary of what not to do:
Do not scrape at rates that could damage the website
Do not scrape data that's not publicly available
Do not store PII of EU citizens who are protected by GDPR
Do not repurpose entire public datasets, which can be illegal in some countries
These are good general rules to follow in web scraping. For specific legal questions, consult a lawyer.