Twitter / X Data API

Get Twitter / X data with one API

Twitter / X Data API returns live Twitter / X Data data as clean JSON for twitter / x data The primary endpoint, profile, returns user data including user id, name, username, description and followers.

T
/twitter/v1

14 active endpoints. Every call is 1 credit.

  • POST/twitter/v1/profile
  • POST/twitter/v1/user_by_id
  • POST/twitter/v1/user_tweets
  • POST/twitter/v1/user_replies
  • POST/twitter/v1/user_media
  • POST/twitter/v1/user_likes
  • POST/twitter/v1/tweet
  • +7 more

What Twitter / X Data endpoints does ReefAPI ship?

14 live read endpoints. Read-only data API: no writes, no account actions, no dashboard access on the target site.

14 endpoints

profile

1 cr

User profile by @username.

required
username
optional

user_by_id

1 cr

User profile by numeric user_id (same fields as profile).

required
user_id
optional

user_tweets

1 cr

A user's tweets.

required
username
optional
user_id, limit, cursor

user_replies

1 cr

A user's tweets AND replies (timeline incl.

required
username
optional
user_id, limit, cursor

user_media

1 cr

A user's media tweets.

required
username
optional
user_id, limit, cursor

user_likes

1 cr

Tweets a user has liked (if the account exposes likes).

required
username
optional
user_id, limit, cursor

tweet

1 cr

A single tweet by id.

required
tweet_id
optional

tweet_replies

1 cr

A tweet PLUS its replies/comments (threaded conversation) with DEEP cursor pagination.

required
tweet_id
optional
limit, cursor

search

1 cr

Search tweets or people.

required
query
optional
product, limit, cursor

followers

1 cr

A user's followers (each a full user object), paginated.

required
username
optional
user_id, limit, cursor

following

1 cr

Accounts a user follows (each a full user object), paginated.

required
username
optional
user_id, limit, cursor

list_tweets

1 cr

Latest tweets from a Twitter List by id, paginated.

required
list_id
optional
limit, cursor

trends

1 cr

Current trending topics on X / Twitter (the Explore feed).

required
optional
limit

community_search

1 cr

Search posts across X Communities by keyword.

required
query
optional
product, limit, cursor

Every parameter, every allowed value →

Twitter / X Data API

3 of 14 endpoints, ready to run

View docs ↗

User profile by @username.

1 credit1 required · 0 optional
POST/twitter/v1/profile
idle
// Press "Try it" and this pane shows exactly what the
// live site returned this second — including an empty
// result, if that is the truth. No key, no account.

How the Twitter / X Data API works

Twitter / X Data is a normal ReefAPI surface — the same four rules that hold for every other engine on the key.

01
Authenticate
x-api-key header

No OAuth app, no request signing, no per-site account. One key covers all 185 engines.

02
Call
POST /twitter/v1/…

Every route is a POST with a JSON body. Parameters are validated against the published schema before anything is charged.

03
Pay
1 credit per call

Credits, not seats. Failed and blocked calls are never charged, and cache hits cost nothing.

04
Read
{ ok, data, meta, error }

One envelope everywhere. meta carries latency_ms, record_count and the endpoint that answered.

Field types that are not what you would guess

Most of the confusion on this API is not about missing data, it is about types. Ids are strings that look like numbers, one engagement counter is a string while the four beside it are integers, and created_at is not ISO 8601. Everything below came out of measured responses on @NASA and on a live Latest search.

FieldType and formatMeasured value
tweet_id, user_id, list_id, conversation_idString, always. Never parse them as numbers."2092721435663798658" and "11348282"
created_at (on a tweet)Twitter's own format, EEE MMM dd HH:mm:ss +0000 yyyy, always UTC."Wed Aug 26 21:10:45 +0000 2026"
likes, retweets, replies, quotes, bookmarksIntegers.381, 47, 18, 7, 17
viewsString, not an integer. Cast it yourself."155736"
verified vs verified_typeverified is a boolean; verified_type names the badge and is null for a plain paid check.@NASA: true plus "Government". Another account on the same page: true plus null
urls[]Already expanded. text still holds the t.co shortlink.text carried a t.co link while urls[] held https://www.youtube.com/watch?v=tGjffGccQig
created_at and protected (on a user)Both came back null on every profile measured, via profile, user_by_id, search product=People and the embedded author object alike."created_at": null, "protected": null
search product=PeopleReturns users[] instead of tweets[]. The other three products return tweets[].data keys were query, product, users, count, next_cursor
An unknown handleNOT_FOUND, not an empty result.profile on a made-up handle returned NOT_FOUND with retryable false

Every media[] entry carries url, which is the poster frame. A video entry adds video_url and duration_ms; a photo entry has neither. A measured video came back with duration_ms 28361 and an mp4 under video.twimg.com.

What people build with Twitter / X Data

The jobs this data is most often used for.

14

endpoints

1

credit per call

01

Social-listening tools use Twitter / X Data to get user profile by @username.

02

Creator and influencer platforms use Twitter / X Data to get user profile by numeric user_id (same fields as profile)..

03

Brand-monitoring teams use Twitter / X Data to get a user's tweets.

04

Audience analysts use Twitter / X Data to get a user's tweets AND replies (timeline incl.

What Twitter / X Data data costs

The cheapest call here is 1 credit, so $15/mo (Pro) buys 10,000 of them — $1.50 per 1,000 credits. Credits roll over and never expire, and failed or blocked calls are not charged.

Full pricing →
$0.67–$1.50 / 1,000 credits
  • 1,000 free credits on signup, no card
  • One key, all 185 APIs, one credit pool
  • Failed and blocked calls are never charged
  • Credits roll over and never expire

Call it in two lines

Sign up, get 1,000 credits and one key that works on every engine. Then this is the whole protocol.

curl
curl -X POST https://api.reefapi.com/twitter/v1/profile \
  -H "x-api-key: $REEF_KEY" \
  -H "content-type: application/json" \
  -d '{}'
python
import requests

r = requests.post(
    "https://api.reefapi.com/twitter/v1/profile",
    headers={"x-api-key": REEF_KEY},
    json={},
)
print(r.json()["data"])
FAQ

Have a question? We got answers.

The questions people actually ask before wiring up Twitter / X Data.

Get a free key →
Why is tweet_id a string, and what breaks if I turn it into a number?

Because snowflake ids passed JavaScript's safe integer range years ago. A measured tweet id, 2092721435663798658, is larger than 2^53, so JSON.parse turns it into 2092721435663798784: off by 126, and pointing at nothing. The same applies to user_id and conversation_id. Keep them as strings end to end, in your database column, in your own JSON and in any URL you build. Every id this API returns is already a string for exactly this reason.

Why is views a string when likes is a number?

That is how X's own payload ships it, and we pass the type through rather than quietly coercing it. A measured tweet returned likes 381 as an integer alongside views "155736" as a string. Cast views before you sum or sort on it, otherwise a language that compares strings lexically will tell you "9" beats "155736". Views can also be absent entirely on very old tweets, so guard for that as well.

A retweet's text is cut off at 140 characters. Where is the full text?

In retweeted{}. When a row is a retweet it carries is_retweet true and a nested retweeted object holding the original tweet, and it is the outer text that is truncated with an ellipsis, not the inner one. A measured @NASA retweet had text ending "...long exposure star trails from t" while retweeted.text held the whole 408-character original along with its own author, media and counts. Read the outer row for who retweeted and when, and the inner one for what was actually said.

The retweet shows 0 likes. Is that right?

Yes, and it is the correct reading. Engagement lands on the original tweet, not on the retweet row. A measured retweet came back with likes 0, replies 0 and quotes 0 but retweets 120, while retweeted.likes was 788 and retweeted.retweets was also 120. So the retweet count mirrors and everything else sits at zero. If you are scoring a timeline, take engagement from retweeted{} on retweet rows or you will systematically undercount an account that retweets a lot.

How do I parse created_at?

It is Twitter's legacy format, not ISO 8601: "Wed Aug 26 21:10:45 +0000 2026". In Python that is strptime with "%a %b %d %H:%M:%S %z %Y"; in Go the layout is "Mon Jan 02 15:04:05 -0700 2006". It is always +0000, so you can treat it as UTC. Note that created_at on the user object is a different thing entirely (account creation date) and came back null on every profile measured, so do not use it to age an account.

How do I tell a real verified account from a paid checkmark?

Read verified_type, not verified. Measured on one search page: @NASA came back verified true with verified_type "Government", while an ordinary account on the same page came back verified true with verified_type null. verified alone is now true for anyone paying, so verified_type is what carries the distinction. The values observed are "Government", "Business" and null.

How do replies come back, and can I read one without a second call?

Usually yes. tweet_replies returns the focal tweet first and then the replies in the same tweets[] array, so index 0 is the parent. On timeline and search rows a reply carries reply_to_tweet_id and reply_to_user, and where the conversation was already in the response it also carries reply_to_text and reply_to_author. A measured search row included the parent's text inline, so the reply was interpretable without another fetch. reply_to_tweet_id is null on an original tweet.

Do the counts drift between two calls on the same tweet?

Yes, and that is the live site moving rather than an inconsistency. The same tweet read three times inside a minute returned views "153649", "155736" and "155557", with likes 379, 381 and 382. The author object embedded in each row carries a follower count snapshotted at that moment too, so @NASA showed 92354072 and 92366117 seconds apart. If you need a stable number, timestamp your own read rather than expecting the source to hold still.

What is the Twitter / X Data API?

Twitter / X Data API is a ReefAPI endpoint group for twitter / x data It returns live JSON through POST requests under /twitter/v1.

Is the Twitter / X Data API free to try?

Yes. ReefAPI starts with 1,000 free credits, no card required. Twitter / X Data calls use the same shared credit balance as every other ReefAPI engine.

Do I need a Twitter / X Data login or account?

No login to Twitter / X Data is needed for the API response. You call ReefAPI with your x-api-key header, and the playground can run live examples before you create a production key.

How fresh is the Twitter / X Data data?

The page example is captured from a live profile call, and production requests fetch live data through ReefAPI rather than a static sample.

How many credits does the Twitter / X Data API use?

Twitter / X Data actions currently cost 1 credit per successful call. Failed or blocked calls are free, and all APIs draw from one credit pool.

Can I call Twitter / X Data from an AI assistant or MCP client?

Yes. Connect ReefAPI once through MCP and your assistant can call twitter actions with the same key, credit pool and JSON envelope used by normal REST requests.

15 More APIs APIs on the same key

One key, one credit pool, one response envelope. If you are pulling Twitter / X Data, you are one call away from the rest of the category — no second contract, no second integration.

Try it on your own data before you pay anything

The call above is the real endpoint, not a recording. A free key gives you 1,000 credits, the other 184 APIs, and the same envelope everywhere.

Endpoints, parameters and credit costs on this page are read from the live catalog and cannot drift from what the API accepts.