X (Twitter) Tweet
x.tweet.syndication
Get one public post from its numeric ID: text, author handle and name, post time, language, likes and replies, and whether it is a reply, quote or repost.
At a glance
- Endpoint ID
x.tweet.syndication- Price
- 0.25 credits per call; failed calls are free
- Runs for up to
- 30 seconds
Request
Send the endpoint ID as capability and its fields as input. Set UPSCRAPE_API_KEY to your key first.
curl --request POST \ --url https://data.upscrape.com/execute \ --header "Authorization: Bearer $UPSCRAPE_API_KEY" \ --header "Content-Type: application/json" \ --header "Prefer: wait=30" \ --data '{ "capability": "x.tweet.syndication", "input": { "tweet_id": "20" }}'
import jsonimport osimport requestspayload = json.loads(r'''{ "capability": "x.tweet.syndication", "input": { "tweet_id": "20" }}''')response = requests.post( "https://data.upscrape.com/execute", headers={ "Authorization": f"Bearer {os.environ['UPSCRAPE_API_KEY']}", "Content-Type": "application/json", "Prefer": "wait=30", }, json=payload,)response.raise_for_status()print(json.dumps(response.json(), indent=2))
const response = await fetch("https://data.upscrape.com/execute", { method: "POST", headers: { "Authorization": `Bearer ${process.env.UPSCRAPE_API_KEY}`, "Content-Type": "application/json", "Prefer": "wait=30", }, body: JSON.stringify({ "capability": "x.tweet.syndication", "input": { "tweet_id": "20" }}),});if (!response.ok) { throw new Error(`Upscrape request failed: ${response.status}`);}console.log(JSON.stringify(await response.json(), null, 2));
Input
| Field | Type | Required | What it does | Example |
|---|---|---|---|---|
tweet_id |
string | yes | The post's numeric ID, the number at the end of its link (x.com/jack/status/20 is 20). | 20 |
Response
A finished call answers with HTTP 200; the data is in results[0].data, and billing.credits_charged is what it cost. A call still running after the wait answers 202: see jobs and results.
This is results[0].data from a real run:
{ "text": "just setting up my twttr", "likes": 308818, "author": "jack", "author_name": "jack", "created": "2006-03-21T20:50:14.000Z", "id": "20", "is_quote": false, "is_reply": false, "is_retweet": false, "lang": "en", "replies": 18073, "url": "https://x.com/jack/status/20"}
Fields
| Field | Type | What it is | Example |
|---|---|---|---|
text |
string | The post's text. | just setting up my twttr |
author |
string | The author's handle. | jack |
author_name |
string | The author's display name. | jack |
created |
string | When the post was published. | 2006-03-21T20:50:14.000Z |
likes |
integer | Likes, as X shows them. | 308,818 |
replies |
integer | Replies, as X shows them. | 18,073 |
lang |
string | The language X detected for the post. | en |
url |
string | The post's link on X. | https://x.com/jack/status/20 |
id |
string | X's ID for the post. | 20 |
is_quote |
boolean | Whether the post quotes another post. | false |
is_reply |
boolean | Whether the post is a reply. | false |
is_retweet |
boolean | Whether the post is a repost. | false |
If a call fails
A failed call costs nothing. The response carries an error.code you can branch on; Errors and retries lists every code and which ones to retry.
Something missing or unclear? Ask the team that builds the X (Twitter) endpoints.