# Threads Search Scraper (`outspoken_strategy/threads-search-scraper`) Actor

Search Threads by keyword, phrase or hashtag and get posts with text, author, likes, replies, reposts, media and links. Date range, author filter, newest or most popular first. No login, fast HTTP scraper.

- **URL**: https://apify.com/outspoken_strategy/threads-search-scraper.md
- **Developed by:** [code craker](https://apify.com/outspoken_strategy) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $25.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Threads Search Scraper

Search **Threads** by keyword, phrase or hashtag and get the matching posts with their **text, author, likes, replies, reposts, media and links**. Filter by date, author, likes, language, media and more, choose between the newest posts and the most popular ones, and use **monitor mode** to get only what is new since the last run.

No login, cookies or API key needed. The actor talks to Threads over plain HTTP — no browser — so 1,000 posts take about a minute.

### Features

- 🔎 **Keyword, phrase and hashtag search** — `openai`, `world cup`, `#photography`. Run many searches at once.
- 🕒 **Newest first or most popular first** — follow a topic as it happens, or find the posts that got the most attention.
- 📅 **Date range** — only posts between two dates, or from the last `7 days`.
- 👤 **Author filter** — only posts written by one account.
- 🎛 **Post filters** — minimum likes, replies or reposts; original posts or replies only; text, photo or video posts; verified authors; language; words to exclude.
- 🔔 **Monitor mode** — a scheduled run returns only posts it has not returned before, so you get (and pay for) each post once.
- 🌐 **Language of every post** — as a two-letter code, ready to filter or group by.
- 📊 **Engagement** — likes, replies, reposts, quotes and shares for every post.
- 🖼 **Media and links** — full-size photos and videos, web links and link cards.
- 💬 **Conversation context** — replies come with the post they answer, quote posts with the post they quote.
- 🎯 **On-topic results only** — Threads sometimes pads a search with loosely related posts; the actor keeps only posts that really contain your search words.
- ♾ **Goes past the first page** — Threads shows a single page per search; the actor walks back through time to collect as many posts as you ask for.
- 💾 **Incremental results** — posts are saved as they are found, so a long run never loses what it collected.

### Use cases

- Brand and competitor monitoring
- Trend and sentiment research
- Finding creators and conversations in a niche
- Tracking what an account says about a topic
- Datasets for analysis and AI

### Quick start

1. Enter a search, e.g. `openai`.
2. Set how many posts you want.
3. Run. Posts appear in the dataset as they are found.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `searchQueries` | array | **Required.** Words, phrases or hashtags to search for. Each one is scraped separately. |
| `maxResults` | integer | Posts to return per search (1–10,000). Default `100`. |
| `sortBy` | string | `recent` (newest first, default) or `top` (most popular first). |
| `startDate` | string | Only posts on or after this date: `yyyy-mm-dd` (UTC), or a period such as `7 days`. |
| `endDate` | string | Only posts on or before this date: `yyyy-mm-dd` (UTC), or `2 days` for "at least two days old". |
| `fromUsername` | string | Only posts by this account, e.g. `zuck`. |
| `minLikes` / `minReplies` / `minReposts` | integer | Only posts with at least this many. Default `0`. |
| `replies` | string | `include` (default), `exclude` (original posts only) or `only` (replies only). |
| `media` | string | `any` (default), `text`, `media` (photo or video), `image` or `video`. |
| `verifiedOnly` | boolean | Only posts from verified accounts. |
| `languages` | array | Only posts in these languages, as two-letter codes: `en`, `es`, `pt`, `fr`, `de`, `it`, `nl`, `pl`, `tr`, `id`, `vi`, `ru`, `uk`, `ar`, `fa`, `he`, `hi`, `bn`, `th`, `el`, `ja`, `ko`, `zh`. |
| `excludeWords` | array | Leave out posts containing any of these words or phrases. |
| `onlyNewPosts` | boolean | Monitor mode: return only posts that earlier runs of the same search did not return. |
| `proxyConfiguration` | object | Proxy settings. The default is recommended. |

#### Example

```json
{
    "searchQueries": ["openai", "#photography"],
    "maxResults": 500,
    "sortBy": "recent",
    "startDate": "7 days",
    "minLikes": 10,
    "replies": "exclude",
    "languages": ["en"],
    "excludeWords": ["giveaway"]
}
```

#### Monitoring a topic

Turn on `onlyNewPosts` and put the actor on a [schedule](https://docs.apify.com/platform/schedules) — every hour, say. The first run returns the latest posts; every later run returns only what appeared since. What has been returned is remembered per search (and per author filter) in a key-value store named `threads-search-scraper-seen` in your account; delete it to start over.

### Output

One dataset item per post:

```json
{
    "searchQuery": "openai",
    "id": "3740123456789012345",
    "url": "https://www.threads.com/@dev.bob/post/DeZSk4cAf-8",
    "text": "OpenAI just changed its pricing: https://example.com/pricing",
    "createdAt": "2026-10-12T12:59:51.000Z",
    "author": {
        "id": "1002",
        "username": "dev.bob",
        "fullName": "Bob Builder",
        "isVerified": true,
        "profilePicUrl": "https://scontent.cdninstagram.com/...",
        "profileUrl": "https://www.threads.com/@dev.bob"
    },
    "likeCount": 4,
    "replyCount": 1,
    "repostCount": 2,
    "quoteCount": 1,
    "shareCount": 5,
    "mediaType": "text",
    "media": [],
    "links": ["https://example.com/pricing"],
    "linkPreview": {
        "url": "https://example.com/pricing/",
        "title": "Pricing | Example",
        "displayUrl": "example.com",
        "imageUrl": "https://external.xx.fbcdn.net/..."
    },
    "hashtags": [],
    "mentions": [],
    "topic": "AI Threads",
    "isReply": true,
    "replyTo": {
        "id": "3740123456789000000",
        "url": "https://www.threads.com/@garden.anna/post/DeSL91Ekj1M",
        "username": "garden.anna",
        "text": "Which AI assistant do you use for coding?",
        "createdAt": "2026-10-12T12:46:40.000Z"
    },
    "quotedPost": null,
    "isQuote": false,
    "isEdited": false,
    "language": "en",
    "isAiLabeled": false,
    "isPaidPartnership": false,
    "replyAudience": "everyone",
    "code": "DeZSk4cAf-8",
    "scrapedAt": "2026-10-12T17:10:45.538Z"
}
```

`mediaType` is `text`, `image`, `video` or `carousel`. Each entry in `media` has a `type`, a direct `url`, and for videos a `thumbnailUrl`. Media links are issued by Threads and expire after a while — download the files soon after the run if you need to keep them.

### Good to know

- **Every result contains your search words.** A post is kept when all the words of your search appear in its text, hashtags, topic, link title, author name or the post it quotes. A word that only appears inside a web address does not count, unless you search for an address such as `openai.com`. Several words are searched as a phrase, as Threads does, so `world cup` finds fewer posts than `worldcup` and `world` would separately.
- **Busy topics are sampled, not exhausted.** For each hour Threads gives its newest posts and its most popular ones — up to about 30 posts per hour. For a topic with thousands of posts an hour you get a steady sample across time rather than every single post.
- **Filters work on what Threads returns.** Threads' search has no filters of its own, so the actor fetches posts and keeps the ones that pass. A strict filter on a quiet topic takes longer and can return fewer posts than you asked for; a run stops on its own when thousands of posts in a row fail the filters. You only pay for posts that are saved.
- **Language is worked out from the text.** Threads labels few posts itself. Very short posts and posts mixing languages get `language: null`, and a language filter leaves those out.
- **Rare topics take longer.** The actor checks hour after hour for posts and widens its steps through quiet periods. Over long quiet stretches Threads may leave some posts out; set a start date close to the period you care about for the most complete results.
- **Most popular first** starts with the posts Threads ranks highest over the whole period, then over ever shorter slices of it. It follows Threads' own "Top" ranking, which is not strictly ordered by likes.
- **Order of the dataset.** Posts are saved as each slice of time finishes, so the dataset is roughly, not strictly, in order. Sort by `createdAt` or `likeCount` if you need an exact order.
- **Newest posts.** Threads needs a little time to make a new post searchable; posts from the last few minutes may be missing.
- **No view counts.** Threads does not show them to visitors who are not logged in.
- **Proxies.** Threads limits how many searches one IP address may run. The actor starts on datacenter proxies and switches to residential proxies by itself when that limit is reached.

### Billing

You pay per post saved to the dataset. The run stops on its own when it reaches the maximum charge you set, so you never pay for more than you asked for.

### Local development

```bash
npm install
npm test          # parser, input, filter, language and paging unit tests
apify run         # runs with the input in storage/key_value_stores/default/INPUT.json
```

# Actor input Schema

## `searchQueries` (type: `array`):

Words, phrases or hashtags to search for on Threads, one search per line — e.g. "openai", "world cup" or "#photography". Several words are matched as a phrase. Each search is scraped separately.

## `maxResults` (type: `integer`):

How many posts to return for each search. The scraper keeps going back in time until it has this many or runs out of posts.

## `sortBy` (type: `string`):

"Newest first" walks back in time from now (or from the end date) — best for monitoring. "Most popular first" starts with the posts Threads ranks highest for the whole period.

## `startDate` (type: `string`):

Only posts published on or after this date (yyyy-mm-dd, UTC), or within a period such as "7 days". Leave empty for no limit.

## `endDate` (type: `string`):

Only posts published on or before this date (yyyy-mm-dd, UTC), or at least this long ago, such as "2 days". Leave empty to search up to now.

## `fromUsername` (type: `string`):

Limit every search to posts written by one Threads account, e.g. "zuck". Leave empty to search all accounts.

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

Only posts with at least this many likes. Most posts on Threads have none, so even a small number cuts the noise sharply.

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

Only posts with at least this many replies.

## `minReposts` (type: `integer`):

Only posts with at least this many reposts.

## `replies` (type: `string`):

Whether to keep posts that are replies to other posts.

## `media` (type: `string`):

Keep only posts with, or without, photos and videos.

## `verifiedOnly` (type: `boolean`):

Only posts from accounts with a verified badge. A quick way to leave out spam and throwaway accounts.

## `languages` (type: `array`):

Only posts written in these languages. The language is worked out from the text, so very short posts, or posts that mix languages, may be left out.

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

Leave out posts that contain any of these words or phrases, one per line — e.g. search "apple" and exclude "recipe".

## `onlyNewPosts` (type: `boolean`):

Each run returns only posts that earlier runs with the same search have not already returned. Ideal for a scheduled run that follows a topic: you get, and pay for, each post once.

## `proxyConfiguration` (type: `object`):

Proxy used to reach Threads. With the default setting the scraper starts on Apify datacenter proxies and moves to residential proxies by itself if Threads begins limiting requests. Pick a proxy group here only if you want to force one.

## Actor input object example

```json
{
  "searchQueries": [
    "openai"
  ],
  "maxResults": 50,
  "sortBy": "recent",
  "minLikes": 0,
  "minReplies": 0,
  "minReposts": 0,
  "replies": "include",
  "media": "any",
  "verifiedOnly": false,
  "languages": [],
  "excludeWords": [],
  "onlyNewPosts": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

The scraped posts as dataset items — one item per post, with its text, author, engagement counts, media and links.

# 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 = {
    "searchQueries": [
        "openai"
    ],
    "maxResults": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("outspoken_strategy/threads-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 = {
    "searchQueries": ["openai"],
    "maxResults": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("outspoken_strategy/threads-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 '{
  "searchQueries": [
    "openai"
  ],
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call outspoken_strategy/threads-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,outspoken_strategy/threads-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/0aFgKCE6H5nINLGaq/builds/274ardfMei8o37D5M/openapi.json
