Tweet API (X Post API)
Tweet API (X Post API) — get one tweet by ID or URL with full text, author, likes, retweets, replies, quotes, bookmarks, views, and media. JSON, $0.01 per call.
/v1/twitter/tweetThe Tweet API (X Post API) returns a single tweet from its ID or its x.com / twitter.com URL: full text, the author's profile, every engagement count (likes, reposts, replies, quotes, bookmarks, views), media with MP4 video URLs, hashtags, mentions, links, and the quoted or reposted tweet when there is one.
For the conversation underneath, use Tweet Replies; for quote tweets, Tweet Quotes.
Usage
const res = await fetch('https://api.yepapi.com/v1/twitter/tweet', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({"tweet": "https://x.com/NASA/status/2116173868326846654"}),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/twitter/tweet \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tweet": "https://x.com/NASA/status/2116173868326846654"}'import requests
res = requests.post(
"https://api.yepapi.com/v1/twitter/tweet",
headers={"x-api-key": "YOUR_API_KEY"},
json={"tweet": "https://x.com/NASA/status/2116173868326846654"},
)
print(res.json()["data"])Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
tweet | string | Yes | Tweet ID (2116173868326846654) or a post URL (https://x.com/NASA/status/2116173868326846654) | — |
Response
{
"ok": true,
"data": {
"author": {
"avatar": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg",
"banner": "https://pbs.twimg.com/profile_banners/11348282/1788992290",
"created_at": "2007-12-19T20:20:32+00:00",
"description": "Making the seemingly impossible, possible. ✨",
"followers_count": 92298687,
"following_count": 115,
"id": "11348282",
"is_blue_verified": true,
"likes_count": 17049,
"listed_count": 96842,
"location": "Pale Blue Dot",
"media_count": 28221,
"name": "NASA",
"pinned_tweet_ids": [
"2116263878807998722"
],
"protected": false,
"tweet_count": 74477,
"url": "https://x.com/NASA",
"username": "NASA",
"verified": false,
"verified_type": "Government",
"website": "http://www.nasa.gov/"
},
"bookmarks": 3460,
"conversation_id": "2116173868326846654",
"created_at": "2026-10-30T14:22:21+00:00",
"hashtags": [],
"id": "2116173868326846654",
"in_reply_to_tweet_id": null,
"in_reply_to_username": null,
"is_quote": false,
"is_retweet": false,
"lang": "en",
"likes": 100140,
"media": [
{
"alt_text": "Image description: A packed, sparkling starfield captured by our Hubble telescope — with strange new worlds potentially awaiting. Credit: ESA/Hubble and NASA, R. Cohen",
"duration_ms": null,
"height": 1200,
"type": "photo",
"url": "https://pbs.twimg.com/media/HV4o6wYXkAA3T9Q.jpg",
"video_url": null,
"width": 1600
}
],
"mentions": [],
"possibly_sensitive": false,
"quoted_tweet": null,
"quotes": 531,
"replies": 438,
"retweeted_tweet": null,
"retweets": 14918,
"text": "We mourn the passing of Patrick Stewart, who inspired countless individuals at NASA (and beyond) to boldly go where no one has gone before. https://t.co/qnLWiLX9RW",
"url": "https://x.com/NASA/status/2116173868326846654",
"urls": [],
"views": 1904085
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.id | string | Tweet ID |
data.url | string | x.com URL of the tweet |
data.text | string | Full text |
data.created_at | string | ISO 8601 timestamp |
data.lang | string | null | Language code detected by X |
data.author | object | Author profile — same fields as /v1/twitter/user |
data.likes | number | Like count |
data.retweets | number | Repost count |
data.replies | number | Reply count |
data.quotes | number | Quote count |
data.bookmarks | number | Bookmark count |
data.views | number | null | View count |
data.conversation_id | string | ID of the thread's first tweet |
data.in_reply_to_tweet_id | string | null | Tweet this one replies to |
data.in_reply_to_username | string | null | Handle this one replies to |
data.is_retweet | boolean | This is a repost — the original is in retweeted_tweet |
data.is_quote | boolean | This quotes another tweet — see quoted_tweet |
data.possibly_sensitive | boolean | Flagged as sensitive media |
data.hashtags | string[] | Hashtags without # |
data.mentions | string[] | Mentioned handles |
data.urls | string[] | Expanded links |
data.media | object[] | Photos, videos, GIFs: type (photo, video, animated_gif), url, video_url (MP4), duration_ms, width, height, alt_text |
data.quoted_tweet | object | null | The quoted tweet, same shape |
data.retweeted_tweet | object | null | The reposted tweet, same shape |
Caching
Responses are cached for 15 minutes, so engagement counts can lag the live tweet by up to that long.
Errors
| Status | Code | When |
|---|---|---|
400 | VALIDATION_ERROR | tweet is not a tweet ID or status URL |
404 | NOT_FOUND | Tweet not found, deleted, or from a protected account |
429 | RATE_LIMITED_UPSTREAM | Too many requests in a short burst — retry after a few seconds |
502 / 503 | UPSTREAM_ERROR / SERVICE_UNAVAILABLE | Temporary problem fetching data from X — retry later |
Failed calls are not charged.
Related Endpoints
- Tweet Replies API — replies to this tweet
- Tweet Quotes — quote tweets
- Retweeters — who reposted it
Twitter Following API (X Following)
Twitter Following API — list the accounts an X (Twitter) user follows, with full profiles. Paginated JSON, $0.01 per call.
Tweet Replies API (X Replies)
Get the replies to any tweet on X (Twitter), sorted by relevance, recency, or likes, with full text, authors, and engagement counts. JSON, $0.01 per call.