WEIR

snscrape Not Working? twikit and twscrape Alternatives

Why snscrape stopped working for X in June 2023, where twikit and twscrape stand in 2026, and a snscrape alternative with code to port your search loop.


Published · Updated · 7 min read · 阅读中文版

Cover image: Your X scraper broke again

snscrape is not working because Twitter, now X, put its whole site behind a login wall in June 2023, and snscrape never logs in.

twikit and twscrape log in as a user instead, which keeps them running only until X changes its web app. This guide is for Python developers whose snscrape, twikit, twscrape or ntscraper script stopped. We run Weir, the API in the examples, so weigh that.

The replacement call needs no cookies, only a key:

curl https://api.weirapp.io/v1/x/search \
  -H "Authorization: Bearer $WEIR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "python", "sort": "latest", "limit": 20}'

Where each Python scraping library stands in November 2026

We checked PyPI and GitHub on 26 November 2026:

Library Last release State
snscrape 0.7.0, June 2023 Broken for X since 30 June 2023
twikit 2.3.3, Feb 2025 Open breakage reports, unmerged fixes
twscrape 0.21.1, Nov 2026 Maintained; users report suspensions
ntscraper 0.4.0, May 2025 Depends on Nitter, now archived

Only twscrape still ships fixes. ntscraper reads Nitter, whose repository is now archived. X Corp. sent Nitter cease-and-desist letters in August and September 2026, nitter.net says.

Why snscrape is not working for X

snscrape never signed in. It used a guest token, the pass Twitter gave logged-out visitors, and read what they could see.

Its issue tracker dates the rest:

  • August 2021: issue #270 rules out logins. snscrape "does not and will not support logging into social network accounts."
  • 30 June 2023: the maintainer opens #996, "All Twitter scrapes are failing: blocked (404)", and links it to "Twitter as a whole getting locked behind a login wall."
  • 2 July 2023: in the same thread, they repeat: "Auth will not be added."
  • Today: #996 is still open, and no release has shipped since June 2023.

So blocked (404) isn't your setup, and reinstalling won't fix it. snscrape asks X for search and timeline data that X no longer serves to logged-out visitors.

Why twikit is not working

twikit logs in as a normal X user and calls the internal GraphQL endpoints the x.com web app uses. So it needs no API key, and it breaks whenever X changes its web app.

The 2026 issue tracker shows the pattern:

  • March 2026: issue #408 reports every call failing with "Couldn't get KEY_BYTE indices".
  • April and May 2026: a SearchTimeline 404, then a KeyError as X's responses changed shape.
  • August 2026: search_tweet returns status 429 with an HTML error page.

Contributors opened pull requests for these, such as #419 and #432. None has been merged, and 2.3.3 is still the latest version on PyPI.

Is twscrape a good snscrape or twikit alternative?

For now, partly. twscrape shipped 0.21.1 on 23 November 2026, and its maintainer fixes breakages fast.

Its weak point is the accounts it runs on: two days earlier, users reported X suspending them, and no release undoes a suspension.

Its README says it "requires authorized X/Twitter accounts". It also says "X/Twitter's Terms of Service discourage using multiple accounts". Yet the library is built to rotate a pool of them.

Why X scrapers keep breaking

The causes are the same for all four libraries:

  1. They use internal endpoints. X can change a query id or a script at any time, and owes callers nothing.
  2. X needs a signed-in user for most reads. That alone ended snscrape.
  3. X detects automation. Cloudflare challenges and 429s are X's controls working, and we won't cover ways around them.
  4. X's terms forbid it. They say "you cannot scrape the Services without X's express written permission."

That last point is a risk you carry yourself. This is not legal advice. Our guide to scraping Twitter in 2026 compares what still works.

Durable snscrape alternatives for Python in 2026: the X API or a hosted API

Without your own accounts, you can use X's API or a hosted API run by a third party. Here is what 1,000 posts cost, as of October 2026:

Price to read 1,000 X posts
Official X API$5.00
Apify Tweet Scraper V2$0.40
SocialData$0.20
Weirabout $0.18
TwitterAPI.io$0.15
  • The official X API is the only one with X's permission, and it can post. See X API pricing in 2026.
  • TwitterAPI.io is cheaper per tweet than Weir and also writes.
  • SocialData has one flat price if you only need X.
  • Apify suits analysts who want a spreadsheet without code.
  • Weir is read-only. It fits if you want results in an AI assistant over MCP. Its Reddit data is temporarily unavailable.

Our comparison of Twitter API alternatives covers each in depth.

Port a snscrape or twikit loop to REST

Moving a script takes three changes:

  1. Get a keySign up for Weir and copy a key. No card, no cookies.
  2. Swap the callReplace get_items() or search_tweet with POST /v1/x/search.
  3. Page with the cursorSend meta.nextCursor back as cursor until it is null.

Here is the snscrape loop most tutorials taught. It has failed since June 2023:

import snscrape.modules.twitter as sntwitter

scraper = sntwitter.TwitterSearchScraper("python since:2023-01-01")
for i, tweet in enumerate(scraper.get_items()):
    if i >= 100:
        break
    print(tweet.id, tweet.user.username, tweet.likeCount, tweet.rawContent)

The same search on Weir needs only Python's standard library. Your old query string, operators included, goes in query as it is:

import json, os, urllib.request

URL = "https://api.weirapp.io/v1/x/search"
HEADERS = {"Authorization": "Bearer " + os.environ["WEIR_API_KEY"],
           "Content-Type": "application/json"}
body = {"query": "python since:2023-01-01"}
for _ in range(5):  # page cap: X serves about 20 posts a page
    req = urllib.request.Request(URL, json.dumps(body).encode(), HEADERS)
    page = json.load(urllib.request.urlopen(req, timeout=60))
    for post in page["data"]:
        print(post["id"], post["author"]["username"], post["likeCount"], post["text"])
    body["cursor"] = page["meta"]["nextCursor"]
    if not body["cursor"]:  # null is the only stop condition
        break

Five pages hold about as many posts as the snscrape cap. They cost about 105 credits.

  • Reposts come back. X search now returns them, so add -filter:nativeretweets to query for originals only.
  • Dates are whole days. Through Weir, since: and until: count whole UTC days; for an exact start time, use Weir's own since field.

Weir's default sort: "latest" matches snscrape's live mode and twikit's "Latest", and "top" matches "Top".

For an account's timeline, call GET /v1/x/users/XDevelopers/posts. It takes the username directly, so you skip twikit's lookup call. A trimmed item from a real call on 19 October 2026:

{
  "id": "2111172163776708859",
  "createdAt": "2026-10-16T19:07:22.000Z",
  "author": { "username": "XDevelopers", "followersCount": 698073 },
  "likeCount": 117,
  "retweetCount": 17,
  "viewCount": 12604
}

Most fields map one to one:

snscrape twikit Weir
tweet.id tweet.id id, a string
tweet.rawContent tweet.full_text text
tweet.date tweet.created_at createdAt, ISO 8601 UTC
tweet.user.username tweet.user.screen_name author.username
tweet.likeCount tweet.favorite_count likeCount
tweet.viewCount tweet.view_count viewCount, may be null
get_items() pages itself await tweets.next() meta.nextCursor sent as cursor

A null count means X didn't report it, not zero.

When not to use Weir

  • You post or reply. Weir is read-only; use the official X API.
  • You want the lowest price per tweet. TwitterAPI.io is cheaper on pay-as-you-go.
  • You need full-archive pages of 500. That is an official X API feature.
  • You only need a few posts, once. Search on x.com is free once you log in, and our search builder writes the query.

FAQ

Why is snscrape not working?

Twitter, now X, put its whole site behind a login wall on 30 June 2023, and snscrape only reads what logged-out visitors could see. Its maintainer has ruled out adding logins. Every Twitter scrape now ends in blocked (404).

What replaced snscrape for Twitter?

Nothing that works without logging in. twikit and twscrape reach X only through X accounts you supply. Without accounts, use the official X API or a hosted API that handles access for you.

Why is twikit not working in 2026?

X changed scripts and response shapes that twikit parses, starting in March 2026. Fixes exist as pull requests, but none has been merged or released. The latest version on PyPI is still 2.3.3, from February 2025.

How much does a hosted API cost compared with snscrape?

snscrape was free, but it returns nothing now. On Weir, a post costs a credit, plus a credit per call, and 5,000 free credits arrive every month. Paid packs start at $5; see pricing.

Sources