X (Twitter) Advanced Search Scraper & API avatar

X (Twitter) Advanced Search Scraper & API

Pricing

from $0.40 / 1,000 x post results

Go to Apify Store
X (Twitter) Advanced Search Scraper & API

X (Twitter) Advanced Search Scraper & API

Search public X (Twitter) posts by keyword, hashtag, or account. Filter by date, language, media, and engagement. Run up to 25 searches and export tweets, author profiles, metrics, and X Articles as JSON or CSV for social listening and competitor research. No X login or X API key required.

Pricing

from $0.40 / 1,000 x post results

Rating

0.0

(0)

Developer

ArjunAI Data

ArjunAI Data

Maintained by Community

Actor stats

0

Bookmarked

5

Total users

0

Monthly active users

4 days ago

Last modified

Features

Limited permissions

Share

Find and export public X (Twitter) posts for social listening, campaign reporting, and competitor research. Start with keywords, a hashtag, or an account. Use the form filters or enter an advanced X search query directly.

Run up to 25 searches in one run and export post text, links, author profiles, engagement metrics, media, and available X Article content. Download the Dataset as JSON, CSV, or Excel. No X login, cookies, or X API key required.

Try a social listening search. Use the prefilled five-post preview or open Track Latest AI Agent Posts to save up to 10 recent English-language posts. Saving 10 posts costs $0.00755 in event charges at the Free rate and default memory, including the start event.

๐Ÿ”Ž Quick start

  1. Replace the sample AI agents in Keywords or search queries. Enter one search per line.
  2. Pick Latest posts for the newest results or Top posts for X's relevance ranking.
  3. Set Posts to save per search. Start with 5 for a preview, and select Any language to search across languages.
  4. Click Start. Open Output to preview the results or download the Dataset.

๐Ÿ’ก To search by a phrase, hashtag, stock or crypto symbol, or account alone, clear the sample keyword and open the matching input section.

Input example in Apify Console

Advanced X/Twitter search input configured in Apify Console

Try the example input

The Console example searches for AI agents and saves up to 5 recent posts classified as English by X.

{
"searchQueries": ["AI agents"],
"searchMode": "Latest",
"maxPostsPerQuery": 5,
"language": "en"
}

๐ŸŽฏ Search options

Where to look in the formWhat to enterAPI fields
Keywords or search queriesOne keyword search or X query per line, such as AI agents or from:OpenAI.searchQueries
Result order, post limit, and languageChoose Latest or Top, how many posts to save for each search, and a language. The API defaults to Latest, 100 posts per search, and any language.searchMode, maxPostsPerQuery, language
๐Ÿ’ฌ Phrases, hashtags & symbolsEnter an exact phrase, any of several words, hashtags such as #AI, or symbols such as $BTC.exactPhrase, anyWords, hashtags, cashtags
๐Ÿ‘ค Search by accountFind posts written by, sent as replies to, or mentioning selected accounts. Enter a username, @handle, or profile URL.fromUsers, toUsers, mentionUsers
๐Ÿ“… Date range (UTC)Set either date or both. Both selected dates are included.startDate, endDate
๐Ÿ–ผ๏ธ Post type & mediaChoose original posts, replies, reposts, or quotes. Filter by images, videos, links, or any media.postType, mediaType
๐Ÿ“ˆ Minimum engagementSet minimum likes, reposts, or replies. Leave a count at 0 to skip that filter.minLikes, minRetweets, minReplies
โž– Exclude matchesLeave out words, phrases, hashtags, or posts from specific accounts.excludeWords, excludeHashtags, excludeFromUsers

Every line in Keywords or search queries runs separately with the same selected filters. Two lines with a limit of 25 can save up to 50 posts. In a single field such as hashtags, entering AI and MachineLearning allows either tag to match. Conditions from different fields are combined.

The form adds its filters to every query. If your query already includes a language operator such as lang:ja, select Any language so the query controls the language.

Use keywords, a phrase, a hashtag, a symbol, or an account to start. Dates, post type, exclusions, and engagement refine that search. Set Posts to save per search to 0 to collect the result pages X makes available.

Search recipes

GoalSettings to try
Collect posts for a campaign reportClear the sample keyword, add the campaign hashtag, and set the campaign dates.
Compare two accounts during the same weekEnter from:OpenAI and from:AnthropicAI on separate lines. Choose a date range and Original posts.
Find popular discussions about a topicEnter the topic, choose Top posts, and set a minimum like count, such as 100.

For example, compare original posts from two accounts in a single run. The Dataset keeps the originating search in search_query.

{
"searchQueries": ["from:OpenAI", "from:AnthropicAI"],
"searchMode": "Latest",
"maxPostsPerQuery": 10,
"startDate": "2026-11-01",
"endDate": "2026-11-07",
"postType": "originals"
}

๐Ÿ“Š Output

Each successful Dataset item represents one public X post. Overview shows the key text, author, date, and engagement counts. Open Authors, Articles, or Media for more detail, and All fields for the complete result. The JSON export groups author and Article data into author and article objects.

Advanced X/Twitter search results in the Apify Dataset

GroupFields
Search contextstatus, search_query, compiled_query, search_mode, result_position
Posttweet_id, tweet_url, post_type, created_at, text, display_text, language, scraped_at
Engagementreply_count, retweet_count, quote_count, like_count, bookmark_count, view_count
Authorauthor: identity, bio, location, creation date, follower/following/post counts, verification, professional categories, and affiliations
RelationshipsReply target IDs and reply_to_name; retweeter, retweeted_post, quoted_post, quoted_tweet_id, quoted_tweet_url
Rich contentmedia, media_types, card, is_article, article, content_disclosure
Editingedit_tweet_ids, edit_count, is_edited

Complete JSON result

This recorded result shows all 58 fields of a successful item, including the complete author object and video variants. To try the same search, clear the sample keyword, enter https://x.com/OpenAI under Posts from accounts, and choose Original posts, Latest posts, and Any language. Set Posts to save per search to 2.

{
"status": "success",
"search_query": "from:OpenAI -filter:replies -filter:nativeretweets -filter:quote",
"compiled_query": "from:OpenAI -filter:replies -filter:nativeretweets -filter:quote",
"search_mode": "Latest",
"result_position": 1,
"tweet_id": "2120216592395174382",
"tweet_url": "https://x.com/OpenAI/status/2120216592395174382",
"conversation_id": "2120216592395174382",
"created_at": "2026-11-10T18:06:42Z",
"text": "Now in beta: Businesses in ChatGPT.\n\nClaim your business, manage your information, and get insights on how people engage with you.\n\nEligible businesses can also build a Business Agent to answer customersโ€™ questions and help them explore what you offer.\n\nhttps://t.co/N2GEZX0mFT https://t.co/lYj2Z48fhQ",
"is_longform": false,
"is_article": false,
"article": null,
"note_tweet_id": null,
"language": "en",
"source_name": null,
"reply_count": 1295,
"retweet_count": 1385,
"quote_count": 1455,
"like_count": 17329,
"bookmark_count": 19083,
"view_count": 5475676,
"possibly_sensitive": false,
"is_quote": false,
"is_reply": false,
"in_reply_to_tweet_id": null,
"in_reply_to_user_id": null,
"in_reply_to_username": null,
"hashtags": [],
"cashtags": [],
"mentions": [],
"urls": [
{
"url": "https://t.co/N2GEZX0mFT",
"expanded_url": "https://openai.com/index/introducing-businesses-chatgpt/",
"display_url": "openai.com/index/introducโ€ฆ"
}
],
"media_count": 1,
"media_types": [
"video"
],
"media_source_urls": [
"https://video.twimg.com/amplify_video/2120214011451170817/vid/avc1/1920x1080/vyZP9JTfX10iThi9.mp4?tag=29"
],
"media": [
{
"origin": "tweet",
"media_id": "2120214011451170817",
"media_key": "13_2120214011451170817",
"type": "video",
"preview_image_url": "https://pbs.twimg.com/amplify_video_thumb/2120214011451170817/img/p-eqRNRKImbCTq9L.jpg",
"source_url": "https://video.twimg.com/amplify_video/2120214011451170817/vid/avc1/1920x1080/vyZP9JTfX10iThi9.mp4?tag=29",
"content_type": "video/mp4",
"requested_quality": "highest",
"selected_quality": "1080p",
"selected_resolution": "1920x1080",
"available_resolutions": [
"1920x1080",
"1280x720",
"640x360",
"480x270"
],
"media_page_url": "https://x.com/OpenAI/status/2120216592395174382/video/1",
"availability_status": "Available",
"alt_text": null,
"width": 1920,
"height": 1080,
"duration_millis": 48600,
"aspect_ratio": [
16,
9
],
"hls_url": "https://video.twimg.com/amplify_video/2120214011451170817/pl/QiogQZ8zkTrcsBbj.m3u8?tag=29&v=cfc",
"video_variants": [
{
"bitrate": 10368000,
"content_type": "video/mp4",
"width": 1920,
"height": 1080,
"url": "https://video.twimg.com/amplify_video/2120214011451170817/vid/avc1/1920x1080/vyZP9JTfX10iThi9.mp4?tag=29"
},
{
"bitrate": 2176000,
"content_type": "video/mp4",
"width": 1280,
"height": 720,
"url": "https://video.twimg.com/amplify_video/2120214011451170817/vid/avc1/1280x720/tAlQ0lSPuhWNS5eb.mp4?tag=29"
},
{
"bitrate": 832000,
"content_type": "video/mp4",
"width": 640,
"height": 360,
"url": "https://video.twimg.com/amplify_video/2120214011451170817/vid/avc1/640x360/ouLZLxhXwImfvFrC.mp4?tag=29"
},
{
"bitrate": 256000,
"content_type": "video/mp4",
"width": 480,
"height": 270,
"url": "https://video.twimg.com/amplify_video/2120214011451170817/vid/avc1/480x270/ntHnarm_Ea5fkmPs.mp4?tag=29"
}
],
"sensitive_warnings": []
}
],
"translation_available": false,
"translated_text": null,
"translation_source_language": null,
"translation_target_language": null,
"translated_entities": {
"hashtags": [],
"cashtags": [],
"mentions": [],
"urls": []
},
"is_edited": false,
"edit_count": 0,
"edit_tweet_ids": [
"2120216592395174382"
],
"author": {
"id": "4398626122",
"username": "OpenAI",
"name": "OpenAI",
"profile_url": "https://x.com/OpenAI",
"description": "OpenAIโ€™s mission is to ensure that artificial general intelligence benefits all of humanity. Weโ€™re hiring: https://t.co/dJGr6LgzPA",
"description_entities": {
"hashtags": [],
"cashtags": [],
"mentions": [],
"urls": [
{
"url": "https://t.co/dJGr6LgzPA",
"expanded_url": "http://openai.com/jobs",
"display_url": "openai.com/jobs"
}
]
},
"profile_language": "en",
"location": null,
"created_at": "2015-12-06T22:51:08Z",
"followers_count": 5531370,
"following_count": 4,
"tweets_count": 2241,
"media_count": 769,
"favourites_count": 2605,
"verified": false,
"verified_type": "Business",
"blue_verified": true,
"protected": false,
"possibly_sensitive": false,
"account_label": null,
"professional_type": null,
"professional_categories": [],
"affiliation_name": null,
"affiliation_url": null,
"affiliation_badge_url": null,
"pinned_tweet_ids": [
"2114780711664398349"
],
"profile_image_url": "https://pbs.twimg.com/profile_images/1885410181409820672/ztsaR0JW_normal.jpg",
"profile_banner_url": "https://pbs.twimg.com/profile_banners/4398626122/1777662919",
"website_url": "https://openai.com",
"can_media_tag": true,
"super_follow_eligible": false,
"profile_image_shape": "Square",
"profile_interstitial_type": null
},
"scraped_at": "2026-11-12T06:26:43Z",
"display_text": "Now in beta: Businesses in ChatGPT.\n\nClaim your business, manage your information, and get insights on how people engage with you.\n\nEligible businesses can also build a Business Agent to answer customersโ€™ questions and help them explore what you offer.\n\nhttps://t.co/N2GEZX0mFT",
"display_text_range": [
0,
277
],
"content_disclosure": null,
"post_type": "original",
"is_retweet": false,
"reply_to_name": null,
"card": null,
"retweeter": null,
"retweeted_post": null,
"quoted_post": null,
"quoted_tweet_id": null,
"quoted_tweet_url": null
}

Counts and text in live X data change over time. Optional fields can be null, empty, or absent when X does not provide them for a result.

  • Original post or reply: author describes the account that published the result.
  • Retweet: author is the retweeting account. retweeter keeps its compact identity, while retweeted_post.author describes the original writer. Use retweeted_post.text and its engagement counts to analyze the original content.
  • Quote: the comment and commenting account are at the top level; quoted_post contains the original post, its own author, and its own metrics. If the original is unavailable, quoted_post is null; X may still provide quoted_tweet_id and quoted_tweet_url.
  • Reply: in_reply_to_tweet_id, in_reply_to_user_id, and in_reply_to_username identify the reply target. reply_to_name is included when the response contains that user's name.

The author object also includes available media counts, likes given (favourites_count), website, avatar, banner, account label, professional categories, and affiliation. blue_verified and verified_type help identify X verification. Optional fields such as can_media_tag, super_follow_eligible, profile_image_shape, and profile_interstitial_type are returned when X provides them; missing values remain null.

Article, media, and Card details

ObjectAvailable fields and meaning
articleid, url, title, preview_text, summary_text, text, published_at, modified_at, cover_image_url, media_count, block_count, links. The full body is in text when X includes it; a preview does not guarantee the full Article is available.
mediaImage/video URLs, previews, type, dimensions, alt text, duration, available resolutions, video variants, and HLS URL where available. This Actor exports metadata and source links; use Media Downloader to save the files.
cardCard type, title, description, domain, image, player, and destination_url where available. component_types identifies richer Cards, including shared Grok conversations, without expanding the conversation into the result.
content_disclosureX's available AI-generated media disclosure. A missing disclosure is not proof that content was made without AI.

Examples of populated objects

X Article

An Article post has is_article: true and an article object. This example shows every Article field with a short excerpt in text.

{
"is_article": true,
"article": {
"id": "2120756953639256066",
"url": "https://x.com/i/article/2120756953639256066",
"title": "AI;DR",
"preview_text": "Writing culture is dying. How do we ensure it doesn't take our pursuit of understanding with it?\n\nWhat started happening to software engineering one year ago is now unfolding across the rest of",
"summary_text": null,
"text": "Writing culture is dying. How do we ensure it doesn't take our pursuit of understanding with it? [...]",
"published_at": "2026-11-12T06:03:41Z",
"modified_at": "2026-11-12T06:03:41Z",
"block_count": 10,
"links": [
"https://alifeengineered.substack.com/p/on-the-death-of-amazons-writing-culture",
"https://simonwillison.net/2026/Aug/3/dont-be-a-meat-proxy/",
"https://x.com/shaneparrish/status/2099852161576223202"
],
"cover_image_url": null,
"media_count": 0
}
}

A post with a link preview can include the following card fields.

{
"card": {
"name": "summary_large_image",
"url": "https://t.co/xT7g24tUqs",
"domain": "economictimes.indiatimes.com",
"title": "Japan's Nikkei rises as tech stocks gain despite Nvidia uncertainty",
"description": "Japans Nikkei rose 0.33%, while the Topix gained 0.59%, driven by strength in technology stocks despite uncertainty surrounding Nvidias leadership. Nvidia-linked suppliers Advantest and Ibiden...",
"vanity_url": "economictimes.indiatimes.com",
"image_url": "https://pbs.twimg.com/card_img/2120747918235942912/9ElAzBxz?format=jpg&name=orig",
"image_width": 1200,
"image_height": 900,
"player_url": null,
"destination_url": "https://economictimes.indiatimes.com/markets/us-stocks/news/japans-nikkei-rises-as-tech-stocks-gain-despite-nvidia-uncertainty/articleshow/135755371.cms?utm_source=contentofinterest&utm_medium=text&utm_campaign=cppst",
"component_types": []
}
}

Reposts and quotes

A repost can include a compact retweeter identity.

{
"retweeter": {
"id": "1363595310618931200",
"username": "kazuhikokawazu",
"name": "kazuhikokawazu",
"profile_url": "https://x.com/kazuhikokawazu"
}
}

The retweeted_post and quoted_post objects use the same post fields as the complete example above, including their own author, article, media, and engagement counts. The search context fields belong to the outer result.

Content disclosure

X can include an AI-generated media disclosure on a post.

{
"content_disclosure": {
"ai_generated_disclosure": {
"has_ai_generated_media": true,
"ai_generated_detection_source": "C2paClient"
}
}
}

Text, timestamps, and counts

  • text preserves the full post text provided by X, including long posts. display_text uses X's visible-text range when available; display_text_range contains the original UTF-16 offsets.
  • Timestamps use UTC ISO 8601. created_at is the post's creation time; scraped_at is when the Actor extracted it.
  • view_count: null means X did not supply a count, not zero views.
  • edit_count counts modifications: 0 for a known unedited post, 1 for one edit, or null if X does not provide edit history. Earlier versions counted the original version as an edit.
  • result_position is the saved position within this search, not a global X ranking.

Use author.username to read the publisher and article.title for an attached X Article. Ordinary posts have article: null.

Your next stepWhere to go
Find topics to searchGet current trends by country or city, then copy a topic into Keywords or search queries. X (Twitter) Trends Scraper
Read the conversation under a saved postPass its tweet_url to collect visible replies, authors, and thread context. X (Twitter) Replies Scraper
Find who reposted or quoted a postPass its tweet_url to export reposting accounts and quote posts. X (Twitter) Retweeters & Quote Tweets Scraper
Download the media filesPass selected post URLs to save videos, images, GIFs, and X Article images. X (Twitter) Video & Media Downloader
Track performance of selected postsPass the post URLs to save engagement snapshots and compare changes over time. X (Twitter) Post Performance & Growth Monitor
Find accounts that match a topicSearch by keyword for profiles and filter by follower count, verification, or location. X (Twitter) People Search Scraper

Empty results and query failures

If settings pass Apify's initial input checks but need correction, the Dataset receives an uncharged invalid_input row explaining what to fix. Apify rejects invalid field types or input lists over the allowed limit before starting a run. A valid search with no public matches produces an uncharged no_results row.

The examples below show the complete field sets for an empty search, an invalid date range, and a search that saved some posts before failing on a later page. A request_failed row uses the same fields as partial with results_saved: 0.

[
{
"status": "no_results",
"message": "No public posts matched this search. Try broader terms, fewer filters, a wider date range, or a different result order.",
"search_query": "Nikkei Nvidia",
"compiled_query": "Nikkei Nvidia from:ETMarkets since:2026-11-12 until:2026-11-13",
"search_mode": "Latest",
"tweet_id": ""
},
{
"status": "invalid_input",
"message": "Posted on or after cannot be later than Posted on or before. Change the date range and run the Actor again.",
"invalid_field": "startDate/endDate",
"search_query": "",
"compiled_query": "",
"search_mode": "Latest",
"tweet_id": "",
"suggested_input": {
"startDate": "2026-11-10",
"endDate": "2026-11-12"
}
},
{
"status": "partial",
"message": "Saved 20 unique posts before a later page failed. Try this search again later.",
"search_query": "AI agents",
"compiled_query": "AI agents lang:en",
"search_mode": "Latest",
"results_saved": 20,
"tweet_id": ""
}
]

When a run contains several searches, one failed search does not stop the remaining searches. A query that fails before saving a post produces request_failed; a later-page failure produces partial with results_saved. Already saved results stay in the Dataset.

Pricing

This Actor uses pay-per-event pricing. It charges a small start event based on allocated memory and one post-result event for every successfully saved post.

EventFreeBronzeSilverGold / Platinum / Diamond
Actor start, per 1 GB of allocated memory; minimum one event$0.00005$0.00005$0.00005$0.00005
Successfully saved X post (post-result)$0.00075$0.00060$0.00050$0.00040

At the Free-tier result price, a run using the default 1 GB memory costs approximately $0.00380 for 5 posts, $0.07505 for 100 posts, or $0.75005 for 1,000 posts. A run that returns no posts costs only the $0.00005 start event.

invalid_input, no_results, request_failed, and partial status rows do not trigger a post-result charge. Duplicate post IDs returned on different pages of the same search are removed before charging. The same post can be saved and charged once for each separate query that returns it because every result keeps its query attribution.

Use maxPostsPerQuery and Apify's Maximum cost per run setting to control spending. The Actor's Pricing tab is authoritative if prices change.

๐Ÿค– Use with an AI agent via MCP

The hosted Apify MCP server exposes this Actor as the tool arjun_code--x-twitter-advanced-search-scraper.

  1. Add a remote HTTP MCP server in your agent or assistant. Use the URL from the configuration below. Clients that accept an mcpServers configuration can copy the full JSON.
  2. Sign in to Apify through OAuth when prompted. For clients that authenticate with request headers, add Authorization: Bearer <APIFY_TOKEN> in the client's secret settings.
  3. Ask the agent to run the Actor with the same input fields shown in Search options, such as searchQueries, searchMode, and maxPostsPerQuery.
  4. Once the run completes, pass its Dataset ID to get-dataset-items as datasetId. If the run is still in progress, check it with get-actor-run first. Use limit and offset to read larger Datasets in pages.
{
"mcpServers": {
"apify-x-advanced-search": {
"type": "http",
"url": "https://mcp.apify.com/?tools=arjun_code/x-twitter-advanced-search-scraper"
}
}
}

Try this prompt in your connected agent.

Use the X Advanced Search tool to find up to 5 recent English posts about AI agents. Set searchQueries to ["AI agents"], searchMode to Latest, maxPostsPerQuery to 5, and language to en. When the run finishes, read its Dataset and return the post link, author username, publication date, text, and like count for each successful row.

MCP runs use the Actor's usual pricing. For setup in your specific client, use the Apify MCP configurator or follow the Apify agent quickstart.

Run with the Apify API

curl -X POST \
"https://api.apify.com/v2/actors/arjun_code~x-twitter-advanced-search-scraper/runs" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"searchQueries": ["AI agents"],
"searchMode": "Latest",
"maxPostsPerQuery": 25,
"language": "en"
}'

The run response contains defaultDatasetId. Use the Dataset API to retrieve the saved items. You can also start runs with the Apify Python or JavaScript client, schedule recurring searches, connect webhooks, or send Dataset results to other integrations.

FAQ

Do I need an X account, cookies, or an API key?

Provide your search conditions in Apify. API requests to Apify use your Apify API token.

Why did I receive fewer posts than requested?

maxPostsPerQuery is an upper limit. X may expose fewer matching posts, stop returning result pages, or return duplicates that the Actor removes within the query.

Why does a result match without showing my keyword in the post text?

X can match text in attached Articles or link Cards. An image filter can also include a Card with an image preview.

What does 0 = all mean?

Setting maxPostsPerQuery to 0 tells the Actor to keep following result pages until X stops providing another usable page. It does not guarantee every historical post because availability is controlled by X. More pages can also increase run time and cost.

Are duplicate posts charged more than once?

Not within the same search: duplicate post IDs are removed before storage and charging. If the same post matches two separate queries, it can appear and be charged once under each query so the search attribution remains accurate.

What happens when one query fails in a batch?

The Actor writes an uncharged request_failed or partial status row for that query and continues with the remaining queries. Results already saved from completed pages stay available.

What does an empty search cost?

An empty result writes an uncharged no_results row. With the default 1 GB memory, the run still has the $0.00005 Actor start charge.

Limitations

  • Result ranking, availability, and pagination are controlled by X and can change between runs.
  • Deleted, private, withheld, restricted, or otherwise unavailable posts may not appear.
  • maxPostsPerQuery is an upper limit, not a guaranteed result count.
  • Very selective searches may expose fewer results than requested.
  • X can change its web responses or temporarily limit access.

Use the data responsibly and comply with applicable laws, privacy requirements, X's terms, and Apify's terms. This independent Actor is not affiliated with, endorsed by, or sponsored by X Corp.

Support

If a run fails or the output changes, open an issue on the Actor page and include the Apify run ID, input, and expected behavior. Do not include passwords, cookies, tokens, or other secrets.