# X (Twitter) Advanced Search Scraper | $0.12/1K | All Operators (`feedminer/x-advanced-search-scraper`) Actor

Run X (Twitter) advanced search without learning its syntax. Filter by account, mentions, replies, language, date window, likes, reposts, media and verification, then export every matching post with full engagement metrics, author profile and the compiled query. JSON, CSV or Excel. By FeedMiner.

- **URL**: https://apify.com/feedminer/x-advanced-search-scraper.md
- **Developed by:** [FeedMiner](https://apify.com/feedminer) (community)
- **Categories:** Social media, Developer tools, Marketing
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 post returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

<div style="border-left:4px solid #1D9BF0;background:#F2F9FF;padding:14px 18px;border-radius:6px">
<strong>Run X (Twitter) advanced search without learning its syntax.</strong> Pick an account, a date window, a language, a like threshold, media or verification, and get every matching post with full engagement metrics as JSON, CSV or Excel.
</div>

🎛️ **Every operator is a field, including the ones with a minus.** From, replying to, mentioning, language, dates, minimum likes, reposts and replies, media, verification, and the four nobody else exposes: words to exclude, no reposts, no replies, and a place with a radius. No `-crypto -filter:retweets near:"San Francisco" within:25km` to remember.

💸 **$0.12 per 1,000 posts, down to $0.10 on the larger Apify plans.** The closest tool with this feature set charges $15 per 1,000 on the free plan and $0.35 plus a start fee on the paid ones. Same index, same rows, no start fee here.

🔍 **The query is in the output.** Every row carries the exact X query the form compiled to, so the day you want the syntax, you already have it.

📅 **A date window that actually stops.** Set `until` and the run stops at your date instead of walking a whole timeline and filtering afterwards.

#### Copy to your AI assistant

```
feedminer/x-advanced-search-scraper on Apify. Runs X (Twitter) advanced search from structured fields instead of raw operator syntax. One row per post with text, engagement counts (likes, reposts, replies, quotes, bookmarks, views), author profile and the compiled query in searchTerm. Call ApifyClient("TOKEN").actor("feedminer/x-advanced-search-scraper").call(run_input={...}), then client.dataset(run["defaultDatasetId"]).list_items().items. Input: searchTerms (string[]), from, to, mentioning, language, since, until (YYYY-MM-DD), minLikes, minRetweets, minReplies (int), onlyImages, onlyVideos, onlyQuotes, onlyVerified (bool), sort (latest|top), maxItems (int), sessions (array, optional). Full spec: GET https://api.apify.com/v2/acts/feedminer~x-advanced-search-scraper/builds/default (Bearer TOKEN) → inputSchema, actorDefinition.storages.dataset, readme. Token: https://console.apify.com/account/integrations
```

***

### <img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/hoZ24gXinDHziMQKm-actor-3hbiY2nfMGfbNdh1w-DUuuMSYQpE-IMG_9471.jpeg" width="26" height="26" style="vertical-align:-4px;border-radius:6px"/> How to run an advanced search on X (Twitter)

Fill what you know, leave the rest empty.

##### Basic: a keyword with a quality floor

```json
{ "searchTerms": ["web scraping"], "minLikes": 20, "maxItems": 500 }
```

##### Everything one account said last month

```json
{ "from": "openai", "since": "2026-07-01", "until": "2026-08-01", "maxItems": 1000 }
```

No keyword at all is a valid search here. Filters alone are enough.

##### Complaints sent to a brand, in one language

```json
{ "to": "airfrance", "language": "fr", "minReplies": 1, "maxItems": 2000 }
```

##### Cut the noise out of a busy keyword

```json
{
  "searchTerms": ["launch"],
  "excludeWords": ["crypto", "pump and dump"],
  "excludeRetweets": true,
  "excludeReplies": true,
  "maxItems": 500
}
```

Three words excluded and two shapes dropped turn a keyword nobody can use into one you can.

##### What a city is saying

```json
{ "searchTerms": ["blackout"], "near": "San Francisco", "withinKm": 25, "maxItems": 300 }
```

##### Only the posts that carry a video

```json
{ "searchTerms": ["product launch"], "onlyVideos": true, "sort": "top", "maxItems": 300 }
```

##### A competitor set in one job

```json
{
  "searchTerms": ["from:stripe", "from:adyen", "from:checkoutcom"],
  "since": "2026-06-01",
  "minLikes": 5,
  "maxItems": 5000
}
```

A term already written in X syntax is understood as is, and what you type in a term wins over the same field in the form.

***

### Input parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `searchTerms` | array |  | Words to look for. Leave empty to search on the filters alone |
| `sort` | select | `latest` | Newest first, or the most engaged first |
| `maxItems` | integer | `1000` | Stop once this many posts have been collected |

**Filter tweets**

| Parameter | Type | Default | Description |
|---|---|---|---|
| `language` | select |  | Keeps only posts X detected in this language |
| `onlyVerified` | boolean | `false` | Only posts from verified accounts |
| `onlyImages` | boolean | `false` | Only posts carrying an image |
| `onlyVideos` | boolean | `false` | Only posts carrying a video |
| `onlyQuotes` | boolean | `false` | Only posts quoting another post |
| `excludeRetweets` | boolean | `false` | Drop reposts, keep original posts only |
| `excludeReplies` | boolean | `false` | Drop replies, keep standalone posts only |

**Search operators**

| Parameter | Type | Default | Description |
|---|---|---|---|
| `from` | string |  | Only posts written by this account |
| `to` | string |  | Only replies sent to this account |
| `mentioning` | string |  | Only posts that mention this account |
| `excludeWords` | array |  | Drop posts containing any of these words or phrases. This is X's own minus operator, without the syntax |
| `minLikes` | integer | `0` | Drop posts below this many likes |
| `minRetweets` | integer | `0` | Drop posts below this many reposts |
| `minReplies` | integer | `0` | Drop posts below this many replies |
| `since` | date |  | YYYY-MM-DD |
| `until` | date |  | YYYY-MM-DD |

**Location**

| Parameter | Type | Default | Description |
|---|---|---|---|
| `near` | string |  | A city or place name. Only posts X located there |
| `withinKm` | integer | `0` | Radius around the place above |

**Advanced**

| Parameter | Type | Default | Description |
|---|---|---|---|
| `sessions` | array |  | Optional. The Actor works without one. X accounts of your own, for anyone who would rather the run used accounts they control |
| `debugMode` | boolean | `false` | Verbose logs for support |

#### Coming from another tweet scraper

The field names used by the most popular X scraper work here as they are: `author`, `inReplyTo`, `tweetLanguage`, `minimumFavorites`, `minimumRetweets`, `minimumReplies`, `start`, `end`, `onlyImage`, `onlyVideo`, `onlyQuote`, `onlyVerifiedUsers`, `onlyTwitterBlue`. A list in `twitterHandles` becomes one search per account.

#### Nothing to connect

Fill the fields and press Start. Keyword search covers all of X, with no account to create and no cookie to copy on your side.

If you would rather the run worked from accounts you own, the optional `sessions` field takes them.

***

### What data can you extract from an X search?

| Field | Type | Description |
|---|---|---|
| `id` | string | Post id |
| `url` | string | Direct link to the post |
| `text` | string | Post text |
| `createdAt` | string | Publication date, RFC 3339 |
| `lang` | string | Language X detected |
| `likeCount` | integer | Likes |
| `retweetCount` | integer | Reposts |
| `replyCount` | integer | Replies |
| `quoteCount` | integer | Quotes |
| `bookmarkCount` | integer | Bookmarks |
| `viewCount` | integer | Views, the number most X scrapers skip |
| `isRetweet` `isQuote` `isReply` | boolean | What kind of post this is |
| `conversationId` | string | Thread this post belongs to |
| `inReplyToUsername` | string | Account being replied to |
| `hashtags` `mentions` `links` `media` | array | Entities in the post |
| `author` | object | Handle, name, bio, followers, verification, avatar, join date |
| `quote` `retweet` | object | The nested post, when there is one |
| `searchTerm` | string | The exact X query this row came from |

***

### Pricing: Pay Per Event (PPE)

| Event | Price |
|---|---|
| Post returned | $0.00012 |

That is **$0.12 per 1,000 posts**, with no start fee and no charge for a run that returns nothing. The price steps down on its own for the larger Apify plans, to $0.11 and then $0.10 per 1,000.

***

##### What a run costs

| | |
|---|---|
| A 500 post search | $0.06 |
| A 10,000 post research dataset | $1.20 |

##### Free tier

The Apify free plan includes $5 of usage every month, which is roughly 41,000 posts here. No card required.

### Advanced usage

**Find the buying signals, not the noise.** `to` plus `minReplies` returns the conversations a brand is actually in, which is a much smaller and more useful set than a keyword sweep.

**Keep a date window per run.** Searching a year in one job returns the maximum X gives per query. Splitting it into monthly windows with `since` and `until` gives you the whole year, one run per month.

**Sort matters.** `latest` is the complete recent slice. `top` is X's own engagement ranking, which is what you want for a report and not for a dataset.

**Terms and fields combine.** `searchTerms: ["pricing"]` with `from: "stripe"` is every Stripe post about pricing. Both sides compile into one query, visible in `searchTerm`.

***

### Integrate X search results into your stack

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("feedminer/x-advanced-search-scraper").call(run_input={
    "searchTerms": ["data pipeline"],
    "language": "en",
    "minLikes": 25,
    "since": "2026-08-01",
    "maxItems": 1000,
})

for row in client.dataset(run["defaultDatasetId"]).list_items().items:
    print(row["likeCount"], row["author"]["userName"], row["url"])
```

**JavaScript**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('feedminer/x-advanced-search-scraper').call({
    from: 'openai',
    since: '2026-07-01',
    until: '2026-08-01',
    maxItems: 1000,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
const top = items.sort((a, b) => b.viewCount - a.viewCount).slice(0, 10);
```

**No code**

Send results to Google Sheets, Airtable, Slack, Zapier, Make or n8n from the Integrations tab of the run.

***

### Performance

| Measure | Value |
|---|---|
| Reading speed | 27 posts per second, measured on a 600 post run |
| Parallelism | One worker per search term, up to eight |
| Partial results | Kept and delivered when a limit is reached |

***

### FAQ

**How is this different from X Tweet Scraper?**
Same index, different door. Tweet Scraper takes X syntax and mixed inputs, profiles, threads, lists and communities. This one takes a form and searches. Pick whichever matches how you think.

**Do I need an X account?**
No. The run brings its own. When none is free at that moment, it answers from the public Communities index and says so in the run message.

**Can I use raw X operators anyway?**
Yes. Anything you type in `searchTerms` is parsed as X syntax, and what you typed wins over the same field in the form.

**How far back can I search?**
As far as X's index serves for a query. Monthly windows with `since` and `until` are how you cover a long period completely.

**Why do I get fewer posts than `maxItems`?**
Because the query ran out of matches. A narrower filter, a shorter window or a lower like threshold widens the result.

**Does it return views?**
Yes, `viewCount` is on every row.

**Can I schedule it?**
Yes. For a recurring brand watch, X Mentions Monitor is the better fit: it keeps state between runs and returns only what is new.

**Does `onlyVerified` mean paid verification?**
It matches X's own verified filter. Each row also carries `isVerified` and `isBlueVerified` so you can split them yourself.

***

### Support

A field you need, a filter that behaves oddly, a query that returns less than you expect: write from the actor page.

***

### Legal compliance

This actor reads the public search index of X. It does not access private accounts, protected posts or direct messages. Personal data in the output is subject to GDPR, CCPA and similar regimes: collect what you have a lawful basis to collect, keep it only as long as you need it, and honour deletion requests.

***

**FeedMiner** · Fast, honestly priced scrapers, kept alive when platforms change.

[X Tweet Scraper](https://apify.com/feedminer/x-tweet-scraper) · [X Profile Scraper](https://apify.com/feedminer/x-profile-scraper) · [X Follower Scraper](https://apify.com/feedminer/x-follower-scraper) · X Advanced Search Scraper · [X Media Scraper](https://apify.com/feedminer/x-media-scraper) · [X Mentions Monitor](https://apify.com/feedminer/x-mentions-scraper) · [X Engagement Scraper](https://apify.com/feedminer/x-engagement-scraper) · [X Likes and Reposts Scraper](https://apify.com/feedminer/x-signals-scraper) · [X Trends Scraper](https://apify.com/feedminer/x-trends-scraper) · [All FeedMiner Actors](https://apify.com/feedminer)

# Actor input Schema

## `searchTerms` (type: `array`):

Words to look for. Leave empty to search on the filters alone.

## `sort` (type: `string`):

Newest first, or the most engaged first.

## `maxItems` (type: `integer`):

Stop once this many posts have been collected.

## `language` (type: `string`):

Keeps only posts X detected in this language.

## `onlyVerified` (type: `boolean`):

Only posts from verified accounts.

## `onlyImages` (type: `boolean`):

Only posts carrying an image.

## `onlyVideos` (type: `boolean`):

Only posts carrying a video.

## `onlyQuotes` (type: `boolean`):

Only posts quoting another post.

## `excludeRetweets` (type: `boolean`):

Drop reposts, keep original posts only.

## `excludeReplies` (type: `boolean`):

Drop replies, keep standalone posts only.

## `from` (type: `string`):

Only posts written by this account.

## `to` (type: `string`):

Only replies sent to this account.

## `mentioning` (type: `string`):

Only posts that mention this account.

## `excludeWords` (type: `array`):

Drop posts containing any of these words or phrases. This is X's own minus operator, without the syntax.

## `minLikes` (type: `integer`):

Drop posts below this many likes.

## `minRetweets` (type: `integer`):

Drop posts below this many reposts.

## `minReplies` (type: `integer`):

Drop posts below this many replies.

## `since` (type: `string`):

YYYY-MM-DD.

## `until` (type: `string`):

YYYY-MM-DD.

## `near` (type: `string`):

A city or place name. Only posts X located there.

## `withinKm` (type: `integer`):

Radius around the place above.

## `sessions` (type: `array`):

Optional. The Actor works without one. X accounts of your own, for anyone who would rather the run used accounts they control.

## `debugMode` (type: `boolean`):

Verbose logs for support.

## Actor input object example

```json
{
  "searchTerms": [
    "apify"
  ],
  "sort": "latest",
  "maxItems": 1000,
  "onlyVerified": false,
  "onlyImages": false,
  "onlyVideos": false,
  "onlyQuotes": false,
  "excludeRetweets": false,
  "excludeReplies": false,
  "minLikes": 0,
  "minRetweets": 0,
  "minReplies": 0,
  "withinKm": 0,
  "sessions": [
    {
      "label": "account-1",
      "authToken": "",
      "ct0": ""
    }
  ],
  "debugMode": false
}
```

# Actor output Schema

## `posts` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchTerms": [
        "apify"
    ],
    "sort": "latest",
    "maxItems": 1000,
    "minLikes": 0,
    "minRetweets": 0,
    "minReplies": 0,
    "withinKm": 0,
    "sessions": [
        {
            "label": "account-1",
            "authToken": "",
            "ct0": ""
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("feedminer/x-advanced-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchTerms": ["apify"],
    "sort": "latest",
    "maxItems": 1000,
    "minLikes": 0,
    "minRetweets": 0,
    "minReplies": 0,
    "withinKm": 0,
    "sessions": [{
            "label": "account-1",
            "authToken": "",
            "ct0": "",
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("feedminer/x-advanced-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "apify"
  ],
  "sort": "latest",
  "maxItems": 1000,
  "minLikes": 0,
  "minRetweets": 0,
  "minReplies": 0,
  "withinKm": 0,
  "sessions": [
    {
      "label": "account-1",
      "authToken": "",
      "ct0": ""
    }
  ]
}' |
apify call feedminer/x-advanced-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,feedminer/x-advanced-search-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/rI39LFcmoGxztFbdX/builds/pLdcceF8japM6lf4m/openapi.json
