Twitter/X Scraping API
Extract individual tweet data from Twitter/X with automatic retries to achieve 99%+ uptime and robust error handling. Currently supports single tweet extraction with plans to expand to profiles, threads, and search results.
π Key Featuresβ
- Single Tweet Extraction - Extract detailed data from individual tweets
- Automatic Retries - Automatic retries to achieve 99%+ uptime
- Robust Error Handling - Comprehensive error logging and user feedback
- URL Validation - Supports both twitter.com and x.com domains
- High Success Rate - Automatic retries to achieve 99%+ uptime
- Credit Protection - Credits only deducted on successful requests
- Real-Time Data - Extract live tweet data with current engagement metrics
- Structured Response - Clean JSON format for easy integration
π Endpointβ
POST requests only - All Twitter/X scraping requests must use the POST method:
POST https://scrapingapi.qoest.com/v1/twitter
π Authenticationβ
All requests must include your API token in the Authorization header using Bearer authentication:
Authorization: Bearer YOUR_API_TOKEN
π Parametersβ
| Parameter | Required | Type | Description |
|---|---|---|---|
url | Yes | string | Twitter/X URL (must match twitter.com or x.com domain pattern) |
URL Format Requirementsβ
- Must start with
http://orhttps:// - Must be from
twitter.comorx.comdomain (with or without www) - Must be a tweet URL containing
/status/path - Examples of valid URLs:
https://twitter.com/username/status/123456789https://x.com/username/status/123456789https://www.twitter.com/username/status/123456789https://www.x.com/username/status/123456789
π° Pricingβ
Monthly Subscription Tiersβ
| Plan | Price | Credits | Cost per Credit |
|---|---|---|---|
| Tier 1 | $10/month | 10,000 credits | $0.001 |
| Tier 2 | $50/month | 55,000 credits | $0.0009 |
| Tier 3 | $100/month | 115,000 credits | $0.00087 |
| Tier 4 | $500/month | 600,000 credits | $0.00083 |
| Tier 5 | $1,000/month | 1,250,000 credits | $0.0008 |
Credit Usageβ
| Feature | Credits Required |
|---|---|
| Twitter/X Scraping | 3 credits per request |
Usage Examplesβ
- Tier 1 ($10): 3,333 Twitter/X scraping requests
- Tier 2 ($50): 18,333 Twitter/X scraping requests
- Tier 3 ($100): 38,333 Twitter/X scraping requests
π Examplesβ
Extract Text-Only Tweetβ
curl --location 'https://scrapingapi.qoest.com/v1/twitter' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--data '{
"url": "https://x.com/isohaibilyas/status/1966179704710509050"
}'
Response:
{
"response": {
"tweet": {
"timestamp": "2025-09-11T16:39:06.000Z",
"author": "Sohaib Ilyas@isohaibilyasΒ·Member",
"text": "Built a Reddit Scraping API.\n\nPhase 1: pull the best posts + comments in any niche.\n\nPhase 2: feed that gold to an LLM until it writes indistinguishable replies.\n\nPhase 3: let the bot farm karma on autopilot.\n\nWhat could possibly go wrong?"
},
"videos": [],
"images": []
}
}
Extract Tweet with Imagesβ
curl --location 'https://scrapingapi.qoest.com/v1/twitter' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 11|giRdABvQEEnRqGVQooIFwTPT8jat8pB4hwLTO3Kg6a7ee1f0' \
--data '{
"url": "https://x.com/isohaibilyas/status/1966579142842855523"
}'
Response:
{
"response": {
"tweet": {
"timestamp": "2025-09-12T19:06:19.000Z",
"author": "Sohaib Ilyas@isohaibilyasΒ·Member",
"text": "Just launched a real Upwork AI agent, no Chrome extension, no account linking, totally safe.\nIt hunts for jobs, compares them to your skills and past projects, and surfaces the best matches so you spend minutes applying instead of hours searching."
},
"videos": [],
"images": [
{
"url": "https://pbs.twimg.com/media/G0qwfvNW0AA3ebM?format=jpg",
"format": "com/media/G0qwfvNW0AA3ebM",
"alt": "Image"
}
]
}
}
Extract Tweet with Videosβ
curl --location 'https://scrapingapi.qoest.com/v1/twitter' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--data '{
"url": "https://x.com/isohaibilyas/status/1966131234976804982"
}'
Response:
{
"response": {
"tweet": {
"timestamp": "2025-09-11T13:26:30.000Z",
"author": "Sohaib Ilyas@isohaibilyasΒ·Member",
"text": "Reddit Scraping API Demo"
},
"videos": [
{
"url": "https://video.twimg.com/amplify_video/1966131052549689376/vid/avc1/1920x1080/FqUYlM-N7TWpGEva.mp4?tag=21",
"resolution": "1920x1080",
"format": "mp4"
}
],
"images": []
}
}
π€ Response Formatβ
Successful Response (200)β
The API returns a consistent structure with three main components:
{
"response": {
"tweet": {
"timestamp": "2025-09-12T19:06:19.000Z",
"author": "Username@handleΒ·Status",
"text": "Tweet content text goes here..."
},
"videos": [],
"images": []
}
}
Response Fields:
tweet.timestamp: ISO 8601 formatted timestamp of when the tweet was postedtweet.author: Combined author information (display name, handle, verification status)tweet.text: Full text content of the tweetvideos: Array of video objects (empty if no videos)images: Array of image objects (empty if no images)
Image Object Fields (when present):
url: Direct URL to the image fileformat: Media identifier from Twitteralt: Alt text for the image (usually "Image" if no specific alt text)
Video Object Fields (when present):
url: Direct URL to the video fileresolution: Video resolution (width x height)format: Video file format (e.g., "mp4")
Error Responsesβ
URL Validation Error (422)β
{
"message": "The given data was invalid.",
"errors": {
"url": [
"The url field is required.",
"The url format is invalid."
]
}
}
Invalid Domain Error (422)β
{
"message": "The given data was invalid.",
"errors": {
"url": [
"The url must match the pattern for Twitter/X URLs."
]
}
}
Insufficient Credits (403)β
{
"message": "You do not have enough credits to perform this action."
}
Scraping Failed (400)β
{
"message": "Failed to fetch Twitter/X data"
}
Authentication Required (401)β
{
"message": "Unauthenticated."
}
β οΈ Validation Rulesβ
URL Requirementsβ
- Required field: Must be a valid URL string
- Domain validation: Must match Twitter/X domain pattern
- Protocol: Must include http:// or https://
- Tweet URL: Must contain
/status/path for tweet extraction - Supported domains: twitter.com, x.com (with or without www)
Automatic Retry Logicβ
- Automatic retries to achieve 99%+ uptime
- Error handling: Comprehensive logging of failed attempts
- Success criteria: HTTP 200 response with valid JSON data
π¨ Common Issuesβ
- Invalid URL Format: Ensure URL follows Twitter/X domain pattern with
/status/path - Tweet Not Found: Tweet may be deleted, private, or suspended
- Rate Limiting: Platform-level restrictions may affect availability
- Insufficient Credits: Check credit balance before making requests
- Network Timeouts: Automatic retries to achieve 99%+ uptime handle temporary connectivity issues
- Authentication: Ensure Bearer token is correctly formatted and valid
π― Use Casesβ
Sentiment Analysis & Customer Feedbackβ
Extract customer tweets and feedback for sentiment analysis and reputation management.
curl "https://scrapingapi.qoest.com/v1/twitter" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://x.com/customer_username/status/complaint_tweet_id"}'
Content Analysis & Researchβ
Analyze individual tweets for content research, academic studies, and data analysis.
curl "https://scrapingapi.qoest.com/v1/twitter" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://twitter.com/research_subject/status/study_relevant_tweet"}'
News Monitoring & Journalismβ
Extract specific news tweets and journalist content for reporting and verification.
curl "https://scrapingapi.qoest.com/v1/twitter" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://twitter.com/news_outlet/status/breaking_news_id"}'
More use cases will be added as we expand support for profiles, threads, and search results.
π Related APIsβ
- Web Scraping - Extract website data
- Google Search - Extract search results
- Reddit Scraping - Extract social media data
- YouTube Scraping - Extract video data
- Image OCR - Extract text from images
- PDF OCR - Extract text from PDFs