Unofficial Twitter (X) API: Access Without a Developer Account

By Alex Chen•7 min read
Bar chart of six unofficial Twitter (X) libraries by the share of their GitHub issues that mention suspended, locked or banned: twscrape 11.8%, twikit 7.6%, twitter-api-client 5.3%, snscrape 5.2%, nitter 3.2%, Scweet 2.6%. twitter-api-client, snscrape and nitter are grey because they are archived or were last pushed in 2024 or earlier.
Six unofficial Twitter (X) libraries on GitHub: the share of issues that mention suspended, locked or banned, and when each was last pushed.
TL;DR
  • Three kinds: open-source libraries that log in as you (twikit, twscrape, Scweet), guest-access scrapers that X shut out in 2023 (snscrape, Nitter), and hosted APIs with their own key (TwitterAPI.io and others).
  • Our GitHub check of 6 libraries: 3 are archived or were last pushed in 2024 or earlier. Across 3,071 issues, 5.2% mention suspended, locked or banned; for twscrape it is 11.8% and for twikit 7.6%.
  • Cost for 10,000 posts plus 1,000 profiles: $1.68 on TwitterAPI.io, $60 on the official X pay-per-use rate card, $0 in fees for a library (plus the X accounts it logs in with and your upkeep).
  • No developer account either way: a hosted key comes from a Google sign-in; the official API answers 401 Unauthorized until you have an X developer app.

People search for an unofficial Twitter API for one of two reasons: the official X API wants a developer account, an app and a payment setup before the first request, or its pay-per-use price is too high for the volume they need. Both are fair reasons. The trouble is that "unofficial" covers very different things, from a weekend Python package that logs in with your personal account to a paid REST API with its own infrastructure.

This page sorts them into the three kinds that exist in 2026, shows what each one costs and what it puts at risk, and backs the comparison with a small study: we pulled the public GitHub state of six well-known unofficial libraries (stars, last push, archive flag and how many issues talk about suspended, locked or banned accounts). We also sent a request to the official API with no credentials and one to TwitterAPI.io with a key, and show both responses.

Unofficial libraries in our GitHub check that are archived or last pushed in 2024 or earlier

3 of 6 (Nitter archived; snscrape last push 2023; twitter-api-client 2024)

01 — Section

What counts as an unofficial Twitter API?

X's official route is its developer platform: you create a developer account and an app, get OAuth credentials, and pay per request under the pay-per-use model. We sent an unauthenticated request to https://api.x.com/2/users/by/username/XDevelopers and got HTTP 401 with the body {"title": "Unauthorized", "status": 401, "detail": "Unauthorized"}. Nothing is readable until the developer setup is done.

Everything else is unofficial, and it falls into three groups:

KindExamplesHow it reads dataWho holds the riskWhat you pay
Open-source library, logged intwikit, twscrape, ScweetCalls the internal endpoints of the x.com web app with the cookies of one or more X accounts you log in withYour X accountsNo fees; X accounts, your time to keep it working
Guest-access scrapersnscrape, NitterRead x.com without logging in; stopped working for X after X began requiring a login to view posts in 2023n/a, no longer usable for XNothing, but it no longer returns X data
Hosted API with its own keyTwitterAPI.io and other providersYou call a REST endpoint with an API key; the provider runs the collectionThe provider; your X account is not usedPer result or per plan

The official API is the only one of these that X itself runs. TwitterAPI.io is an independent service, not affiliated with X; it fits the third row.

02 — Section

Our check: 6 unofficial libraries on GitHub

To see how these libraries hold up, we read the public GitHub data of six well-known ones through the GitHub REST API: stars, last push, whether the repository is archived, the total number of issues, and how many issues mention "suspended", "locked" or "banned" (GitHub issue search, which matches the issue text).

LibraryStarsLast pushArchivedIssuesMention suspended / locked / banned
nitter14,4552026yes1,10335 (3.2%)
snscrape5,4702023no98251 (5.2%)
twikit4,7852026no31424 (7.6%)
twscrape2,9762026no27132 (11.8%)
twitter-api-client1,9002024no24513 (5.3%)
Scweet1,6652026no1564 (2.6%)

Three findings stand out. First, half of the list is archived or has had no push since 2024: Nitter's repository is archived, snscrape has had no push since 2023, and twitter-api-client was last pushed in 2024. Second, the actively maintained ones are the ones that log in: twikit, twscrape and Scweet each describe signing in with X accounts, and the two largest of them have the highest share of issues about suspended, locked or banned accounts (11.8% for twscrape, 7.6% for twikit). Third, across all six repositories, 159 of 3,071 issues (5.2%) mention one of those words.

Read the percentages as a signal, not a ban rate. A keyword match also catches issues that are about something else, and people who never had a problem do not open issues. What the numbers do show is that account trouble is a recurring topic for logged-in libraries, which matches how they work: every request is made as one of your X accounts.

How we collected this: GitHub REST API (/repos/{owner}/{repo}) for the repository fields and GitHub issue search (repo:{owner}/{repo} is:issue (suspended OR locked OR banned), and is:issue for the total) for the counts, run in 2026. The script and the raw output are in data/studies/unofficial-twitter-api/ in our site repository.

03 — Section

What does each route cost?

Take a job that reads 10,000 posts and 1,000 user profiles in a month:

Route10,000 posts1,000 profilesTotalAlso needed
TwitterAPI.io (hosted key)$1.50$0.18$1.68A Google sign-in; no X account
Official X API, pay-per-use$50.00$10.00$60.00Developer account, app, OAuth credentials
Open-source library$0 in fees$0 in fees$0 in feesX accounts to log in with, your time when the web app changes

The TwitterAPI.io figures use our rates of $0.15 per 1,000 posts and $0.18 per 1,000 profiles, billed per result returned, with a 15-credit ($0.00015) minimum for a request that returns nothing. The official figures use the docs.x.com pay-per-use rate card: $0.005 per post read and $0.010 per user read. At these rates the official route costs about 33 times more per post.

The library row is not free in practice. It needs X accounts that you are willing to put at risk, and when x.com changes its internal endpoints the library stops working until a maintainer ships a fix; the open issue lists above show how often that happens.

04 — Section

One request with a hosted key

This is the whole setup for the hosted route: sign in with Google on twitterapi.io, copy the API key from the dashboard, and send it in the X-API-Key header. New accounts that pass the automatic bot check get up to $1 of free credits (up to 100,000 credits, no card, one per person or network, expiring after 31 days).

We sent GET https://api.twitterapi.io/twitter/user/info?userName=XDevelopers with a key. The response came back with "status": "success" and a data object; these are a few of its fields as returned:

FieldValue
userNameXDevelopers
nameDevelopers
followers696,555
following770
statusesCount4,383
isBlueVerifiedtrue

The same key works for search (/twitter/tweet/advanced_search), timelines, followers and replies. The runnable example below reads a profile and one page of search results.

05 — Section

Which route should you use?

Use an open-source library for a personal experiment on a throwaway X account, when you accept that the account may be locked and that the code may break without notice. Pin the version and watch the repository's issues.

Use the official X API when you need X's own platform: posting from your app's identity under X's developer terms, enterprise agreements, or a requirement that the data come from X directly. Budget for the pay-per-use rates above.

Use a hosted API key when you need X data in production without putting your own X account behind every request, and you want per-result pricing. TwitterAPI.io is one such service; compare providers on price per 1,000 results, rate limits and which endpoints they cover.

Whether a particular use is allowed depends on X's terms and your jurisdiction. Our guide to scraping X without the official API covers that question in more detail.

python
import os
import requests

BASE = "https://api.twitterapi.io"
H = {"X-API-Key": os.environ["TWITTERAPI_IO_API_KEY"]}  # from the twitterapi.io dashboard

# 1) One profile: 18 credits ($0.00018)
r = requests.get(f"{BASE}/twitter/user/info", headers=H, params={"userName": "XDevelopers"}, timeout=30)
r.raise_for_status()
u = r.json()["data"]
print(u["userName"], u["followers"], "followers")

# 2) One page of search results: 15 credits per post returned ($0.15 per 1,000)
r = requests.get(f"{BASE}/twitter/tweet/advanced_search", headers=H, timeout=30,
                 params={"query": "from:XDevelopers -is:retweet", "queryType": "Latest"})
r.raise_for_status()
body = r.json()
for t in body.get("tweets", [])[:5]:
    print(t["createdAt"], t["likeCount"], t["text"][:80].replace("\n", " "))
print("next page:", body.get("has_next_page"), body.get("next_cursor", "")[:20])

Researching this?Free starter credits cover end-to-end testing — Google sign-in, no card. Get a key.

06 — Questions

Questions readers ask

Is there an unofficial Twitter API?

Yes, several kinds. Open-source libraries such as twikit and twscrape read X through the x.com web app's internal endpoints while logged in with your X accounts. Hosted APIs such as TwitterAPI.io give you an API key and a REST endpoint without using your X account. Older guest-access scrapers such as snscrape and Nitter no longer work for X since it began requiring a login to view posts in 2023.

Can I use the Twitter API without a developer account?

Not the official one: an unauthenticated request to the official API returns 401 Unauthorized until you have a developer account and app. A hosted API such as TwitterAPI.io needs only a Google sign-in and an API key, and new accounts that pass the automatic bot check get up to $1 of free credits (up to 100,000 credits, no card, one per person or network, expiring after 31 days).

Can my X account get suspended for using an unofficial library?

It can. Libraries such as twikit and twscrape send every request as an X account you log in with, so any enforcement applies to that account. In our check of six libraries, 11.8% of twscrape's GitHub issues and 7.6% of twikit's mention suspended, locked or banned. A hosted API key does not involve your X account.

Is snscrape still working?

Not for X. snscrape read X without logging in, which stopped working after X began requiring a login to view posts in 2023, and the repository has had no push since 2023. Nitter, the alternative front end, is archived on GitHub.

How much does an unofficial Twitter API cost?

Open-source libraries charge nothing but need X accounts and upkeep. TwitterAPI.io charges per result: $0.15 per 1,000 posts and $0.18 per 1,000 profiles. For comparison, the official X API's pay-per-use rate card lists $0.005 per post read and $0.010 per user read, so 10,000 posts plus 1,000 profiles is $1.68 on TwitterAPI.io and $60 on the official API.

07 — Further reading

Continue

Sources & further reading
More from this series

Writing about something you built with TwitterAPI.io? Our community rewards program pays API credits for honest tutorials, build logs and videos.

Build it

Stop reading. Start building.

Starter credits cover real testing on real data. Google sign-in, no card, no application queue.

Get an API key

Already building with TwitterAPI.io? Publish an honest tutorial or build log about it and earn up to $200 a month in API credits.