X Posts Search Scraper
Pricing
from $3.99 / 1,000 results
X Posts Search Scraper
X Posts Search Scraper extracts posts, tweets, authors, hashtags, timestamps, engagement metrics, media, and other public data from X search results. Automate keyword research, social listening, trend analysis, competitor monitoring, content discovery, and audience insights.
Pricing
from $3.99 / 1,000 results
Rating
0.0
(0)
Developer
ScraperForge
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
X Posts Search Scraper — Keyword, Advanced-Operator & Time-Window Search on X (Twitter)
Search X (Twitter) by keyword, by advanced search syntax, or by profile — and narrow results to the last N hours or days. Every post comes back with its text, timestamp, direct URL, conversation ID, media and engagement counts, plus the author's name, handle, bio and follower count.
Built for social listening and real-time monitoring, with Top and Latest search modes.
What is X Posts Search Scraper?
This is the search-first Actor in the collection. Its distinguishing feature is the combination of latest mode with an hour-level time window — you can ask for posts from the last 2 hours, which is what breaking-news and incident monitoring actually require.
It accepts three kinds of input in the same field, and decides what each is:
- Profile URL or single-word handle → that account's timeline
- Multi-word input → a keyword search
search:prefix → raw X advanced-search syntax, passed through
That last one is the important one. search: python from:NASA min_faves:100 gives you the full expressive power of X's own search grammar — operators, exclusions, engagement thresholds — rather than a simplified subset.
What data can you extract?
| Field | Description |
|---|---|
postId | X post ID |
postUrl | Direct link to the post |
postText | Full post text |
timestamp | Publication time in milliseconds |
conversationId | Thread the post belongs to |
media[] | mediaUrlHttps, type, id for each attachment |
favouriteCount | Likes |
repostCount | Reposts / retweets |
replyCount | Replies |
quoteCount | Quote posts |
author.name | Display name |
author.screenName | Handle |
author.description | Bio |
author.followersCount | Followers |
author.friendsCount | Following |
author.favouritesCount | Likes given |
Why teams search X
For real-time monitoring
timeWindowHours is the field that makes this practical. During an incident, a product launch or a live event, "posts from the last 2 hours" is the only useful query — a day-level filter is far too coarse.
For precise social listening
Advanced search syntax lets you exclude retweets, require a minimum engagement level, restrict to an account, or combine terms. That turns a noisy keyword into a targeted monitor.
For trend analysis
top mode returns what X considers popular and relevant for a term — a useful proxy for what is actually shaping the conversation.
For brand and reputation monitoring
Scheduled latest runs with a matching time window produce a continuous mentions feed with author reach attached.
For competitive intelligence
search: from:competitor min_faves:100 isolates a competitor's posts that actually landed, filtering out their routine output.
For lead generation
Searching intent phrases and filtering the author's bio and follower count turns a topic search into a prospect list.
How to search X step by step
- Open the Actor and add targets to Targets to scrape — profiles, handles, keywords or
search:queries, one per line. - Choose a Search mode:
topfor popular and relevant,latestfor newest first. - For monitoring, set Time window in days or hours — these require
latestmode. - Set Max posts per target. Start at 50–100 to validate, then scale.
- Keep Apify Proxy → RESIDENTIAL on for reliable runs.
- Click Start, then export the Output tab.
⬇️ Input
Example input — real-time monitoring
{"startUrls": ["your brand name", "@yourbrand"],"searchType": "latest","timeWindowHours": 6,"maxTweets": 200}
Example input — advanced search
{"startUrls": ["search: python from:NASA min_faves:100"],"searchType": "top","maxTweets": 100}
Input reference
| Field | Type | Default | Description |
|---|---|---|---|
startUrls | array | — (required) | One target per row. Profile URL (https://x.com/elonmusk), handle (@NASA, BarackObama), keywords (climate change), or advanced syntax (search: python from:NASA min_retweets:50). Single-tweet links (…/status/123…) are skipped. Rule of thumb: multi-word input = search; single word or URL = that account's timeline. |
searchType | string | top | Required. top — popular and relevant posts. latest — newest first. On profile runs this controls the sort order of saved posts. |
maxTweets | integer | 10 | Cap per target (URL, user or keyword). |
timeWindow | integer | — | Keep only posts newer than N days (UTC). Requires searchType: "latest". |
timeWindowHours | integer | — | Keep only posts newer than N hours (UTC). Requires latest, and takes precedence over timeWindow if both are set. |
proxyConfiguration | object | Apify Residential | Off means a direct connection, which X frequently blocks. Residential is the most reliable choice on X. |
Time windows only work in
latestmode. SettingtimeWindowortimeWindowHourswithtophas no effect — X's Top ranking does not support a recency cut-off.
⬆️ Output
Example output
{"postId": "1789012345678901234","postUrl": "https://x.com/exampleuser/status/1789012345678901234","postText": "Seeing reports of the outage across three regions. Updates as we get them.","timestamp": 1786451351000,"conversationId": "1789012345678901234","media": [{"mediaUrlHttps": "https://pbs.twimg.com/media/…","type": "photo","id": "1789012345678901000"}],"favouriteCount": 4821,"repostCount": 2140,"replyCount": 612,"quoteCount": 184,"author": {"name": "Example User","screenName": "exampleuser","description": "Infrastructure engineer. Occasional threads about outages.","followersCount": 48210,"friendsCount": 913,"favouritesCount": 19430}}
Illustrative values — a live run returns current X data.
Usage recipes
Breaking-news monitoring
{"startUrls": ["your brand name", "your product name"],"searchType": "latest","timeWindowHours": 2,"maxTweets": 200}
Schedule it every couple of hours and deduplicate on postId for a live mentions feed.
High-signal competitor posts
{"startUrls": ["search: from:competitor min_faves:100 -filter:replies"],"searchType": "top","maxTweets": 100}
Topic research over the last week
{"startUrls": ["ai regulation", "eu ai act"],"searchType": "latest","timeWindow": 7,"maxTweets": 300}
Mixed monitoring run
{"startUrls": ["@yourbrand","your product name","search: \"your brand\" -filter:retweets min_replies:5"],"searchType": "latest","timeWindow": 3,"maxTweets": 150}
Find accounts worth engaging
Run a topic search, then sort the export by author.followersCount and read the top rows — those are the voices shaping the conversation.
Useful X search operators
Use these inside a search: target:
from:username/to:username— posts by or directed at an accountmin_faves:100/min_retweets:50/min_replies:10— engagement thresholds-filter:replies/-filter:retweets— exclude replies or retweetsfilter:media/filter:links— require media or linkslang:en— language"exact phrase"— exact matchingsince:2026-08-01 until:2026-08-10— date range
How does this compare to X's official API?
X's search API sits behind paid tiers with monthly post caps, and full-archive search is an Enterprise-level product. The free tier does not provide usable search access.
This Actor reads public X search results without a developer account or subscription, and supports the same operator grammar you would type into X's own search box. If you need guaranteed completeness, full-archive coverage or contractual SLAs, the paid API is the right choice.
Integrate and automate
Python
from apify_client import ApifyClientclient = ApifyClient("<YOUR_APIFY_API_TOKEN>")run = client.actor("scraperforge/x-twitter-posts-search").call(run_input={"startUrls": ["climate change"],"searchType": "latest","timeWindowHours": 6,"maxTweets": 200,})for p in client.dataset(run["defaultDatasetId"]).iterate_items():print(p["author"]["screenName"], "|", p["favouriteCount"], "|", p["postText"][:70])
JavaScript
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: '<YOUR_APIFY_API_TOKEN>' });const run = await client.actor('scraperforge/x-twitter-posts-search').call({startUrls: ['climate change'],searchType: 'latest',timeWindowHours: 6,maxTweets: 200,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
REST API
curl -X POST "https://api.apify.com/v2/acts/scraperforge~x-twitter-posts-search/runs?token=<YOUR_APIFY_API_TOKEN>" \-H "Content-Type: application/json" \-d '{"startUrls":["climate change"],"searchType":"latest","timeWindowHours":6,"maxTweets":200}'
n8n, Make, Zapier and AI agents
Call the Actor from n8n, Make, Zapier or an MCP-capable agent — an hourly latest run with a matching time window makes an effective alerting trigger.
Schedules and webhooks
Match your Schedule interval to your time window (hourly schedule → timeWindowHours: 1) and route results with webhooks or the Google Sheets / Airtable / Slack integrations.
Pricing and what you are charged for
Pay-per-event: a small Actor-start charge plus a charge per post row delivered. maxTweets is per target, so your ceiling is maxTweets × number of targets.
Time windows reduce cost on scheduled runs — a tight window returns only genuinely new posts instead of re-collecting the same results.
Current rates are on the Pricing tab of this Actor's page, and Apify shows an estimate before and during every run. Residential proxy traffic is billed separately by the platform.
Limits, reliability and blocking
- Time windows require
latestmode. Withtopthey are ignored, because X's Top ranking has no recency cut-off. timeWindowHoursoverridestimeWindowwhen both are set.- Single-tweet links are skipped. Give it profiles, handles, keywords or
search:queries. maxTweetsis per target, so five targets at 200 each can return up to 1,000 rows.- Residential proxy is strongly recommended. X blocks datacenter IPs aggressively, and a direct connection often returns nothing.
- Search results are ranked and filtered by X — they are not an exhaustive archive of every matching post.
- A tight time window returns few rows by design. A 2-hour window on a quiet keyword may return nothing; that is a correct result.
- Media URLs expire — they point at X's CDN.
- Default run options are 4 GB memory and a 1-hour timeout.
Is it legal to scrape X search results?
This Actor collects only publicly available X search results — the same posts any visitor can find without logging in. It does not log in, post, follow, or access private accounts or direct messages.
Posts and media remain the property of their authors, and handles, bios and follower data are personal data. Ensure your use complies with X's terms, copyright, and GDPR or comparable regulations, particularly when monitoring conversations about identifiable individuals.
❓ Frequently asked questions
Do I need an X API key or paid plan?
No. The Actor reads public search results without a developer account.
How do I monitor something in real time?
Set searchType: "latest" and timeWindowHours to the interval you schedule at — hourly runs with a 1-hour window, for example.
Can I use X's advanced search operators?
Yes. Prefix the target with search: and write the query exactly as you would in X's search box.
What is the difference between Top and Latest?
top returns what X ranks as popular and relevant, good for trend analysis. latest returns newest first and is the only mode that supports time windows.
Why is my time window being ignored?
Because searchType is top. Time windows only apply in latest mode.
Why did I get no results?
Either the time window is very tight and nothing matched, or the run was blocked. Widen the window first, then check that residential proxy is enabled.
Can I scrape a single tweet by URL?
No — single-tweet links are skipped. Use profiles, handles, keywords or search: queries.
Do keywords and profiles behave differently?
Yes. Multi-word input is treated as a search; a single word or URL is treated as an account timeline.
Which export format should I use?
JSON — author and media are nested objects. CSV works if you only need post text and counts.
🔗 Related scrapers
- X (Twitter) Posts Scraper — deep timeline extraction, up to 1,000 posts per profile.
- X Posts Scraper (Twitter) — flat output with views and bookmarks, and sorted results.
- Twitter Profile Scraper — date-bounded extraction with replies and about data.
- Truth Social Scraper — the same monitoring approach on another platform.
Browse the full collection on the ScraperForge profile.
💬 Feedback
Need deeper search coverage, extra operators, or a custom listening pipeline? Open an issue on the Issues tab of this Actor.