Skip to main content

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​

ParameterRequiredTypeDescription
urlYesstringTwitter/X URL (must match twitter.com or x.com domain pattern)

URL Format Requirements​

  • Must start with http:// or https://
  • Must be from twitter.com or x.com domain (with or without www)
  • Must be a tweet URL containing /status/ path
  • Examples of valid URLs:
    • https://twitter.com/username/status/123456789
    • https://x.com/username/status/123456789
    • https://www.twitter.com/username/status/123456789
    • https://www.x.com/username/status/123456789

πŸ’° Pricing​

Monthly Subscription Tiers​

PlanPriceCreditsCost per Credit
Tier 1$10/month10,000 credits$0.001
Tier 2$50/month55,000 credits$0.0009
Tier 3$100/month115,000 credits$0.00087
Tier 4$500/month600,000 credits$0.00083
Tier 5$1,000/month1,250,000 credits$0.0008

Credit Usage​

FeatureCredits Required
Twitter/X Scraping3 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 posted
  • tweet.author: Combined author information (display name, handle, verification status)
  • tweet.text: Full text content of the tweet
  • videos: 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 file
  • format: Media identifier from Twitter
  • alt: Alt text for the image (usually "Image" if no specific alt text)

Video Object Fields (when present):

  • url: Direct URL to the video file
  • resolution: 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.