You can still scrape Twitter in 2026, but most 2023 tutorials no longer work. The cheapest sanctioned route is the X API at $5 per 1,000 posts; scraping while logged in costs less per post but puts the account at risk. Below are the four methods, a working Python setup, why X accounts get locked, and how Grok Bot fits in now that it reads X natively.
Key takeaways
- snscrape, Twint and most public Nitter instances stopped working once X closed guest access. Logged out, X still shows public profiles and single posts; search, timelines and reply threads require an account.
- The official X API is pay-per-use: $0.005 per post read and $0.010 per user read, billed per resource returned.
- Grok Bot reads X through an X plugin on your connected account and through the x_search tool, which xAI bills at $5 per 1,000 posts fetched. Neither is an HTML scraper.
- Scraping without the API means a logged-in account, and that depends on consistency: a dedicated mobile IP per account, a real non-VoIP number and a persistent browser profile.
- VoidMob covers Grok's scripted fallback, not x_search: a number for your own X account's codes and a mobile IP for the script's session, both bought through the VoidMob skill.
Can You Still Scrape Twitter in 2026?
Yes, with conditions. Three changes since 2023 define what works, and together they explain why twitter web scraping now depends on accounts rather than request-level tricks.
Free libraries no longer work. snscrape, Twint and the public Nitter network relied on anonymous guest access to X's internal endpoints, and X closed that access. Some Nitter instances survive on pooled logged-in accounts, but they are unreliable, and the older tutorials that still rank are where most failed first attempts begin.
Most useful data requires login. Logged out, you can open a public profile or a single post. Search results, full timelines, follower lists and reply depth require an account, so any serious X scraper runs on one.
API access is metered. X moved new developers to pay-per-use billing in early 2026, with no recurring free tier, only starter credits.
How to Scrape Twitter Data: 4 Methods Compared
Every way to scrape data from Twitter fits one of four methods, each trading cost against engineering effort and account risk.
| Method | Cost | Login needed | Scale | Breaks when | Best for |
|---|---|---|---|---|---|
| 1: Official X API | $5 per 1k posts | Developer account | High | The bill grows | Compliant production |
| 2: Grok Bot and x_ | $5 per 1k posts, plus tokens | X account or xAI key | Research | Large exact exports | Monitoring, summaries |
| 3: DIY logged-in | Proxy, accounts, dev time | Dedicated account | Per account | Account locked | Data the API omits |
| 4: Scraper APIs | Per request | Vendor handles it | Vendor-set | Vendor lags X | No maintenance |
Method 1: the official X API. X's pricing docs list post reads at $0.005 and user reads at $0.010, charged per resource returned, so a search that returns 100 posts bills 100 reads. That is $5 per 1,000 posts. It is the only fully sanctioned route, and the right one when compliance matters more than cost.
Method 2: Grok Bot and x_search. xAI's agent and API can search X for you, metered at the same per-item rates. Details follow in the Grok Bot section below.
Method 3: DIY logged-in scraping. You run a real browser on a logged-in account and capture the JSON that X's web app loads. It is the lowest-cost way to scrape tweets in bulk and the most engineering work, and it reaches data from X that no API endpoint exposes.
Method 4: scraper APIs and tools. Hosted actors and scraper APIs maintain the internals for you, running their own accounts and IPs, so you inherit their reliability and their compliance posture along with the convenience. Fast JavaScript libraries for X's internal API exist as well, but throughput is rarely the constraint; each one still needs a logged-in session behind it.
Whichever method you choose, scraping X without the API raises the same two questions: whose account carries the session, and where its traffic originates.
Scrape X With Python: A Logged-In Twitter Scraper
X's web app is a GraphQL client. When you search or open a profile, the page fetches JSON from internal operations named after what they load, such as SearchTimeline and UserTweets at the time of writing. Capturing those responses is more reliable than parsing HTML, because the browser always requests the current operation IDs itself. Our Instagram scraping guide uses the same interception pattern.
This twitter scraper in Python keeps a persistent browser profile so you log in once, routes through one dedicated proxy, and collects posts from a live search:
1import json2import os3from playwright.sync_api import sync_playwright4 5# One dedicated mobile IP per account. Host, HTTP port and login come from the6# dedicated order's credentials. Playwright needs http:// for authenticated proxies.7PROXY = {8 "server": f"http://{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}",9 "username": os.environ["PROXY_USER"],10 "password": os.environ["PROXY_PASS"],11}12PROFILE_DIR = "profiles/x-research-01" # keeps cookies, so you log in by hand once13captured = []14 15def on_response(resp):16 if "/graphql/" in resp.url and ("SearchTimeline" in resp.url or "UserTweets" in resp.url):17 try:18 captured.append(resp.json())19 except Exception:20 pass21 22def walk(node):23 # Yield every tweet object found anywhere in X's nested timeline JSON24 if isinstance(node, dict):25 legacy = node.get("legacy")26 if isinstance(legacy, dict) and "full_text" in legacy:27 yield {"id": legacy.get("id_str"), "text": legacy["full_text"],28 "likes": legacy.get("favorite_count"), "created_at": legacy.get("created_at")}29 for value in node.values():30 yield from walk(value)31 elif isinstance(node, list):32 for value in node:33 yield from walk(value)34 35with sync_playwright() as pw:36 ctx = pw.chromium.launch_persistent_context(37 PROFILE_DIR, headless=False, proxy=PROXY,38 locale="en-US", timezone_id="America/New_York", # match the proxy's location39 )40 page = ctx.new_page()41 page.on("response", on_response)42 page.goto("https://x.com/search?q=web%20scraping&f=live")43 for _ in range(5):44 page.mouse.wheel(0, 2500)45 page.wait_for_timeout(3000)46 ctx.close()47 48tweets = {t["id"]: t for payload in captured for t in walk(payload)}49with open("tweets.json", "w") as f:50 json.dump(list(tweets.values()), f, ensure_ascii=False, indent=2)51print(f"Saved {len(tweets)} unique tweets")Run it headed the first time and log in manually in the window it opens. After that, the profile directory retains the session. Five scrolls with pauses is intentionally slow, which also keeps the load on X low.
To scrape tweets from Twitter profiles rather than search, point page.goto at a profile URL such as x.com/username. Its UserTweets responses carry the same tweet objects, so walk() needs no changes. For a list of accounts, loop over handles inside one session, pause between them, and stop the run when X starts returning rate-limit errors.
Running several sessions in parallel means a separate profile directory and IP for each, since accounts that share an IP are linked.
Why X Accounts Get Locked When Scraping (and What Reduces False Flags)
Scraping tweets on a logged-in account works until X decides the account is automated. Locks and suspensions follow a short list of signals:
- IP address. Major platforms often flag datacenter, VPN and cloud addresses, and one IP shared by several accounts links all of them. An IP checker shows how an address is classified.
- Phone number. Accounts registered with VoIP numbers, or with none, tend to be checked harder.
- Location jumps. An account that logs in from a new country each session looks taken over.
- Browser. Headless Chromium, a fresh profile every run and a timezone that disagrees with the IP all read as automation, because detection systems cross-check fingerprint and network signals.
- Volume and pace. A new account pulling thousands of posts on day one, or scrolling at machine speed, trips rate limits and then reviews.
Never scrape on your main account
A locked research account costs a rebuild. A locked main account costs its followers, history and DMs. Keep collection on dedicated accounts that hold nothing of value.
A durable setup addresses each of those signals. Give each research account its own dedicated mobile proxy, a 1:1 carrier device whose IP sits behind carrier-grade NAT alongside ordinary subscribers and stays fixed until you rotate it. Keep one persistent browser profile per account with timezone and language matched to the IP. Register it with a real non-VoIP number from SMS verification rather than a VoIP line. Current prices for an X number:
X SMS number pricing
- One-time code (US number)
- from $0.20
- Rental (US number)
- from $1.25
- Dedicated monthly number
- from $16.99, multiple countries
Prices updated
None of this changes X's terms of service, which forbid automated access without consent, and a suspended account stays suspended.
Intended use
Scraping X is for legitimate work: brand monitoring, market research, academic study and public-interest data collection. It is not appropriate for fraud, credential abuse, engagement manipulation, or any activity that violates a target platform's Terms of Service.
Scrape X With Grok Bot: What x_search Does and Where VoidMob Fits
Grok Bot is xAI's agent product: Bots that work on a persistent cloud computer with a browser, files and a terminal, shared by all your Bots. Since xAI added X to Grok Bot in August 2026, it reads X two ways. Its X plugin works on the X account you connect, and its published capabilities are searching posts, reading timelines, pulling trends and managing bookmarks. On the API side, Grok models call x_search, which runs keyword, semantic and user searches and fetches threads.
Neither is a scraper. The plugin acts on the account you connect, and x_search is a metered search tool.
xAI bills x_search per item fetched rather than per call:
| Item | x_search (xAI) | X API |
|---|---|---|
| Posts | $5 per 1,000, parents and quotes included | $5 per 1,000 ($0.005 each) |
| User profiles | $10 per 1,000 | $10 per 1,000 ($0.010 each) |
For research without code, Grok is the most direct way to scrape tweets from X, and scraping X with Grok suits questions such as what a set of accounts posted this week, how a launch was received, or which threads are spreading. Costs rise at archive volume, results are limited to what the API exposes, and a model asked to output thousands of exact posts as free text can omit or fabricate rows. Ask for structured fields with each post's URL, and spot-check the links.
A reliable prompt pattern: search X for posts mentioning your brand from the last seven days, return post URL, author, timestamp, text and like count as CSV, and report how many posts were fetched. The count doubles as your cost check, since 1,000 fetched posts bill $5 before tokens.
When x_search is not enough: the scripted fallback. Grok Bot can also run code on its computer, including the Playwright scraper above. That route skips per-item pricing and reaches what the API leaves out, but it needs two things the Bot does not have by default. One is a logged-in X account. xAI's docs have the Bot hand CAPTCHA and two-factor steps to you, so the account stays yours. A consumer IP is the other, because the Bot's computer sits on cloud infrastructure, and an X login from a hosting address does not match your normal sessions.
VoidMob fills both through the VoidMob skill for Grok Bot. Store your API key as a Bot secret named VOIDMOB_API_KEY, then tell the Bot to read voidmob.com/skill.md and follow it. With the skill loaded, it can rent a US non-VoIP number when your X account asks for a sign-up or login code, read the code back, and leave you to finish the step. It can also buy a dedicated mobile IP in your country and route the script's session through it. The skill quotes the price first, and every purchase carries the price you approved. Clients that run MCP can use the VoidMob MCP server instead.
VoidMob covers the scripted fallback and the account's codes; x_search and Grok's built-in browser run on xAI's side. The skill also keeps the Bot to your own accounts, so Grok will not build or farm scraping accounts for you. Any multi-account setup like the one in the previous section is yours to run.
A dedicated mobile IP for your scraping sessions
One real 4G/5G carrier device per account, fixed until you rotate it, on a connection that reads as an ordinary subscriber line.
FAQ
Can you scrape X without the API?
Yes. Logged out, a browser can still load public profiles and single posts. Search, timelines and reply threads need a logged-in account, so most scraping without the API runs a real browser on a dedicated account and captures the JSON responses X's web app loads. It is cheaper per post than the API but breaks X's terms and risks the account.
Do you need an account to scrape Twitter?
For anything beyond public profiles and individual posts, yes. X puts search results, full timelines, follower lists and reply depth behind login. Use a dedicated research account rather than your main one, on its own consistent IP, registered with a real non-VoIP number.
Is scraping X legal in 2026?
Scraping public data is not automatically illegal in the US, but X's terms prohibit automated access without consent, and they set liquidated damages of $15,000 per 1,000,000 posts for accessing more than a million posts in 24 hours in violation of the terms, as of October 2026. Logged-in scraping adds account and contract risk, and personal data brings in privacy laws such as GDPR. This is not legal advice.
How much does the X API cost?
X's API is pay-per-use: $0.005 per post read and $0.010 per user read, billed per resource returned, with no recurring free tier for new developers, only starter credits. Reading 1,000 posts costs $5. Posting and other write actions are priced separately in X's developer console.
Can Grok Bot scrape X?
Grok Bot reads X through its X plugin on your connected account and through the x_search tool, which xAI bills at $5 per 1,000 posts fetched. That suits research and monitoring rather than bulk scraping. For data the API does not expose, Grok Bot can run a scraping script on its cloud computer, which then needs your logged-in account and a consumer IP.
Why does my X account get locked when scraping?
X locks accounts that look automated: logins from datacenter or VPN IPs, several accounts on one IP, VoIP or missing phone numbers, location jumps between sessions, headless browsers, and sudden high volume from a new account. Accounts that stay on one consistent IP, with a persistent browser profile and a real non-VoIP number, look far less automated.
The Account Is the Scraper Now
Twitter scraping in 2026 depends more on access than on code. The official API is clean and metered at $5 per 1,000 posts. Grok Bot and x_search make research on X quick at the same rates. Everything past that runs on logged-in accounts, and those last only when each one has its own consistent mobile IP, a real carrier number and a human pace. Pick the method by the data you need, and budget for the accounts as seriously as the code.
