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));
Response
{ "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"}