# Threads Search Scraper 🧵🔍 (`simpleapi/threads-search-scraper`) Actor

🧵🔍 Threads Search Scraper extracts targeted results from Threads search for fast, data-driven insights. 🚀 Perfect for social research, competitive analysis & lead discovery—automate collection, save time, and scale smarter.

- **URL**: https://apify.com/simpleapi/threads-search-scraper.md
- **Developed by:** [SimpleAPI](https://apify.com/simpleapi) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Scraper

Search **Threads** (threads.com) by any keyword, topic, hashtag, or phrase — in **bulk** — and export every matching public post as clean, structured data. Get captions, media URLs, full engagement metrics, author info, link previews, and timestamps in one run. Perfect for **trend analysis, brand monitoring, competitor research, and social listening**.

### ✨ Why Choose This Actor?

- 🔍 **Bulk search** — pass a whole list of queries; each is scraped in turn.
- 🧠 **Self-healing** — the persisted-query token is extracted live every run, so it keeps working when Threads ships changes.
- 🛡️ **Smart proxy ladder** — starts direct, auto-falls back to datacenter → residential only when needed, then sticks. No wasted proxy spend.
- 📊 **4 ready-made dataset views** — Overview, Engagement, Media, and Users — each rendered as its own table.
- 💾 **Live saving** — every post is pushed the instant it's parsed, so a partial run still gives you data.
- 🧩 **Resume anywhere** — use the `nextCursor` from a previous run to continue exactly where you stopped.

### 🔑 Key Features

| Feature | Description |
|---|---|
| 🔎 Keyword / hashtag / phrase search | Search anything you'd type into Threads search |
| 📊 Sort modes | `top` (most relevant) or `recent` (newest first) |
| 👤 Username filter | Keep only posts from a specific author |
| 📅 Date range filter | `before` / `after` date filtering |
| 🎬 Rich media | Image + video URLs, all candidate sizes, link previews |
| 📈 Full engagement | Likes, replies, reposts, quotes, reshares |

### 📥 Input

```json
{
  "searchQueries": ["AI", "#technology"],
  "sort": "top",
  "from": "",
  "before": "",
  "after": "",
  "maxPosts": 50,
  "cursor": "",
  "sessionId": "YOUR_THREADS_SESSIONID_COOKIE",
  "proxyConfiguration": { "useApifyProxy": false }
}
````

| Field | Type | Description |
|---|---|---|
| `searchQueries` | array | **Required.** One or more keywords/hashtags/phrases. |
| `sort` | string | `top` or `recent`. Default `top`. |
| `from` | string | Only keep posts from this username. |
| `before` / `after` | string (date) | Date-range filter (client-side). |
| `maxPosts` | integer | Exact max posts **per query** (1–1000), honored precisely. Ignored if `cursor` is set. |
| `cursor` | string | Resume token (`nextCursor`) from a previous run; fetches one page. |
| `sessionId` | string | Logged-in `sessionid` cookie. Needed for pagination beyond ~20 posts. The actor uses a **built-in session by default**, so this is optional — but supplying your own is more reliable for large runs. |
| `proxyConfiguration` | object | Apify proxy settings. Defaults to no proxy with auto-fallback. |

> ℹ️ **Why a session ID?** Anonymously, Threads search returns a single ~20-post page with no cursor. With a valid logged-in `sessionid`, the connection paginates and returns a cursor on every page.

### 📤 Output

Each post is one dataset record:

```json
{
  "postId": "3841407839143315258",
  "postCode": "DVPbBO5icc6",
  "postUrl": "https://www.threads.com/@claudeai/post/DVPbBO5icc6",
  "userId": "63442222226",
  "username": "claudeai",
  "isVerified": true,
  "captionText": "A statement from Anthropic CEO…",
  "mediaType": 8,
  "imageUrl": "https://…",
  "allImages": ["https://…"],
  "allVideos": [],
  "likeCount": 6165,
  "directReplyCount": 459,
  "repostCount": 860,
  "quoteCount": 244,
  "reshareCount": 566,
  "takenAtISO": "2026-02-27T00:18:41.000Z",
  "takenAtFormatted": "2/27/2026, 12:18:41 AM",
  "linkPreviewUrl": "",
  "searchQuery": "AI",
  "nextCursor": "3221f23051b846b1a8cd5eeff599d442:1"
}
```

The dataset ships with **4 views** (tabs in the Output table): 📋 Overview, 📊 Engagement, 🎬 Media, 👥 Users.

### 🚀 How to Use (Apify Console)

1. Log in at [console.apify.com](https://console.apify.com) → **Actors**.
2. Open **Threads Search Scraper**.
3. Add your search queries, set `maxPosts`, and paste a `sessionId` for deep pagination.
4. Click **Start**.
5. Watch the live log as posts stream in.
6. Open the **Output** tab and export to JSON / CSV / XLSX.

### 🤖 Use via API

```bash
curl -X POST "https://api.apify.com/v2/acts/<actor-id>/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"searchQueries":["AI"],"maxPosts":20,"sessionId":"…"}'
```

### 🎯 Best Use Cases

- 📈 Track trending topics & hashtags
- 🏷️ Monitor brand and product mentions
- 🔬 Research competitors and their engagement
- 👂 Social listening & sentiment sourcing

### 💵 Pricing

This actor uses **pay-per-event**: you're charged per post successfully scraped (`post-scraped`). You only pay for data you actually receive.

### ❓ FAQ

**Do I need a session ID?** Only for more than ~20 posts — and the actor already ships with a built-in session, so it paginates out of the box. Supply your own `sessionId` for the most reliable large runs.

**Can I scrape several queries at once?** Yes — that's what `searchQueries` is for. Each query respects `maxPosts` independently.

**Is private content scraped?** No. Only publicly available search results are collected.

### ⚖️ Legal

Data is collected only from publicly available sources. You are responsible for compliance with Threads' Terms of Service and applicable laws (GDPR, CCPA, etc.).

### 🛟 Support & Feedback

Found a bug or want a feature? Open an issue on the actor's **Issues** tab — we read every one.

# Actor input Schema

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

📋 One or more keywords, topics, hashtags, or phrases to search for on Threads. Add as many as you like — each is scraped in turn. Examples: 'artificial intelligence', '#tech', 'climate change'.

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

Choose how to sort search results. 'Top' shows most relevant/popular posts first; 'Recent' shows newest posts first.

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

Keep only posts from a specific username. Example: 'openai', 'meta'. Leave empty to search all users.

## `before` (type: `string`):

Keep only posts created before this date. Leave empty for no upper date limit.

## `after` (type: `string`):

Keep only posts created after this date. Leave empty for no lower date limit.

## `sessionId` (type: `string`):

🍪 A logged-in Threads/Instagram `sessionid` cookie value. Pagination beyond the first page (~20 posts) requires a valid session — the actor ships with a built-in one so it works out of the box, but adding your own is more reliable and recommended for large runs. Get it from your browser DevTools → Application → Cookies → threads.com → `sessionid`. Keep it secret — treat it like a password.

## `maxPosts` (type: `integer`):

Exact maximum number of posts to scrape per search query (1–1000). The scraper fetches posts page by page and stops as soon as this many are collected. ℹ️ Going beyond ~20 needs a valid session — the actor uses a built-in one by default, or add your own `sessionId` below. ⚠️ Ignored when a cursor is provided (only one page is fetched).

## `cursor` (type: `string`):

Resume scraping from a specific cursor returned by a previous run (the `nextCursor` field). ⚠️ When set, maxPosts is ignored and only one page is fetched.

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

Proxy settings. The scraper starts direct (no proxy) and automatically falls back to datacenter, then residential proxies if Threads pushes back — staying on residential once it escalates.

## Actor input object example

```json
{
  "searchQueries": [
    "AI",
    "#technology",
    "climate change"
  ],
  "sort": "top",
  "maxPosts": 10,
  "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": [
        "AI"
    ],
    "sort": "top",
    "maxPosts": 10,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("simpleapi/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": ["AI"],
    "sort": "top",
    "maxPosts": 10,
    "proxyConfiguration": { "useApifyProxy": False },
}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "AI"
  ],
  "sort": "top",
  "maxPosts": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call simpleapi/threads-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=simpleapi/threads-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Threads Search Scraper 🧵🔍",
        "description": "🧵🔍 Threads Search Scraper extracts targeted results from Threads search for fast, data-driven insights. 🚀 Perfect for social research, competitive analysis & lead discovery—automate collection, save time, and scale smarter.",
        "version": "0.2",
        "x-build-id": "hgZFMLgcU22AthQ93"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/simpleapi~threads-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-simpleapi-threads-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/simpleapi~threads-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-simpleapi-threads-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/simpleapi~threads-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-simpleapi-threads-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "searchQueries"
                ],
                "properties": {
                    "searchQueries": {
                        "title": "🔍 Search Queries (bulk)",
                        "type": "array",
                        "description": "📋 One or more keywords, topics, hashtags, or phrases to search for on Threads. Add as many as you like — each is scraped in turn. Examples: 'artificial intelligence', '#tech', 'climate change'.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "sort": {
                        "title": "📊 Sort Results By",
                        "enum": [
                            "top",
                            "recent"
                        ],
                        "type": "string",
                        "description": "Choose how to sort search results. 'Top' shows most relevant/popular posts first; 'Recent' shows newest posts first.",
                        "default": "top"
                    },
                    "from": {
                        "title": "👤 From Username (Optional)",
                        "pattern": "^[a-zA-Z0-9._]*$",
                        "type": "string",
                        "description": "Keep only posts from a specific username. Example: 'openai', 'meta'. Leave empty to search all users."
                    },
                    "before": {
                        "title": "📅 Before Date (Optional)",
                        "type": "string",
                        "description": "Keep only posts created before this date. Leave empty for no upper date limit."
                    },
                    "after": {
                        "title": "📅 After Date (Optional)",
                        "type": "string",
                        "description": "Keep only posts created after this date. Leave empty for no lower date limit."
                    },
                    "sessionId": {
                        "title": "🔑 Threads Session ID (recommended)",
                        "type": "string",
                        "description": "🍪 A logged-in Threads/Instagram `sessionid` cookie value. Pagination beyond the first page (~20 posts) requires a valid session — the actor ships with a built-in one so it works out of the box, but adding your own is more reliable and recommended for large runs. Get it from your browser DevTools → Application → Cookies → threads.com → `sessionid`. Keep it secret — treat it like a password."
                    },
                    "maxPosts": {
                        "title": "📊 Maximum Posts (per query)",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Exact maximum number of posts to scrape per search query (1–1000). The scraper fetches posts page by page and stops as soon as this many are collected. ℹ️ Going beyond ~20 needs a valid session — the actor uses a built-in one by default, or add your own `sessionId` below. ⚠️ Ignored when a cursor is provided (only one page is fetched).",
                        "default": 10
                    },
                    "cursor": {
                        "title": "📄 Pagination Cursor (Optional)",
                        "type": "string",
                        "description": "Resume scraping from a specific cursor returned by a previous run (the `nextCursor` field). ⚠️ When set, maxPosts is ignored and only one page is fetched."
                    },
                    "proxyConfiguration": {
                        "title": "🌐 Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings. The scraper starts direct (no proxy) and automatically falls back to datacenter, then residential proxies if Threads pushes back — staying on residential once it escalates.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
