X Twitter Posts Search By Advanced Keyword Filters
Pricing
from $2.99 / 1,000 results
X Twitter Posts Search By Advanced Keyword Filters
X (Twitter) Posts Search — Search X posts using advanced keyword filters and extract post text, authors, hashtags, timestamps, replies, likes, reposts, views, and links. Analyze conversations, trends, audience engagement, and competitor activity with structured data.
Pricing
from $2.99 / 1,000 results
Rating
0.0
(0)
Developer
SimpleAPI
Maintained by CommunityActor stats
0
Bookmarked
8
Total users
0
Monthly active users
6 hours ago
Last modified
Categories
Share
X Twitter Posts Search By Advanced Keyword Filters
An X (Twitter) scraper that turns X's advanced search page into real input fields. Instead of one blunt keyword box, you get from:, to:, @mentions, #hashtags, exact phrase, OR groups, exclusions, url: domain matching, media/links/replies/verified/quote filters, lang:, a since:-until: date range and minimum likes/reposts/replies — every one a genuine X search operator applied server-side by X, not a post-hoc filter over a bloated result set.
Every operator this actor exposes was measured live against X and shipped with its actual hit rate: url: domain matching held 19/20, from: and hashtag filters held 20/20, exact-phrase matching held 18/20 (X stems phrases, so it's honestly labeled as strong-not-literal matching). Nothing here is a guessed or unverified claim.
What is X Twitter Posts Search By Advanced Keyword Filters?
It's an Apify actor that runs X's own advanced-search query syntax against X's SearchTimeline GraphQL endpoint, with every operator exposed as a dedicated input field instead of requiring you to write raw query syntax. Give it a keyword, hashtag, profile or search URL as a target, layer on any combination of operators, and it returns matching posts with the exact query it built echoed back in searchApplied.builtQuery for auditing. Keyword and operator search require your own logged-in X session (auth_token + ct0 cookies) — X answers logged-out keyword search with a hard HTTP 404, there is no guest tier for it. Profile targets (@handle) still work fully logged-out.
What data can I extract with X Twitter Posts Search By Advanced Keyword Filters?
Post rows (rowType: "post", charged):
| Field | Description |
|---|---|
postText / postUrl / postId / postedAt | Post content, link, ID and exact UTC timestamp. |
author | Object: name, screenName, followersCount, friendsCount, description. |
authorIsBlueVerified / authorStatusesCount | Author verification and post-count context. |
favouriteCount / repostCount / replyCount / quoteCount / viewCount / bookmarkCount | Engagement counters. |
lang | X's own detected language for the post. |
hashtags / mentions / links | Extracted entities. |
isReply / inReplyToScreenName / inReplyToPostId | Reply context. |
isQuote / quotedPostId / quotedPostUrl | Quote-post context. |
isRetweet / repostedBy | Repost flag and the actual reposting account (not silently rewritten to the original author). |
media | Array of {mediaUrlHttps, type, id}. |
searchApplied | Object recording exactly what was searched: builtQuery, operatorsApplied, searchStatus, postsReturned, rateLimitRemaining. |
Run-status rows (rowType: "run_status", uncharged): emitted when a target returns zero posts, with searchApplied.errorReason explaining why (login_required, rate_limited, empty, etc.) — so an empty result is always explained, never a silent zero.
Why not build this yourself?
X's SearchTimeline endpoint changed to POST-only in mid-2026 — a GET request now answers with an HTTP 404 and a zero-byte body, which is easy to build against, ship, and never notice is silently returning nothing. This actor issues real POST requests, detects blocks by status code and resolved URL and the actual presence of the expected response container (not just a status code), and re-harvests X's current GraphQL query IDs automatically when a retired one starts 404ing. It also fixes a repost-attribution bug common to naive builds: a repost's isRetweet/repostedBy fields report the actual reposting account instead of silently collapsing to the original author.
Two honest limits worth knowing: X enforces roughly 187 search calls per 15 minutes per session (20 posts per call, ~3,700 posts per window) — the actor reads the live quota from X's response headers and stops cleanly rather than burning past it. And exact-phrase / OR-group matching is X's own server-side behavior, not this actor's: X stems and loosens these matches (measured 18/20 and 15/20 literal-word hit rates respectively), so they're documented as strong matching, not guaranteed literal matching.
How to use data extracted from X Twitter Posts Search By Advanced Keyword Filters?
- Brand monitoring teams — track mentions of a brand or product with
mentionsAccountsplusminLikesto surface only posts with real traction. - Market and trend researchers — combine
hashtags,searchDateFrom/searchDateToandsearchLanguageto build a precise, dated, language-scoped post corpus. - PR and journalism — use
linkDomainto find every post linking to a specific news source or press release, the most precise single operator measured (19/20 hit rate). - Growth marketers — use
fromAccountsas an OR group to monitor a competitor set's posting activity in one run.
🔼 Input sample
| Parameter | Required | Type | Description | Example |
|---|---|---|---|---|
startUrls | Yes | array | Targets: keyword(s), #hashtag, raw operator string ("search: python from:NASA min_retweets:50"), X search/hashtag URL, @handle/profile URL, or * to search on advanced filters alone. | ["@NASA", "climate change"] |
searchType | Yes | string | top (popularity ranking, spans years) or latest (strictly newest first). Doesn't affect profile targets. | "top" |
maxTweets | No | integer | Cap posts per target (1-10000). X returns 20 per call. Default 10. | 10 |
timeWindow / timeWindowHours | No | integer | Keep only posts newer than N days/hours, enforced on both search modes. Hours takes precedence if both set. | 7 |
xAuthToken / xCt0 | No | string (secret) | Your logged-in X auth_token + ct0 cookies. Common pitfall: required for every keyword/operator target — X returns HTTP 404 with a zero-byte body for logged-out keyword search, no workaround exists. Profile targets work without them. | "a1b2c3..." |
exactPhrase | No | string | Quoted exact-phrase match. X stems phrases — measured 18/20 literal hit rate. | "space launch" |
anyOfWords | No | array | OR group of words. Measured 15/20 literal hit rate — X also matches stems/linked text. | ["rocket", "launch"] |
excludeWords | No | array | Each becomes -word. Verified 20/20. | ["spam"] |
hashtags | No | array | Each becomes #tag. Verified 20/20. | ["NASA"] |
fromAccounts / toAccounts / mentionsAccounts | No | array | from:/to:/@mention operators, ORed if multiple. All verified 20/20. | ["NASA"] |
linkDomain | No | string | url:domain — strongest single operator measured (19/20). | "nasa.gov" |
conversationId | No | string | All posts in one thread (conversation_id:). Verified 20/20. | "1234567890" |
contentTypes / excludeContentTypes | No | array | filter: / -filter: toggles: media, images, videos, links, replies, verified, quote, native reposts. All verified 20/20 individually; combining mutually exclusive choices legitimately returns nothing. | ["media", "verified"] |
minLikes / minReposts / minReplies | No | integer | min_faves:/min_retweets:/min_replies:. All verified 20/20. | 500 |
searchLanguage | No | string | lang:xx filter. Verified 20/20 for Spanish and Japanese. Default "any". | "es" |
searchDateFrom / searchDateTo | No | string | since:/until: date bounds (YYYY-MM-DD or relative like "7 days ago"). Verified 20/20 in-bounds. until: is exclusive of that day's later hours. | "2026-01-01" |
proxyConfiguration | No | object | Optional. X session cookies survive IP changes, so proxy is about IP hygiene, not unblocking. Default RESIDENTIAL. | {"useApifyProxy": true} |
{"startUrls": ["climate change"],"searchType": "top","maxTweets": 20,"minLikes": 500,"searchLanguage": "en","xAuthToken": "YOUR_X_AUTH_TOKEN","xCt0": "YOUR_X_CT0_TOKEN"}
🔽 Output sample
{"postText": "Example post about climate change with real engagement","postUrl": "https://x.com/exampleuser/status/1234567890123456789","postId": "1234567890123456789","postedAt": "2026-07-20T14:03:00.000Z","author": { "name": "Example User", "screenName": "exampleuser", "followersCount": 12000 },"favouriteCount": 812,"repostCount": 140,"viewCount": 95000,"lang": "en","hashtags": ["climate"],"isRetweet": false,"rowType": "post","searchApplied": {"builtQuery": "climate change min_faves:500 lang:en","searchStatus": "ok","postsReturned": 20}}
How do you filter and target specific X posts?
Stack operators as needed — every field maps to a real X search operator, and the exact built query is echoed back on every row for auditing.
High-engagement English posts on a topic:
{ "startUrls": ["climate change"], "minLikes": 500, "searchLanguage": "en" }
Posts from a specific account set, replies excluded:
{ "startUrls": ["*"], "fromAccounts": ["NASA", "SpaceX"], "excludeContentTypes": ["replies"] }
Posts linking to a specific domain in a date range:
{ "startUrls": ["*"], "linkDomain": "nasa.gov", "searchDateFrom": "2026-01-01", "searchDateTo": "2026-02-01" }
▶️ Want to try other scrapers?
| Actor | What it does |
|---|---|
| twitter-x-posts-scraper-replies | Scrape a profile's posts with full reply threads. |
| twitter-x-reply-scraper-with-replier-contact-leads | Pull X reply-author contact leads. |
| twitter-trends-scraper-by-city-multiple-countries | Track trending topics across cities and countries. |
How to extract X posts programmatically
from apify_client import ApifyClientclient = ApifyClient("<YOUR_API_TOKEN>")run = client.actor("SimpleAPI/x-twitter-posts-search-by-advanced-keyword-filters").call(run_input={"startUrls": ["climate change"],"searchType": "top","maxTweets": 20,"minLikes": 500,"xAuthToken": "YOUR_X_AUTH_TOKEN","xCt0": "YOUR_X_CT0_TOKEN",})for item in client.dataset(run["defaultDatasetId"]).iterate_items():if item.get("rowType") == "post":print(item["author"]["screenName"], item["favouriteCount"], item["postText"][:60])
Every run's dataset can also be exported straight to JSON, CSV, Excel or an API endpoint from the Apify Console — no code needed for a one-off pull.
Is it legal to scrape X (Twitter) posts?
Scraping publicly accessible data is generally lawful in the US under the precedent set in hiQ Labs v. LinkedIn, which held that scraping data not gated behind a login does not violate the Computer Fraud and Abuse Act. This actor reads posts that are publicly visible to any logged-in X user — the session cookie it uses is a viewing credential only, not a way to access private content. If you extract data tied to identifiable people, GDPR (EU) and CCPA (California) still govern what you do with it, so review your own use case, especially for storage, resale or profiling.
❓ FAQ
Why do I need my own X auth_token and ct0 cookies for keyword search?
X's SearchTimeline endpoint answers logged-out requests with a hard HTTP 404 — there is no guest tier for keyword or operator search. Profile targets (@handle) still work without a session, using X's guest-accessible profile timeline instead.
How accurate are the advanced-search operators? Every operator on this actor was measured live against X before shipping, and the honest hit rate is documented in its input description — most operators (from:, hashtags, min_faves, filter:media, etc.) verified 20/20; exact-phrase and OR-group matching verified lower (18/20 and 15/20) because X itself stems and loosens those matches server-side.
What happens when a search matches nothing?
An uncharged run_status row is pushed with searchApplied.errorReason set (e.g. empty, login_required, rate_limited) — a target that returns zero posts is always explained in the dataset, never a silent gap.
Does searchType: "latest" change profile target results?
No. X's profile timeline API has no sort parameter, so searchType only affects keyword/operator search targets, not @handle profile targets.
Why is repostedBy sometimes different from the post author?
When a returned post is a repost, X's own data separates the original author from the account that reposted it. This actor reports both correctly — author is the original poster, repostedBy is the account that reposted, rather than collapsing them into one.
How many search calls does X allow?
Roughly 187 calls per 15-minute window per X account, 20 posts per call (~3,700 posts per window). The actor reads the live remaining-quota count from X's own response headers and stops cleanly before exhausting it, logging rateLimitRemaining on every row.
Can I combine advanced filters with a plain keyword?
Yes — any keyword target is combined with every advanced filter you've set into one server-side query, and the exact resulting query string is echoed in searchApplied.builtQuery so you can verify or reuse it.
How is this different from other X search scrapers on Apify? As observed on the Apify Store on 2026-07-26, most X search actors we reviewed expose a single free-text query field and leave operator syntax to you to write and debug yourself. This one exposes every operator as a dedicated, individually-verified input field.
Conclusion
X Twitter Posts Search By Advanced Keyword Filters turns X's full advanced-search operator set into structured input fields with measured, documented accuracy — precise targeting without hand-writing or debugging query syntax.