Advanced X.com Twitter API
Pricing
from $0.50 / 1,000 tweets
Advanced X.com Twitter API
Powerful Twitter and X.com scraper API. Easily scrape tweets, replies, user profiles, and media. Supports advanced search operators, date filtering, and granular sorting without requiring official Twitter API access. Export cleanly formatted JSON data at scale.
Pricing
from $0.50 / 1,000 tweets
Rating
0.0
(0)
Developer
Novi
Maintained by CommunityActor stats
0
Bookmarked
46
Total users
0
Monthly active users
2 days ago
Last modified
Categories
Features
Share
Twitter Scraper & X.com API
Unlock the full potential of Twitter (formerly X.com) data with our powerful, fast, and efficient Twitter Scraper. Whether you are a researcher, data analyst, marketer, or entrepreneur, this X.com scraping tool allows you to extract historical tweets, user profiles, hashtags, and more without complex setups. Built for large-scale data extraction, it serves as the perfect alternative to the official Twitter API.
🚀 Key Features of the Twitter Scraper
Our Twitter data extraction solution provides advanced capabilities for precise scraping:
- Flexible Input Methods: Define your exact data target:
- Start URLs: Provide direct links to user profiles,
/with_replies,/media, search results, hashtags, or curated lists (x.com or twitter.com). - Search Terms: Utilize keywords, hashtags, and advanced search operators (see Advanced Search Guide).
- Twitter Handles: Directly scrape tweets from specific users.
- Conversations: Get the replies of tweets by tweet URL, tweet ID, or conversation ID.
- Start URLs: Provide direct links to user profiles,
- Granular Filtering & Targeting: Refine your Twitter scraping to get only the data you need:
- Maximum Items: Control the exact number of tweets extracted per query.
- Sorting: Organize scraped results by "Top" or "Latest" tweets.
- Language Filtering: Extract tweets in specific languages using ISO 639-1 codes.
- User Verification Status: Target tweets posted exclusively by verified users or Twitter Blue (X Premium) subscribers.
- Media-Specific Scraping: Extract only tweets that contain images, videos, or quotes.
- Date Range: Programmatically scrape historical Twitter data by setting a
sinceanduntildate.
- Advanced Data Processing:
- Include Search Terms: Track the origin by appending the matching search term to each scraped tweet.
- Custom Map Function: Clean and shape your JSON output on the fly with custom JavaScript.
- Only New Tweets: Schedule the Actor and get only tweets you have not received before.
- Query Wizard: Build complex queries easily via the Apify platform interface.
- High-Speed & Cost-Effective:
- Lightning-Fast: Scrapes between 30-80 tweets per second.
- Affordable Pricing: Only $0.50 per 1,000 tweets extracted.
Need a step-by-step guide? Check out the tutorial from our development team: Tutorial: Scrape Twitter Data with Apify's Tweet X.com Scraper
🎯 Primary Use Cases for Twitter Data Extraction
Our X.com bot acts as a versatile crawler for numerous professional applications:
- Market Research & Social Listening: Monitor brand mentions, track real-time trends, and conduct extensive sentiment analysis.
- Academic & Scientific Research: Gather robust datasets for political science, sociology, and media studies.
- Competitive Analysis: Keep a pulse on competitor strategies, announcements, and audience engagement on Twitter.
- Data Journalism: Extract and investigate large datasets to uncover hidden patterns and public narratives.
- Historical Data Archiving: Fetch and archive past events, viral moments, or corporate communications.
⚡ Quick Start Examples
Below are standard input configurations (schema parameters) to quickly launch your Twitter Scraper task.
1. Fetching Historical Tweets from a Specific Profile (e.g., NASA):
This JSON configuration extracts English tweets from the @NASA profile across multiple date ranges, sorted by latest engagement.
{"includeSearchTerms": false,"onlyImage": false,"onlyQuote": false,"onlyTwitterBlue": false,"onlyVerifiedUsers": false,"onlyVideo": false,"searchTerms": ["from:elonmusk AI since:2023-01-01 until:2023-03-01","from:elonmusk AI since:2023-03-01 until:2023-05-01","from:elonmusk AI since:2023-05-01 until:2023-07-01","from:elonmusk AI since:2023-07-01 until:2023-09-01","from:elonmusk AI since:2023-09-01 until:2023-12-01"],"sort": "Top","tweetLanguage": "en"}
2. Extracting Replies to a Specific Tweet with a Hashtag:
Scrape mentions and replies efficiently. Replace tweet_id_here and hashtag_here for targeted scraping.
{"includeSearchTerms": false,"onlyImage": false,"onlyQuote": false,"onlyTwitterBlue": false,"onlyVerifiedUsers": false,"onlyVideo": false,"searchTerms": ["conversation_id:tweet_id_here #hashtag_here"],"sort": "Latest","tweetLanguage": "en"}
⚙️ Explanation of Key Input Parameters:
searchTerms: The core engine of your scrape. Utilize queries, user handles, advanced search operators, or a combination ofconversation_idand keywords.sort: Determine output sequence—use "Latest" for chronological ingestion or "Top" for high-engagement ranking.tweetLanguage: Isolate geo-linguistic data using country codes (e.g., "en" for English, "es" for Spanish).- Boolean Filters (
onlyImage,onlyVerifiedUsers, etc.): Toggle specific content traits to minimize noise in your scraped dataset. includeSearchTerms: Essential for batch processing tracking; attaches the triggering keyword to the final results.
💬 Getting Replies
A tweet URL or tweet ID needs scrapeReplies, which returns the tweets of its conversation, newest first. Without it the tweet is skipped with a warning. Use the first tweet of the conversation, because replies belong to the conversation of the first tweet. Write IDs as strings.
{"tweetIds": ["1630332507265589248"],"scrapeReplies": true,"maxItems": 100}
conversationIds does the same without scrapeReplies.
🔔 Monitoring New Tweets
Set onlyNewTweets and schedule the Actor. The first run returns tweets as usual and remembers them in a key-value store named x-twitter-monitor-state in your account. Later runs return only tweets that were not returned before. Searches use Latest order in this mode.
{"searchTerms": ["from:NASA"],"onlyNewTweets": true,"monitorName": "nasa","maxItems": 200}
- If the memory cannot be read, the run stops without returning or charging tweets.
- Up to 10,000 of the newest tweets are remembered per query.
- Use a different
monitorNamefor each schedule. Avoid running the same monitor twice at the same time.
💰 Pricing
You pay for the events shown in the Pricing section of the Actor, and nothing else. There is no minimum charge per run.
start: once per run.result-item: for each tweet saved to the dataset. Duplicates within a query are not saved or charged.query(if shown in pricing): once for each query that successfully returned at least one page, even an empty one.
The Actor stops before it goes over the maximum cost or the maximum charged results you set. Results are not charged when the data cannot be loaded.
⚠️ Good to Know
maxItemsis per query (each URL, search term, handle or conversation). Withsortset toBoth, it applies to Top and Latest separately, and tweets found by both are returned once.- Filters and dates apply to
searchTerms. An operator already written in a search term takes priority. - If a run is moved to another server, it continues where it stopped.
- If some queries fail, the others are still returned and a warning is logged. If all fail, the run fails.
- Compliance First: Always respect X.com / Twitter terms of service. Employ this scraper responsibly.
Custom Map Function
customMapFunction is plain, synchronous JavaScript that runs in a separate process. It receives a copy of each item and returns the
object to save. If it returns nothing, an array or a promise, throws, or takes too long, the original item is saved.
- Available: all JavaScript built-ins (
JSON,Math,Date,RegExp,Intl,Mapand so on) and simple versions ofconsole(prints nothing),URL(absolute URLs, read only),structuredClone(JSON values),atob,btoa,crypto.randomUUID()andperformance.now(). - Not available:
process,require, the wordimport,fetch, timers,Buffer,TextEncoder,TextDecoder,URLSearchParams,evalandnew Function.
Output Fields
Items keep the original tweet fields, with these additions:
| Field | Description |
|---|---|
viewCount | Number of views, or null when not available |
full_text_extended | Full text of long posts. full_text is unchanged |
author.is_blue_verified | Whether the author is a Premium (Blue) subscriber |
quote | The quoted tweet, with its own author |
🛡️ Ethical Web Scraping & Data Practices
This actor operates as an unauthenticated Twitter crawler. It securely processes and extracts publicly accessible and visible user data without logging into X.com, ensuring that we do not inherently bypass authenticated platform barriers.
We champion privacy by design:
- No private messages, non-public user details, or sensitive personal fields are parsed.
- The infrastructure operates via Apify—an EU-based platform compliant with major data protection frameworks (including GDPR where applicable). For more legal insights, read Apify's guide on web scraping legality.
Our technical extraction layers are designed to tread lightly on X.com’s servers, enabling ethical academic, corporate, and public research without degrading platform performance or inciting harm.
📄 Output Schema Example
The scraper outputs rich JSON arrays containing complete, structured tweet metadata perfectly formatted for databases and data pipelines:
[{"id": "1630332507265589248","url": "https://x.com/NASA/status/1630332507265589248","twitterUrl": "https://twitter.com/NASA/status/1630332507265589248","full_text": "@yalhunzai We have internships open to international students from countries with whom we have agreements: https://t.co/Kl2Lz4qjpw","favorite_count": 14,"retweet_count": 9,"reply_count": 0,"quote_count": 0,"bookmark_count": 1,"author": {"id_str": "11348282","screen_name": "NASA","name": "NASA","advertiser_account_service_levels": ["dso","media_studio"],"advertiser_account_type": "promotable_user","analytics_type": "enabled","can_dm": false,"can_media_tag": true,"created_at": "Wed Dec 19 20:20:32 +0000 2007","description": "There's space for everybody. ✨\n\nVerification: https://t.co/8nok3NP4PW","entities": {"description": {"hashtags": [],"symbols": [],"urls": [{"display_url": "nasa.gov/socialmedia","expanded_url": "http://nasa.gov/socialmedia","indices": [46,69],"url": "https://t.co/8nok3NP4PW"}],"user_mentions": []},"url": {"urls": [{"display_url": "nasa.gov","expanded_url": "http://www.nasa.gov/","indices": [0,23],"url": "https://t.co/9NkQJKAnuU"}]}},"fast_followers_count": 0,"favourites_count": 16401,"followers_count": 85752559,"friends_count": 170,"geo_enabled": false,"has_custom_timelines": true,"has_extended_profile": true,"is_translator": false,"location": "Pale Blue Dot","media_count": 27374,"normal_followers_count": 85752559,"pinned_tweet_ids_str": [],"profile_background_color": "000000","profile_banner_url": "https://pbs.twimg.com/profile_banners/11348282/1718393721","profile_image_url_https": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg","profile_interstitial_type": "","profile_link_color": "205BA7","protected": false,"statuses_count": 72761,"translator_type_enum": "Regular","url": "https://t.co/9NkQJKAnuU","verified": false,"verified_type": "Government","withheld_in_countries": []},"bookmarked": false,"conversation_id_str": "1630332507265589248","created_at": "Tue Feb 28 20:28:53 +0000 2023","display_text_range": [11,130],"entities": {"hashtags": [],"symbols": [],"timestamps": [],"urls": [{"display_url": "go.nasa.gov/3EKfKkN","expanded_url": "https://go.nasa.gov/3EKfKkN","indices": [107,130],"url": "https://t.co/Kl2Lz4qjpw"}],"user_mentions": [{"id_str": "1583456964453040129","indices": [0,10],"name": "Baki bùlen","screen_name": "yalhunzai"}]},"favorited": false,"in_reply_to_screen_name": "yalhunzai","in_reply_to_status_id_str": "1630616311226048513","in_reply_to_user_id_str": "1583456964453040129","is_quote_status": false,"lang": "en","possibly_sensitive": false,"possibly_sensitive_editable": true,"retweeted": false,"user_id_str": "11348282"}]
🛠️ Troubleshooting
Encountering "no results" or low tweet compilation volumes? Review the detailed troubleshooting schema inside the Actor's documentation. Common stumbling blocks involve hyper-restrictive queries or temporarily hitting platform rate thresholds.
🚀 Get Started Now
Unlock the most comprehensive and flexible Twitter API alternative. Launch your tasks and begin extracting meaningful Twitter data today!