Answers
How do I get a Twitter account's follower count without the official API?
Short answer
Send each handle to X account profile: it returns followers, following, total posts, bio, verification and avatar for $0.001 per account, with no X developer account. Ranking a list of 300 handles costs $0.30; refreshing it weekly for a quarter is $3.90.
You have a spreadsheet of 300 X handles, creators you might sponsor, and you want them sorted by followers before Monday's meeting. X account profile takes a handle, with or without the @, and returns the numbers on the profile page as clean fields. Old Stack Overflow answers suggest no-token tricks such as reading the profile page or a widget URL. Most of them stopped working once X locked down logged-out access, so expect them to fail.
Fields you get
| Field | Meaning |
|---|---|
followers |
follower count |
following |
accounts it follows |
posts |
total posts, replies and reposts included |
likes |
posts it has liked, when available |
verified |
blue or legacy verification |
bio, name, avatar_url, url |
profile basics |
With view=full you also get ext.created_at, ext.location, ext.media_count and ext.verified_type.
From a CSV of handles to a ranked list
import csv, os, requests
API = "https://api.okdata.online/v1"
H = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}
rows = []
for handle in [r[0] for r in csv.reader(open("handles.csv")) if r]:
body = requests.get(f"{API}/x/users/get", headers=H,
params={"username": handle, "view": "full"}, timeout=60).json()
if body["code"] != "ok":
rows.append([handle, body["code"]]) # not_found: renamed, suspended or never existed
continue
u = body["data"]["item"]
rows.append([u["username"], u["followers"], u["following"], u["posts"], u["verified"], u["ext"]["created_at"]])
found = sorted((r for r in rows if len(r) > 2), key=lambda r: r[1] or 0, reverse=True)
with open("ranked.csv", "w", newline="", encoding="utf-8") as f:
csv.writer(f).writerows(found + [r for r in rows if len(r) == 2])
Cost
| Job | Calls | Cost |
|---|---|---|
| One account | 1 | $0.001 |
| 300 accounts | 300 | $0.30 |
| 300 accounts weekly for 13 weeks | 3,900 | $3.90 |
A handle that does not exist returns not_found and is not charged.
Things to know
- The count is a snapshot. To show growth, store each run with its date; X does not offer follower history.
- Handles change. If a creator renames, the old handle returns
not_found, so keep the accountidfrom the first lookup as your stable key. - Follower lists (who follows whom) are not in the catalog, only the totals.
- Suspended accounts return
not_foundtoo, which is itself a useful flag when you vet creators.
Other ways
X's official API returns the same counts in a user's public metrics, at $0.010 per user read under pay-per-use. Pick it if you already have a developer account or need follower lists. For a handful of accounts, opening the profiles by hand is free. For creator shortlists across platforms, see the creator discovery guide.
Updated