X Post Scraper API
With X Scraping API you scrape any tweet. You just have to pass the URL of that tweet and our API will return the parsed JSON data.
Parameter
Description
API Example
curl "https://api.scrapingdog.com/x/post?api_key=5eaa61a6e562fc52fe763tr516e4653&tweetId=1655608985058267139"import requests
api_key = '5eaa61a6e562fc52fe763tr516e4653'
tweetId = '1655608985058267139'
params = {
'api_key': api_key,
'tweetId': tweetId
}
response = requests.get('https://api.scrapingdog.com/x/post', params=params)
if response.status_code == 200:
# Parse the JSON response using response.json()
response_data = response.json()
# Now you can work with the response_data as a Python dictionary
print(response_data)
else:
print(f'Request failed with status code: {response.status_code}')
API Response
{
"views": "78802082",
"retweets": 35858,
"quotes": 16507,
"likes": 370782,
"bookmarks": 2934,
"tweet": "We’re purging accounts that have had no activity at all for several years, so you will probably see follower count drop",
"created_at": "Mon May 08 16:21:56 +0000 2023",
"tweet_id": "1655608985058267139",
"post_url": "https://www.x.com/elonmusk/status/1655608985058267139",
"user": {
"typename": "User",
"id": "VXNlcjo0NDE5NjM5Nw==",
"rest_id": "44196397",
"affiliates_highlighted_label": {
"label": {
"url": {
"url": "https://twitter.com/X",
"urlType": "DeepLink"
},
"badge": {
"url": "https://pbs.twimg.com/profile_images/1683899100922511378/5lY42eHs_bigger.jpg"
},
"description": "X",
"userLabelType": "BusinessLabel",
"userLabelDisplayType": "Badge"
}
},
"parody_commentary_fan_label": "None",
"is_blue_verified": true,
"profile_picture": "https://pbs.twimg.com/profile_images/1893803697185910784/Na5lOWi5_normal.jpg",
"profile_name": "Elon Musk",
"profile_handle": "elonmusk",
"profile_url": "https://www.x.com/elonmusk",
"description": "",
"likes_count": 141367,
"followers_count": 219187202,
"following_count": 1108,
"listed_count": 162033,
"location": "",
"media_count": 3781,
"pinned_tweet_ids_str": [],
"statuses_count": 77070,
"verified": false,
"translator_type": "none",
"withheld_in_countries": []
}
}Last updated