# Threads Post & Profile Scraper (`scrapeai/threads-scraper`) Actor

Extract detailed posts, comments, profiles, engagement metrics, hashtags, and media attachments from Threads. Engineered for social listening, user sentiment tracking, influencer outreach, and viral trend analysis. Features optimized proxy rotation to bypass rate limits.

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

## Pricing

from $1.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/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

## 🧵 Threads Post & Profile Scraper

A powerful, high-performance scraper built to extract posts, thread conversations, author profiles, follower metrics, engagement numbers, media attachments, and search results directly from **Threads** ([threads.net](https://www.threads.net)).

***

### 🌟 Features

- **📊 Comprehensive Social Metrics**: Extracts like count, reply count, repost count, quote count, reshare count, media types, and timestamps.
- **👤 Rich Author Profiles**: Gathers author username, display name, user ID, profile picture URL, follower count, biography, and verification badge status.
- **🎯 Multi-Mode Scraping**: Supports User Profile mode (`@username`), Direct Post / Thread URL mode, and Topic / Keyword Search mode.
- **⚡ Multi-Layer Extraction Pipeline**: Combines direct GraphQL API interception, embedded pre-rendered JSON script parsing, and dynamic DOM evaluation fallback.
- **📜 Smart Dynamic Pagination**: Autonomously scrolls down feeds, handles content hydration, and enforces hard item limits (`maxItems`).
- **🛡️ Advanced Anti-Bot Stealth**: Built-in fingerprint randomization (User-Agents, screen resolutions, navigator webdriver masking) and full Apify Residential proxy support.
- **📦 Standard Apify Schemas**: Fully configured `dataset_schema.json` and `output_schema.json` for export to JSON, CSV, Excel, XML, or webhooks.

***

### 📥 Input Parameters

| Parameter            | Type      | Required | Default                     | Description                                                                                      |
| -------------------- | --------- | -------- | --------------------------- | ------------------------------------------------------------------------------------------------ |
| `mode`               | `string`  | No       | `"profile"`                 | Primary mode: `"profile"` (User profile), `"post"` (Thread URL), or `"search"` (Keyword search). |
| `username`           | `string`  | No       | `"instagram"`               | Threads account handle to scrape (e.g. `"instagram"`, `"zuck"`, `"openai"`).                     |
| `searchQuery`        | `string`  | No       | `"artificial intelligence"` | Search keyword or topic query when using search mode.                                            |
| `startUrls`          | `array`   | No       | `[]`                        | List of direct Threads URLs (profile, post, or search URLs).                                     |
| `maxItems`           | `integer` | No       | `50`                        | Maximum number of posts / records to extract.                                                    |
| `includeReplies`     | `boolean` | No       | `false`                     | When `true`, extracts replies and comment threads in addition to top-level posts.                |
| `headless`           | `boolean` | No       | `true`                      | Runs browser automation in headless mode.                                                        |
| `proxyConfiguration` | `object`  | No       | `{ "useApifyProxy": true }` | Proxy settings. **Residential proxies recommended** for high volume scraping.                    |

#### Sample Input JSON

```json
{
  "mode": "profile",
  "username": "instagram",
  "maxItems": 25,
  "includeReplies": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

***

### 📤 Output Data Format

Each scraped item is saved directly to the Apify dataset in structured JSON format. Below is an example record:

```json
{
  "id": "3967923927276492693",
  "code": "DcQ5cn1FpeV",
  "url": "https://www.threads.net/@instagram/post/DcQ5cn1FpeV",
  "text": "sorry i didn’t respond… sent you a reel instead",
  "author": "instagram",
  "authorName": "Instagram",
  "authorId": "63404918397",
  "authorProfilePic": "https://instagram.fixm3-1.fna.fbcdn.net/v/t51.82787-19/551831784_17922536550118398_7111076689237569379_n.jpg",
  "authorFollowers": 38176763,
  "authorBio": "Discover what's new on Instagram 🔎✨",
  "authorIsVerified": true,
  "likeCount": 2603,
  "replyCount": 251,
  "repostCount": 116,
  "quoteCount": 15,
  "reshareCount": 51,
  "images": [],
  "videos": [],
  "mediaType": 19,
  "isReply": false,
  "isPinned": false,
  "replyToAuthor": "",
  "postedAt": "2026-08-20T13:43:34.000Z",
  "scrapedAt": "2026-08-21T07:54:34.607Z"
}
```

***

### 🎯 Use Cases

1. **Brand Sentiment & Social Listening**: Track audience engagement, brand mentions, and sentiment across Threads discussions.
2. **Influencer Discovery & Outreach**: Identify high-performing creators, analyze follower count growth, and measure engagement ratios.
3. **Viral Trend Analysis**: Discover emerging topics, hashtags, and viral content strategies in real time.
4. **Competitor Benchmarking**: Monitor competitor post frequencies, messaging strategies, and audience interaction metrics.

***

### 💡 Tips & Best Practices

- **Residential Proxies**: Threads employs rate-limiting on high-frequency requests. Always configure **Apify Residential Proxies** (`RESIDENTIAL` proxy group) for smooth runs.
- **Direct URLs**: You can provide any mix of user profiles, post links, or search URLs in the `startUrls` field.
- **Export Options**: Export datasets instantly to JSON, CSV, Excel, or consume records programmatically via Apify API.

***

### 📄 License

ISC

# Actor input Schema

## `mode` (type: `string`):

Select the primary scraping mode

## `username` (type: `string`):

Threads account username to scrape (e.g. 'instagram', 'zuck', 'openai')

## `searchQuery` (type: `string`):

Search term or topic to find relevant threads (e.g. 'artificial intelligence', 'tech')

## `startUrls` (type: `array`):

Direct Threads profile URLs, thread URLs, or search URLs to scrape directly

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

Maximum number of posts/items to collect

## `includeReplies` (type: `boolean`):

Whether to extract reply posts and comment threads

## `headless` (type: `boolean`):

Run browser in headless mode

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

Proxy settings to bypass rate limits and anti-bot checks. Apify Residential proxies recommended.

## Actor input object example

```json
{
  "mode": "profile",
  "username": "instagram",
  "searchQuery": "artificial intelligence",
  "maxItems": 50,
  "includeReplies": false,
  "headless": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all extracted Threads posts, replies, and author profiles

# 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 = {
    "username": "instagram",
    "searchQuery": "artificial intelligence",
    "maxItems": 50,
    "includeReplies": false,
    "headless": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapeai/threads-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 = {
    "username": "instagram",
    "searchQuery": "artificial intelligence",
    "maxItems": 50,
    "includeReplies": False,
    "headless": True,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapeai/threads-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 '{
  "username": "instagram",
  "searchQuery": "artificial intelligence",
  "maxItems": 50,
  "includeReplies": false,
  "headless": true
}' |
apify call scrapeai/threads-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapeai/threads-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/5RdqRprFvfmuPgaRb/builds/X8WfMUWQIYMoZOzQv/openapi.json
