# Threads Search Post Scraper (`dacoder/threads-search-post-scraper`) Actor

Enter a search query and get the latest posts from Threads. Perfect for regular media monitoring.

- **URL**: https://apify.com/dacoder/threads-search-post-scraper.md
- **Developed by:** [Da Coder](https://apify.com/dacoder) (community)
- **Categories:** Social media
- **Stats:** 568 total users, 8 monthly users, 100.0% runs succeeded, 21 bookmarks
- **User rating**: 2.82 out of 5 stars

## Pricing

$24.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

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

## Threads Search Post Scraper

### What It Does

Enter a search query and retrieve the latest posts from Threads. This scraper gathers the most recent posts related to your query, returning approximately 10-20 posts per search.

### Why Use It?

Ideal for media monitoring - track mentions of an individual, company, product, or any keyword of your choice. Run it on a [schedule](https://docs.apify.com/platform/schedules) to keep an eye on new posts as they appear.

***

### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `searchQueries` | array | Yes | One or more terms to search. Each term returns its own results, tagged with `search_query`. |
| `sort` | string | No | `recent` (newest first, default) or `top` (most relevant). |
| `searchType` | string | No | `posts` (keyword search, default) or `hashtag` (posts under a tag). |
| `dateFrom` / `dateTo` | string | No | `YYYY-MM-DD`. Keep only posts within the date window (filters the returned results by timestamp). |
| `lastDays` | integer | No | Keep only posts from the last N days. |
| `monitorMode` | boolean | No | Return only posts not seen in previous runs. Ideal for scheduled monitoring. |
| `proxyConfiguration` | object | No | Optional proxy settings. Residential proxies help avoid IP rate-limiting on larger or frequent runs. |

### Sample Output

The scraper returns the full post data from Threads:

```json
{
    "post_url": "https://www.threads.com/@cnbc/post/DSPPJWfjhVx",
    "pk": "3787312424966559089",
    "user": {
        "pk": "63466771125",
        "username": "cnbc",
        "full_name": "CNBC",
        "profile_pic_url": "https://scontent-lhr6-1.cdninstagram.com/...",
        "is_verified": true
    },
    "caption": {
        "text": "The average American now holds onto their smartphone for 29 months..."
    },
    "text_post_app_info": {
        "direct_reply_count": 29,
        "repost_count": 0,
        "quote_count": 2,
        "share_info": { ... },
        "link_preview_attachment": {
            "title": "Americans are holding onto devices longer than ever",
            "url": "https://cnb.cx/...",
            "image_url": "https://.../"
        }
    },
    "code": "DSPPJWfjhVx",
    "like_count": 6,
    "taken_at": 1765702858,
    "media_type": 19,
    "image_versions2": { ... },
    "video_versions": null
}
```

### Troubleshooting

#### "No search results found"

- The query may genuinely have no recent results — try a broader term.
- Threads may be rate-limiting the IP. Enable residential proxies via `proxyConfiguration`, or space out your runs.

### Limitations

- Returns approximately 10-20 of the most recent posts per search (Threads only exposes one page of results to logged-out visitors). For continuous coverage, run the scraper on a schedule and collect new posts over time.

# Actor input Schema

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

One or more terms to search. Each term returns its own results, tagged with 'search\_query'. Add several to monitor multiple keywords or brands in a single run.

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

How to sort results: 'Recent' returns the newest posts first, 'Top' returns the most relevant/popular posts.

## `searchType` (type: `string`):

'Posts' searches post text by keyword. 'Hashtag' returns posts under a tag (the leading # is optional).

## `dateFrom` (type: `string`):

Optional. Only keep posts published on or after this date. Filters the returned results by timestamp — it cannot fetch older history (that needs login).

## `dateTo` (type: `string`):

Optional. Only keep posts published on or before this date.

## `lastDays` (type: `integer`):

Optional. Only keep posts from the last N days. Shortcut alternative to 'Date from'.

## `monitorMode` (type: `boolean`):

When enabled, each run returns only posts not seen in previous runs (tracked per search term across runs). Ideal for scheduled monitoring — combine with an Apify Schedule to poll for new posts. Warns if a run looks like it exceeded the ~20-post page limit between polls.

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

Optional. If using proxies with residential option, select a country matching your Threads account location to avoid session issues.

## Actor input object example

```json
{
  "searchQueries": [
    "OpenAI",
    "Anthropic"
  ],
  "sort": "recent",
  "searchType": "posts",
  "monitorMode": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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": [
        "Mark Zuckerberg"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dacoder/threads-search-post-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": ["Mark Zuckerberg"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("dacoder/threads-search-post-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": [
    "Mark Zuckerberg"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call dacoder/threads-search-post-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dacoder/threads-search-post-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/IfQrLNSXzlgFbyQqP/builds/pg4ixysjfV1e4Xnw7/openapi.json
