WEIR

Unofficial Twitter API in 2026: Libraries, Risks and Options

What an unofficial Twitter API really is, where twikit, twscrape and snscrape stand in November 2026, the risk to your X account, and a no-login call.


Published · Updated · 7 min read

Cover image: Cookies, credits or a key

An unofficial Twitter API reads Twitter data without X's own developer API, usually through the hidden endpoints that x.com's web app calls.

This guide is for you if you're choosing between a cookie-based library, X's paid API and a hosted API for X (Twitter) data. You get each route's state on 17 November 2026 and what it risks.

We run Weir, one hosted API, so weigh our view. This call needs only a key, no X login:

curl https://api.weirapp.io/v1/x/users/XDevelopers \
  -H "Authorization: Bearer $WEIR_API_KEY"

What does "unofficial Twitter API" mean?

You'll see the phrase used for three things that work very differently.

  • X's internal API. The x.com web app you use loads posts from GraphQL endpoints with names like SearchTimeline and UserByScreenName. X publishes no docs for them and changes their ids without notice.
  • Libraries that drive it. twikit and twscrape send the same requests while logged in as you, with your account's cookies. They're free and open source.
  • Hosted third-party APIs. A company keeps the access working and sells you a REST API with its own key. Weir is one, and our comparison of Twitter API alternatives puts it next to six others and X's own API.

The official route is X's own API, documented at docs.x.com. As of 17 November 2026, X's pricing page lists $0.005 per post read.

Unofficial Twitter API vs the official X API: what each route needs

Each route trades money against upkeep, and each one puts a different account at risk, not always yours.

Table comparing login libraries, the official X API, hosted read APIs and snscrape on needs, breakage and account risk
What each route needs, checked 17 November 2026

Only the official API is an interface X publishes. Libraries and unofficial hosted APIs both work outside it. For you, they differ in whose account does the reading and who fixes breakage.

Unofficial Twitter API libraries for Python on GitHub, November 2026

We checked PyPI and GitHub on 17 November 2026. Tweepy, the official API's client, is there so you can compare:

Library Latest release Logs in to X? State
twikit 2.3.3, 7 Feb 2025 Yes, your account No code change since April 2025
twscrape 0.21.0, 6 Nov 2026 Yes, an account pool Active, 12 open issues
snscrape 0.7.0, 22 Jun 2023 No Broken for X since June 2023
Tweepy 4.17.0, 2 Jul 2026 No, developer keys Maintained, official X API

None of the four repositories is archived, but twikit and snscrape have open reports that every call fails.

  • twikit calls itself "A Simple Twitter API Scraper". It has 135 open issues, and its last code change was merged on 22 April 2025.
  • twscrape says it "requires authorized X/Twitter accounts" and runs on "your own account pool".
  • snscrape never logged in. Its maintainer's issue #996, "All Twitter scrapes are failing", has stayed open since 30 June 2023.

Why unofficial Twitter API libraries keep breaking

They copy a private interface, and X changes it without telling you.

8twscrape releases in 2026
6of them updated GraphQL operation IDs
21 monthssince twikit's last release

Two kinds of change break your script most often:

  1. Operation ids. Each GraphQL call carries an id that X changes. When it does, your calls fail until the library ships new ids.
  2. Request signing. X's web app adds a transaction id built from its own scripts. Issue #408 reports every twikit call failing from 18 March 2026 with "Couldn't get KEY_BYTE indices".

twscrape's release notes show you how often that happens:

twscrape's eight 2026 releases with dates, six of them updating GraphQL operation IDs after X changes
twscrape release notes, May to November 2026

Keeping up is what keeps twscrape working, while twikit's March breakage is still open.

Is an unofficial Twitter API safe for your X account?

Not reliably. The account you log in with is the one X can lock or suspend.

  • twikit users report suspensions. Issue #359, "Account Suspension When Using Twikit Library on X (Twitter)", drew 25 comments from May to September 2025.
  • twscrape plans for it. Its 0.21.0 notes say a suspended account is now "marked inactive and the next account is used."
  • Its README warns you. It says "X/Twitter's Terms of Service discourage using multiple accounts."

A hosted API keeps your own X account out of it, but it doesn't make X's terms go away. We don't say whether your use is legal. Our guide on whether scraping Twitter is legal walks through the court cases.

How is a hosted Twitter API different?

A hosted API changes who holds the accounts, who fixes breakage, and how you pay.

Good

  • No X login or cookies: you send an API key
  • The provider ships the fix when X changes
  • Pay per result; on Weir, failed calls cost nothing

Watch out

  • It costs money, where a library is free
  • You depend on a third party that X has not licensed

On Weir, a call costs 1 credit plus 1 per post, or 2 per profile. You get 5,000 free credits every month, and $5 buys 25,000.

Our Twitter API alternative page lists what one key reaches on X.

Call a hosted Twitter API from Python, with no cookies

Here is a library's job done with your key. This script prints an account's newest original posts; swap in any public account:

import json, os, urllib.request

body = {"fromUsers": ["NASA"], "query": "-filter:nativeretweets",
        "onlyOriginal": True, "limit": 5}
req = urllib.request.Request(
    "https://api.weirapp.io/v1/x/search", json.dumps(body).encode(),
    {"Authorization": "Bearer " + os.environ["WEIR_API_KEY"],
     "Content-Type": "application/json"})
with urllib.request.urlopen(req, timeout=60) as res:
    page = json.load(res)
    print("credits charged:", res.headers["x-credits-charged"])
for post in page["data"]:
    print(post["createdAt"][:10], post["likeCount"], post["viewCount"],
          post["text"][:38].replace("\n", " "))
print("more pages:", page["meta"]["nextCursor"] is not None)

We ran it on 17 November 2026 at 21:22 UTC. It returned five original NASA posts, newest first, and charged 6 credits:

Terminal output of the Python script: five NASA posts with dates, likes, views and text, for 6 credits
Real run, 17 November 2026
  • Reposts are dropped by -filter:nativeretweets, since X search returns them by default. onlyOriginal drops replies.
  • Paging is a cursor. Send meta.nextCursor back as cursor, and stop when it's null.

The curl call at the top returned this profile, trimmed, for 3 credits:

{
  "data": {
    "id": "2244994945",
    "username": "XDevelopers",
    "followersCount": 696777,
    "createdAt": "2013-12-14T04:35:55.000Z",
    "protected": false
  }
}

Fields map almost one to one, so porting your code is mostly renaming:

Field twscrape twikit Weir
Post id id_str id id
Text rawContent full_text text
Posted at date created_at createdAt
Author user.username user.screen_name author.username
Likes likeCount favorite_count likeCount
Views viewCount view_count viewCount
Followers followersCount followers_count followersCount

Errors tell you more, too. A suspended account returns 404 with details.reason: "suspended", at no charge.

To move a whole script, see our twikit and twscrape alternatives guide.

When not to use Weir

  • You post, like or send DMs. Weir is read-only, so use the official X API through Tweepy or X's XDK.
  • You want to know who liked a post. X made likes private in June 2024, and no Weir endpoint lists them.
  • The data sits behind a login. Protected posts, DMs and bookmarks need the owner's account, and Weir reads public data only.
  • Only X's permission will do. Weir is not licensed by X, so access can change.

FAQ

What is an unofficial Twitter API?

It's any way you read X (Twitter) data outside X's developer API. Usually that means the GraphQL endpoints x.com's web app uses, called by a library with your login. Hosted APIs with their own key get the name too.

Is there an unofficial Twitter API for Python?

Yes, twikit and twscrape. As of 17 November 2026, twscrape is maintained at 0.21.0 and needs logged-in X accounts. twikit's newest release is still 2.3.3, from February 2025. snscrape no longer returns X data.

Can my X account get banned for using twikit or twscrape?

It can. Users report locks and suspensions in twikit's issue tracker, and twscrape's notes treat a suspended account as routine. Assume any account you log in with is at risk.

Is there an unofficial Twitter API on GitHub that works without login?

Not reliably. snscrape read X logged out, and its Twitter scrapes failed on 30 June 2023, when X walled off logged-out access. A hosted API needs no X login from you.

Sources

All checked on 17 November 2026: