X Twitter Scraper ($0.15 per 1000 results)
Pricing
from $0.13 / 1,000 results
X Twitter Scraper ($0.15 per 1000 results)
Low-cost X.com/Twitter scraper for search and user timelines. Filter by dates, media, replies/retweets/quotes, verified, links, news, safe, and location. Use query, username, or both to search within a user. Export JSON/CSV/XLSX.
Pricing
from $0.13 / 1,000 results
Rating
5.0
(6)
Developer
Iñigo Garcia Olaizola
Maintained by CommunityActor stats
4
Bookmarked
628
Total users
68
Monthly active users
8.9 hours
Issues response
11 days ago
Last modified
Categories
Share
X (Twitter) Scraper — Low-Cost, Reliable Tweet Extraction for Search, Users & Filters
🤖 What does X (Twitter) Scraper do?
X (Twitter) Scraper extracts tweets from X.com for social listening, brand monitoring, competitor research, and trend analysis. Search by topic, download a user's tweets, or find matching posts within one account, then export the results as JSON, CSV, or Excel.
Collect tweets at low cost for social listening, monitoring, and research.
- Tweet content: Text, publication dates, post links, and reply or retweet context.
- Author information: Usernames, display names, profile links, avatars, and verification status.
- Engagement: Likes, comments, retweets, quotes, and views when available.
- Media: Image URLs, playable video URLs, animated GIFs, and links in posts.
- Search filters: Dates, minimum likes, content types, verification, and location.
SEO keywords: Twitter scraper, X scraper, scrape tweets, download tweets, Twitter search scraper, Twitter username scraper, Twitter API alternative.
🧠 Scraping modes
Search across X
Set query to a topic, brand, or hashtag, such as bitcoin or #WorldCup. Leave username empty.
Collect a user's tweets
Set username to an X handle, such as nasa, and leave query empty. Add filters to narrow the user's posts.
Search within one account
Set both username and query. For example, username="nasa" and query="mars" searches for that account's tweets about Mars.
🚀 Quick start
- Choose your search: Enter
query,username, or both. Use search text and handles rather than post or profile URLs. - Set your limit: Choose
maxItemsand add any date, engagement, or content filters. - Run the actor: Click Run in Apify Console, or start a run through Apify's API.
- Download your results: Open the run's Dataset tab to preview tweets and export JSON, CSV, or Excel. Choose All fields to include fields outside the overview.
📝 Configuration and input parameters
Configure these inputs in Apify Console or supply an input object through the API. Provide maxItems and at least one of query or username.
All content filters accept "" (any), "only", or "exclude". Their default is "", which applies no filter. Multiple filters narrow the same search.
Available Twitter scraper inputs
| Parameter | Type | Required | Description |
|---|---|---|---|
maxItems | Integer | Yes | Maximum tweets to save. Minimum 1; default 10. This is a limit, not a guaranteed result count. |
query | String | No* | Search text, such as bitcoin. With username, searches within that account. Very long queries are shortened automatically. |
username | String | No* | X handle, such as nasa, preferably without @. Leave empty for a general search. Do not supply a profile URL. |
minDate | String | No | Lower date bound in YYYY-MM-DD format, such as 2024-05-01. Omit for no lower bound. |
maxDate | String | No | Return tweets before this date (YYYY-MM-DD). |
minLikes | Integer | No | Minimum likes per tweet. Minimum 0; default 0 (no minimum). |
replies | String (enum) | No | Replies. Options: "" · "only" · "exclude"; default "". |
retweets | String (enum) | No | Retweets (reposts). Options: "" · "only" · "exclude"; default "". |
quotes | String (enum) | No | Quote tweets. Options: "" · "only" · "exclude"; default "". |
verified | String (enum) | No | Tweets from verified accounts. Options: "" · "only" · "exclude"; default "". |
links | String (enum) | No | Tweets containing links. Options: "" · "only" · "exclude"; default "". |
media | String (enum) | No | Tweets containing media. Options: "" · "only" · "exclude"; default "". |
images | String (enum) | No | Tweets containing images. Options: "" · "only" · "exclude"; default "". |
videos | String (enum) | No | Tweets containing videos. Options: "" · "only" · "exclude"; default "". |
nativeVideos | String (enum) | No | Tweets containing videos uploaded to X. Options: "" · "only" · "exclude"; default "". |
proVideos | String (enum) | No | Pro Video (Amplify) tweets. Options: "" · "only" · "exclude"; default "". |
news | String (enum) | No | Tweets classified as news. Options: "" · "only" · "exclude"; default "". |
safe | String (enum) | No | Tweets classified as safe; "exclude" excludes safe content, rather than sensitive content. Options: "" · "only" · "exclude"; default "". |
near | String | No | Location to search near, such as Madrid or New York. Omit for no location filter. |
* Conditional requirement: Provide query or username, or both.
Example inputs
Copy an example into the actor's JSON input editor and adjust the search and limit.
1️⃣ Topic search with image and date filters
{"maxItems": 50,"query": "pizza","images": "only","retweets": "exclude","minDate": "2024-05-01","maxDate": "2024-09-01"}
2️⃣ User timeline
{"maxItems": 100,"username": "nasa"}
3️⃣ Search within a user, excluding replies and reposts
{"maxItems": 100,"username": "nasa","query": "mars","replies": "exclude","retweets": "exclude","quotes": "exclude"}
📊 Output and results
Each dataset item represents one tweet. The overview shows the main fields; choose All fields when exporting to include the full record.
Field reference
- Post identity (strings):
idis the tweet ID;permalinklinks to the post. - Author (strings):
userUrl,username,fullname, andavatarcontain the profile link, handle, display name, and avatar URL.verifiedcontains the verification type, such asblueorgold, or an empty string when unavailable. - Content (strings):
textcontains plain text;htmlcontains formatted tweet content. - Retweet context:
isRetweetis a boolean;retweetedByis the retweeter's display text, or an empty string for an original post. - Reply context (array of strings):
replyingTolists the handles being replied to when available. - Publication time (strings):
displayTimeis the displayed date and time;createdAtis the parsed timestamp. - Media and links (arrays of strings):
imagescontains photo URLs;videoscontains playable MP4 URLs for native videos and animated GIF attachments;linkscontains links found in the content. - Engagement (integers):
comments,retweets,quotes,likes, andviewscontain the available counters.viewsis the view or impression count.
Media and reply arrays may be null when no values are available. Some author details and counters may be unavailable for individual posts; a zero counter does not necessarily confirm that the post received no engagement.
Example tweet
This illustrative record shows the output structure. Engagement counts change over time.
{"id": "1819469673169408242","permalink": "https://x.com/elonmusk/status/1819469673169408242","userUrl": "https://x.com/elonmusk","username": "elonmusk","fullname": "Elon Musk","avatar": "https://pbs.twimg.com/profile_images/.../kqqe2iWO_bigger.jpg","verified": "blue","text": "I did all my coding with just Diet Coke, burgers & pizza","html": "I did all my coding with just Diet Coke, burgers & pizza","isRetweet": false,"retweetedBy": "","replyingTo": ["growing_daniel"],"displayTime": "Aug 2, 2024 · 8:25 PM UTC","createdAt": "2024-08-02T20:25:00Z","images": null,"videos": null,"links": null,"comments": 430,"retweets": 156,"quotes": 59,"likes": 3890,"views": 120000}
🧭 Common recipes
- Original tweets only: Set
replies="exclude",retweets="exclude", andquotes="exclude". - Video posts: Set
videos="only", or usenativeVideos="only"for videos uploaded to X. - News posts: Set
news="only". - Verified authors: Set
verified="only". - Location search: Combine
querywithnear="San Francisco". - Popular posts: Set
minLikesto a threshold such as100. - Event research: Combine
minDateandmaxDateto focus on a date range.
⚙️ Best practices
- Start small: Test a search with
maxItems=10, inspect the dataset, then increase the limit. - Keep searches focused: Use concise terms. Very long queries may lose terms when shortened.
- Avoid conflicting filters: For example,
media="exclude"together withimages="only"can leave no matching posts. - Allow for fewer results: Runs can finish below
maxItemswhen no more matching tweets are available. - Check dates: Use valid calendar dates in
YYYY-MM-DDformat. Invalid dates are ignored and reported in the run log.
⚖️ Legal & ethical considerations
- Platform policies: Respect X's terms of service and applicable rules for accessing and using content.
- Privacy: Handle personal data responsibly and comply with applicable privacy requirements, including GDPR and CCPA.
- Responsible volume: Keep collection volumes and run frequency appropriate for your use case; avoid abusive traffic.
- Attribution: Preserve source links and respect authors' rights when sharing tweets or publishing analysis.
This actor is an independent tool and is not affiliated with, endorsed by, or sponsored by X Corp. All trademarks are the property of their respective owners.
❓ FAQ
Do I need both query and username?
No. Provide either one. When you provide both, the actor searches for matching tweets within that user's account.
Can I paste a tweet or profile URL?
No. Use search text in query or an X handle in username. Direct tweet URL collection is not an input mode.
How do I exclude sensitive content?
Set safe="only" to request content classified as safe. safe="exclude" excludes safe content. Classification does not guarantee that every result is suitable for every audience.
Why did I receive fewer tweets than maxItems?
maxItems is an upper limit. Narrow date ranges, high like thresholds, or combined filters may produce fewer matches. Try a broader query or remove a filter.
🛟 Support
Need a custom field, export, or search workflow? Open an issue from the actor's Issues tab in Apify Console, or contact the developer.