X Post Scraper API
The X Post Scraper API lets you extract detailed data for any X (Twitter) post including engagement metrics (views, retweets, quotes, likes, bookmarks), full post content, timestamp, and complete author profile information. Each successful request costs 5 API credits.
Endpoint:
https://api.scrapingdog.com/x/postAPI Parameters
🔑
Scrapingdog Parameters
api_keyRequiredYour personal API key. Available on your dashboard.
Type: String
🐦
Post
tweetIdRequiredThis is the tweet ID of the X post you want to scrape. You can find it in the post URL (e.g., fortwitter.com/i/web/status/1655608985058267139, the ID is1655608985058267139).
Type: String
API Examples
Code to Integrate
curl "https://api.scrapingdog.com/x/post?api_key=APIKEY&tweetId=1655608985058267139"
import requests params = { "api_key": "APIKEY", "tweetId": "1655608985058267139" } response = requests.get("https://api.scrapingdog.com/x/post", params=params) data = response.json() print(data["tweet"]) print("Likes:", data["likes"], "| Views:", data["views"])
const params = new URLSearchParams({ api_key: "APIKEY", tweetId: "1655608985058267139" }); const res = await fetch(`https://api.scrapingdog.com/x/post?${params}`); const data = await res.json(); console.log(data.tweet, data.likes, data.views);
<?php $url = 'https://api.scrapingdog.com/x/post?' . http_build_query([ 'api_key' => 'APIKEY', 'tweetId' => '1655608985058267139', ]); echo file_get_contents($url);
API Response
{
"tweet_id": "1655608985058267139",
"post_url": "https://twitter.com/i/web/status/1655608985058267139",
"tweet": "Excited to announce that we have launched our new X Scraper API!",
"created_at": "Mon May 08 12:34:56 +0000 2023",
"views": 1284950,
"retweets": 3241,
"quotes": 512,
"likes": 28475,
"bookmarks": 4123,
"profile_name": "Scrapingdog",
"profile_handle": "scrapingdog",
"profile_url": "https://twitter.com/scrapingdog",
"profile_picture": "https://pbs.twimg.com/profile_images/...",
"description": "Web Scraping API for developers",
"location": "India",
"followers_count": 5420,
"following_count": 312,
"likes_count": 1840,
"statuses_count": 2310,
"is_blue_verified": false
}