X (Twitter) Follower Count API: Exact Counts, Following and Post Totals
To get the follower count of an X (Twitter) account through an API, call GET /v1/profile?platform=x&username=HANDLE on SocialLens. The followers field returns the exact count as an integer, for example 92,143,654 for @NASA, together with the following count, the total number of posts and the account creation date. You do not need an X developer account for it. This guide walks through the response, the recent posts endpoint, how it compares with the official X API, and code you can run.
The short answer
curl "https://api.sociallens.dev/v1/profile?platform=x&username=nasa" \
-H "Authorization: Bearer sk_live_YOUR_KEY"
Response read on November 22, 2026, complete:
{
"exists": true,
"username": "NASA",
"platform": "x",
"nickname": "NASA",
"verified": true,
"private": false,
"followers": 92143654,
"followers_rounded": 92143654,
"is_exact": true,
"following": 115,
"likes": null,
"videos": 74572,
"bio": "Making the seemingly impossible, possible. ✨",
"avatar": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg",
"id": "11348282",
"created_at": "2007-12-19T20:20:32Z",
"external_link": "http://www.nasa.gov/",
"category": null,
"fetched_at": "2026-11-22T23:53:14Z",
"cached": false,
"source_cached": false,
"credits": {
"source": "free",
"charged": 1,
"balance": 0,
"free_reads_total": 250,
"free_reads_left": 245
}
}
The value for platform is x. The handle can be sent with or without the @, in any letter case, and the response returns it with the capitalization the account uses.
What each field means on X
The response schema is the same for every network SocialLens reads, so a few names need a translation for X.
followersis the exact follower count. X exposes the full number, sois_exactistrueandfollowers_roundedis equal tofollowers.followingis how many accounts the profile follows, 115 in the example.videosis the total number of posts the account has published, 74,572 here. The field name is shared across networks and holds each network's publication count. On X that is posts of any kind, including replies and reposts.likesisnull. X does not publish a count of likes received by an account. The profile does carry a count of likes the account has given, which is a different thing, and the API does not present it as if it were engagement received.verifiedreflects the verification badge.idis the numeric account ID. It stays the same when the account changes its handle, which makes it the right key for a database.created_atis the account creation time in UTC.external_linkis the website in the profile, expanded to its real destination, not the shortened link.
Three numbers you can derive from one read
A single profile read is enough for a few signals that people usually compute by hand.
Follower to following ratio. 92,143,654 followers against 115 following. Accounts with a very high ratio are broadcasters. Accounts near 1 to 1 with large numbers on both sides are often follow back networks.
Account age. created_at gives the exact creation date. The account in the example was created on December 19, 2007.
Posting pace over the account's life. Total posts divided by days of existence. From December 19, 2007 to November 22, 2026 there are 6,913 days, and 74,572 posts in that time is about 10.8 posts per day.
from datetime import datetime, timezone
def posting_pace(profile):
created = datetime.strptime(profile["created_at"], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc)
read_at = datetime.strptime(profile["fetched_at"], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc)
days = (read_at - created).days
return {
"account_age_days": days,
"posts_per_day": round(profile["videos"] / days, 2),
"followers_per_following": round(profile["followers"] / max(profile["following"], 1)),
}
For the response above this returns 6,913 days, 10.79 posts per day and a ratio of 801,249.
Recent posts with views, likes and reposts
/v1/profile-posts returns the most recent posts of an account, each with its own counters.
curl "https://api.sociallens.dev/v1/profile-posts?platform=x&username=nasa&limit=2" \
-H "Authorization: Bearer sk_live_YOUR_KEY"
{
"exists": true,
"username": "nasa",
"platform": "x",
"private": false,
"count": 2,
"has_more": false,
"next_cursor": null,
"is_exact": true,
"posts": [
{
"id": "2124268568061661622",
"url": "https://x.com/NASA/status/2124268568061661622",
"caption": "RT @Space_Station: A @SpaceX Dragon splashed down in the Pacific Ocean off the coast of California ...",
"published_at": "2026-11-21T22:27:48Z",
"likes": 0,
"views": 48945,
"comments": 0,
"shares": 182,
"likes_hidden": false
},
{
"id": "2124195400966164674",
"url": "https://x.com/NASA/status/2124195400966164674",
"caption": "RT @SpaceX: Dragon is on track to reenter Earth’s atmosphere and splash down off the southern coast of California ...",
"published_at": "2026-11-21T17:37:03Z",
"likes": 0,
"views": 45545,
"comments": 0,
"shares": 500,
"likes_hidden": false
}
],
"fetched_at": "2026-11-22T23:53:46Z"
}
How the post fields map on X:
captionis the text of the post.viewsis the view count X shows under the post.likesis the like count,commentsis the reply count andsharesis the repost count.urlis the canonical link to the post andidis the post ID.
The sample shows something worth knowing before you compute averages. Both posts are reposts (the text starts with RT @), and both have likes: 0. On a repost, likes and replies belong to the original post, not to the account that reposted it. If you calculate an engagement rate for an account, filter out the items whose caption starts with RT @, or you will pull the average down with zeros that are not really zeros.
One call returns one page from X, about 20 posts, and costs one credit regardless of how many posts are in it. limit trims the page, it does not fetch more.
One post by URL
When you already have the link to a post, /v1/post reads it directly. URLs on x.com and twitter.com are both accepted.
curl -G "https://api.sociallens.dev/v1/post" \
--data-urlencode "platform=x" \
--data-urlencode "url=https://x.com/NASA/status/2123798314843787300" \
-H "Authorization: Bearer sk_live_YOUR_KEY"
Response read on November 22, 2026, with the credits block left out:
{
"exists": true,
"id": "2123798314843787300",
"url": "https://x.com/NASA/status/2123798314843787300",
"platform": "x",
"author": { "username": "NASA", "name": "NASA", "verified": true },
"caption": "We 💛 V-G-R\n\nOn the evening before Voyager 1 reached its one light-day distance from Earth, people all over the globe came together to celebrate humanity’s farthest reach into the universe. Learn more about this historic milestone: https://t.co/PYspGV59lY https://t.co/hxEdd4K411",
"published_at": "2026-11-20T15:19:11Z",
"likes": 4491,
"views": 734253,
"comments": 225,
"shares": 855,
"is_exact": true,
"likes_hidden": false,
"fetched_at": "2026-11-23T00:35:09Z",
"cached": false,
"source_cached": false
}
The counters are the ones the list returns: views, likes, replies in comments and reposts in shares. The author object adds the handle, the display name and the verification badge of whoever published the post, which matters when the URL came from a user and you do not know the account in advance. One read is one credit, and reading the same post again later gives you how much it grew between the two moments.
Tracking follower growth on X
X shows the current follower count and no history, so a growth chart comes from your own readings. Read the profile once a day at a fixed hour and store id, followers, videos and fetched_at. Because the count is exact, a gain of a few dozen followers in a day is visible, which it would not be on the rounded figure the profile page displays for large accounts. The change in videos between two readings also tells you how many posts the account published in that period, so one table gives you audience growth and posting activity together. A complete tracker with SQLite and a scheduled job is in How to Track TikTok Follower Growth Programmatically, and it works for X by changing platform.
What people build with these numbers
- Qualifying leads and partners. Before outreach, check the audience size, the age of the account and how active it is. One read answers all three.
- Vetting creators. Apply thresholds on the exact follower count, look at the follower to following ratio, and compute engagement on original posts with reposts filtered out.
- Spotting accounts that deserve a closer look. A very recent
created_atnext to a very large follower count, or thousands of posts per day of existence, are signals to review by hand. They are not proof of anything on their own. - Keeping a CRM clean. Handles go stale. A scheduled read that returns
exists: falseflags the record, andidlets you confirm an account is the same one after a rename. - Cross network dashboards. The same request returns the same fields for the other networks a brand uses, so X becomes one more row and not a separate integration.
The official X API or a public data API?
They are built for different jobs, and many teams use both.
The official X API is the only way to act as an account: publish posts, send direct messages, read your own mentions, manage lists, consume filtered streams. It requires a developer account and an app, and it uses pay per usage pricing with credits bought in advance. As of November 2026 the X API pricing page lists a user read at $0.010 per resource and a post read at $0.005 per resource. Check that page for current rates, since they have changed more than once.
A public data API reads what a profile shows to any visitor. It cannot post or read anything private, and it does not need the account to authorize anything.
| Need | Official X API | SocialLens |
|---|---|---|
| Publish, reply, send messages | Yes | No |
| Read private or owner only data | Yes, with user authorization | No |
| Follower count of any public account | Yes, billed per user read | Yes, one credit per read |
| Recent public posts with counters | Yes, billed per post read | Yes, one credit per page |
| Same request for TikTok, Instagram, YouTube and others | No | Yes |
| Setup | Developer account, app, credits | One API key |
If your product is an X client or a bot, you need the official API. If you need public profile numbers from X as one of several networks, a single schema saves you from writing and maintaining a second integration.
For research use after the end of free academic access, the limits of this route and a methods paragraph are in Social Media Data for Academic Research After CrowdTangle and the X API Paywall.
Read a list of X accounts in Python
A complete script. It reads each handle, prints the main numbers and the derived signals from the section above.
import os
import time
from datetime import datetime, timezone
import requests
API = "https://api.sociallens.dev/v1/profile"
KEY = os.environ["SOCIALLENS_KEY"]
HANDLES = ["nasa", "github"]
def read_x(handle):
for _ in range(3):
r = requests.get(
API,
params={"platform": "x", "username": handle.lstrip("@")},
headers={"Authorization": f"Bearer {KEY}"},
timeout=60,
)
if r.status_code in (409, 429, 503):
time.sleep(int(r.headers.get("Retry-After", 5)))
continue
break
return r.status_code, r.json()
def parse_utc(value):
return datetime.strptime(value, "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc)
for handle in HANDLES:
status, p = read_x(handle)
if status != 200:
print(f"{handle}: {status} {p.get('error')}")
continue
if not p["exists"]:
print(f"{handle}: not found")
continue
days = (parse_utc(p["fetched_at"]) - parse_utc(p["created_at"])).days
print(
f"@{p['username']}: {p['followers']:,} followers, "
f"{p['following']:,} following, {p['videos']:,} posts, "
f"{p['videos'] / days:.2f} posts per day over {days:,} days"
)
The calls run in sequence. Reads for the same API account are processed one at a time, so sending them in parallel does not help and can return 409 account_busy. The limit is 60 requests per minute per key.
The same read in JavaScript
const res = await fetch(
"https://api.sociallens.dev/v1/profile?platform=x&username=nasa",
{ headers: { Authorization: `Bearer ${process.env.SOCIALLENS_KEY}` } }
);
const p = await res.json();
if (!res.ok) {
throw new Error(`${res.status} ${p.error}: ${p.message}`);
}
console.log(p.exists ? `${p.username}: ${p.followers} followers` : "not found");
Save it as x.mjs and run it with Node 18 or newer.
Accounts that do not exist, and errors
A handle that is not found answers with HTTP 200 and a short body:
{
"exists": false,
"username": "a_handle_that_is_not_there",
"platform": "x"
}
That is a definitive answer and counts as a successful read. Real failures use status codes and are never charged: 400 for a bad parameter, 401 for a bad key, 402 when the balance is used up, 429 with a Retry-After header when you pass the rate limit, and 503 with Retry-After when X could not be read at that moment.
One input note: the value of platform is x. twitter is accepted as an alias, and the response always reports x.
Frequently asked questions
Is there a free API for X follower counts?
The official X API is pay per usage. SocialLens gives every new account 250 free reads with no card, and each profile read uses one. For a single lookup by hand there is also the free X follower count tool in the browser.
Is the follower count exact?
Yes. X exposes the full number and the API returns it as an integer with is_exact: true.
Can I get the list of followers of an X account?
No. The API returns the follower count, not the list. Follower lists are available for TikTok only.
Does the profile include likes?
No. X does not publish a total of likes received by an account, so likes is null on the profile. Each post in /v1/profile-posts has its own likes.
How many posts does one request return?
One page, about 20 of the most recent posts, for one credit. Each post comes with views, likes, replies and reposts.
Can I read a single post by its URL?
Yes. /v1/post?platform=x&url=POST_URL returns the views, likes, replies and reposts of one post, with its author and text. URLs on x.com and twitter.com are both accepted.
Can I use the same code for other networks?
Yes. The request and the followers field are the same for TikTok, Instagram, YouTube, Facebook, LinkedIn, Threads and Pinterest. See Follower Count API for what each network returns, and Unified Social Media Data API for the full schema.