Campaign reporting
Refresh public post metrics for the same URL set throughout a campaign.
X stats API
Views, likes, replies, retweets, quotes and bookmarks for a public post on X. Send a public URL and get the fields in the same terms the platform uses.
Input: Public X post URL. Returns: one object, in X's own field names. Price: 1 credit per call; failed reads are free.
GET /v1/x/stats
See it in action
The snippets use the production endpoint. Replace the sample URL with your own public target before running them.
Start from a valid shape, then replace the sample value with your public target.
Selected https://x.com/X/status/2093829017128374366
Open
Use a server-side key and send parameters as query values.
https://api.sourcevine.io/v1/x/stats curl -G 'https://api.sourcevine.io/v1/x/stats' \
-H 'Authorization: Bearer sv_live_...' \
--data-urlencode 'url=https://x.com/X/status/2093829017128374366' const params = new URLSearchParams({
"url": "https://x.com/X/status/2093829017128374366",
});
const res = await fetch('https://api.sourcevine.io/v1/x/stats?' + params, {
headers: { Authorization: 'Bearer sv_live_...' },
});
const body = await res.json();
console.log(body.data); import requests
r = requests.get(
"https://api.sourcevine.io/v1/x/stats",
params={"url": "https://x.com/X/status/2093829017128374366"},
headers={"Authorization": "Bearer sv_live_..."},
)
body = r.json()
print(body["data"]) Every success includes availability, a fetch timestamp and billing context.
Hit Show sample response to see the response.
A real X (Twitter) Post Stats API response, recorded against the public target above.
{
"data": {
"url": null,
"text": "RT @bot: Grok Bot now has improved support for X!\n\nWhen you connect your X profile, a developer account will be automatically created with…",
"likes": 0,
"views": 53858,
"cached": false,
"quotes": 0,
"replies": 0,
"tweetId": "2093829017128374366",
"retweets": 365,
"bookmarks": 0,
"fetchedAt": "2026-09-02T07:07:38Z",
"authorLink": "https://x.com/X",
"publishedAt": "Sat Aug 29 22:31:53 +0000 2026",
"authorHandle": "X",
"cacheAgeSeconds": null,
"sourceTimestamp": null
},
"success": true,
"available": true
} Ship it anywhere
We build and maintain theseFirst-party surfaces, versioned with the API.
Works anywhere that can make an HTTP requestNo plugin to install, and none to wait for.
Response
Each response includes typed availability, a fetch timestamp, and only the public fields this API promises.
| Field | Type | Meaning |
|---|---|---|
| url | string | Canonical public post URL. |
| tweetId | string | X post id. |
| text | string | null | Public post text after contact-detail scrubbing. |
| views | integer | null | Public view count when reported. |
| likes | integer | null | Public like count when available. |
| replies | integer | null | Public reply count. |
| retweets | integer | null | Public repost count. |
| bookmarks | integer | null | Public bookmark count when reported. |
| fetchedAt | ISO datetime | When Sourcevine read the public page. |
| sourceTimestamp | ISO datetime | null | The platform timestamp when it is available. |
| cached | boolean | True when this answer repeats an identical request made moments earlier. |
| cacheAgeSeconds | integer | Seconds since the reading was taken. |
| quotes | integer | |
| authorLink | string | |
| publishedAt | string | |
| authorHandle | string |
Request flow
Send a public X post URL. Sourcevine resolves ids, validates the resource type and returns a typed response.
A URL of the wrong kind or platform is refused with a 400 before any fetch, and not charged.
The public data is read when you call. An identical request moments earlier is answered again, free.
Deleted, private and unsupported resources return explicit statuses, so clients can stop retrying facts about the world.
X names stay intact, so your code reads fullName instead of reverse-engineering a generic schema.
fetchedAtcreditsChargedavailableEvery response carries fetchedAt and the platform timestamp, so you know how old a reading is before you act on it. X (Twitter) Post Stats API fits recurring stats checks in dashboards, spreadsheets, workflows and agents.
Boundaries
Bios, email addresses, phone numbers, postal addresses and messenger handles are outside the response contract.
Private accounts, restricted content and unavailable resources return typed availability instead of guessed data.
Stats APIs return public engagement counts. They do not return individual comments or commenter identities.
Use cases
Refresh public post metrics for the same URL set throughout a campaign.
Compare engagement fields in each platform’s own vocabulary.
Watch a public post cross a view, comment or save threshold.
Use typed availability and provenance to keep stale or private links out of reports.
Pricing
The response and X-Credits-Charged header tell you what
happened, including when it is zero.
Charged1 credit
Not charged0 credits
FAQ
Views, likes, replies, retweets, quotes and bookmarks for a public post on X.
A call costs 1 credit, including an empty result. Retrieval failures are not charged.
The request returns available=false with a typed availability status. Not-found and private results are charged like any lookup; unsupported URLs and retrieval failures are not.
No. Bios, emails, phone numbers, postal addresses and private or restricted content are outside the public response contract.
No. Your integration authenticates with a Sourcevine API key. You do not need to supply X credentials or a session.