Best X (Twitter) Data API in 2026: Profiles, Posts and Reposts

Published · 5 min read

The best X (Twitter) data API for reading public accounts is the one that returns the exact follower count, the account's post totals, and recent posts with their views, likes and reposts, for any public handle, with one request and no developer-account review. On SocialLens (sociallens.dev), GET /v1/profile?platform=x&username=HANDLE returns the account as an integer-typed JSON object, the same shape you use for eight other networks. This guide defines what "best" means for this job, shows the real request and response, the honest cost, and the cases where the official X API is the better fit.

Two jobs an "X API" can mean

Most confusion around an X API comes from one tool being asked to do the other tool's job.

Acting as an account. Posting, reading your own impressions and audience, reading or sending DMs, pulling search and trends. That is X's official API, with the account's authorization and a paid developer tier. It is built for a product that acts as the logged-in user.

Reading public data about any account. How many followers an account has, how many posts it has made, how its recent posts performed. This works for any public handle with a key you generate yourself, and it is the job this page is about.

The one request

curl "https://api.sociallens.dev/v1/profile?platform=x&username=elonmusk" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

The response, from a read made on November 30, 2026:

{
  "exists": true,
  "username": "elonmusk",
  "platform": "x",
  "nickname": "Elon Musk",
  "verified": true,
  "private": false,
  "followers": 239430232,
  "is_exact": true,
  "following": 1429,
  "likes": null,
  "videos": 113191,
  "bio": "https://t.co/ZdBx5WABYx",
  "avatar": "https://pbs.twimg.com/profile_images/...",
  "id": "44196397",
  "created_at": "2009-06-02T20:12:29Z",
  "external_link": null,
  "category": null,
  "fetched_at": "2026-11-30T11:23:45Z"
}

What each field means on X

The schema is shared across the nine networks, so what matters is how X fills it.

A handle that does not exist returns HTTP 200 with exists: false, which keeps "the account is gone" separate from "the request failed". Only a successful read costs a credit; every error, including rate limits, is free.

Recent posts, a single post, and reposts

GET /v1/profile-posts?platform=x&username=HANDLE returns the recent posts, each with its metrics:

{
  "exists": true,
  "username": "elonmusk",
  "platform": "x",
  "count": 1,
  "has_more": false,
  "is_exact": true,
  "posts": [
    {
      "id": "2125797463047258119",
      "url": "https://x.com/elonmusk/status/2125797463047258119",
      "caption": "Every child in America will receive two SpaceX shares, one from the company and one from me personally",
      "published_at": "2026-11-26T03:43:05Z",
      "likes": 632286,
      "views": 38100018,
      "comments": 42356,
      "shares": 62143,
      "likes_hidden": false
    }
  ],
  "fetched_at": "2026-11-30T11:24:03Z"
}

On X, a post's shares is the repost (retweet) count, comments is the reply count, views is the public view count X shows under a post, and likes is the like total. GET /v1/post?platform=x&url=POST_URL reads a single post by URL and returns the same counters plus the author. GET /v1/post-comments?platform=x&url=POST_URL returns the public replies with their author and likes.

What it does not do

A public data API reads public data only. For X that means no keyword, hashtag or trend search, no timelines or home feed, no audience demographics, no view-through or dwell analytics, no DMs, no fraud or bot scoring, and nothing reserved for the account owner inside X's own analytics. It cannot post or act as an account. If a requirement depends on any of those, the path is X's official API with the account's authorization. Listing a capability the API does not have is the fastest way to lose trust, so the scope above is the whole of it.

Cost

X data tools price the same read in different ways. The honest way to choose is to match the model to how you actually read.

Tool Model Good fit
SocialLens (sociallens.dev) Pay as you go, 1 credit per successful read, credits do not expire, errors free Any public account, several networks, spiky or low volume
EnsembleData Subscription tiers by monthly unit allowance Steady high volume on a predictable monthly budget
Data365 Plans oriented to larger, continuous pulls Large continuous collection with onboarding

SocialLens starts a new account with 250 free reads and no card, enough to test X plus the other eight networks with your own handles before deciding. Packs are on the pricing page. For a direct comparison between public data APIs on price per read and billing shape, see Data365 and EnsembleData Alternatives, and check each vendor's own pricing, since rates change.

When to use something else

Frequently asked questions

What is the best X data API for reading other accounts?

For public accounts you do not own, a public data API that returns the exact integer and the recent posts. SocialLens returns followers as a full number with is_exact: true, the total post count, and the recent posts with views, likes and reposts, for any public handle, with no developer-account review.

Is the follower count exact?

Yes. The response carries the full integer in followers with is_exact: true.

Does the profile include a like total?

No. On X the profile-level likes field is null; X does not expose a profile like total to a public read. Per-post likes are in /v1/profile-posts and /v1/post.

Can I get views and reposts for a post?

Yes. /v1/profile-posts and /v1/post return each post's views, likes, comments (replies) and shares (reposts).

Do I need an X developer account?

No. You use one SocialLens key, sent as a Bearer token, for X and for the other eight networks. The X developer account and its paid tiers are only for the official API.

What does a read cost?

One credit per successful read on any endpoint. Error responses, including rate limits and not-found, are not charged. New accounts start with 250 free reads.

Last updated: 2026-11-30.

Run these requests yourself

Every example on this page is a real call to the SocialLens API. A new account starts with 250 free reads, no card needed, and a read that fails is never charged.

Keep reading