# Threads Scraper — Posts, Profiles, Replies & Search (`alias_md5/threads-scraper`) Actor

Track brands, creators, and trending conversations on Meta Threads — deeply paginated posts, full reply threads, profiles, and keyword search exported to clean JSON, CSV, or Excel with transparent pay-per-result pricing ($0 on private or deleted targets).

- **URL**: https://apify.com/alias_md5/threads-scraper.md
- **Developed by:** [Alias Data Studio](https://apify.com/alias_md5) (community)
- **Categories:** Social media, AI, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 threads post or reply records

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/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 Scraper

Fast, reliable Meta Threads data extraction for public user profiles, paginated user posts, post details with replies, and keyword search results. Export clean, analysis-ready datasets directly to JSON, CSV, Excel, or downstream AI workflows.

### What You Can Extract

- **User Posts & Profiles (`user_posts`)**: Collect deeply paginated posts from one or many public Threads handles (e.g. `@openai`, `@mosseri`, `@zuck`) with full engagement metrics, media URLs, topic tags, link previews, quoted posts, and optional user profile records.
- **User Profiles (`profiles`)**: Gather structured profile metadata including `userId`, `username`, `fullName`, `biography`, `followerCount`, `isVerified`, `isPrivate`, HD `profilePicUrl`, and `bioLinks`.
- **Post Details & Replies (`post_replies`)**: Extract complete metadata for a Threads post along with its public replies across `top`, `recent`, or `top_and_recent` (deduplicated) views, including direct and nested sub-thread replies with `depth`, `parentPostId`, and `isRootAuthor`.
- **Keyword Search (`search`)**: Run public keyword searches (e.g. `"AI agents"`, `"openai"`) across `top`, `recent`, or `both` (deduplicated) views—returning up to ~20 results per sort view (up to ~35–40 unique posts per query when combining Top and Recent).

### Flexible URL Support

Paste raw handles (`@openai`, `mosseri`), full `threads.com` or `threads.net` URLs, `/t/<code>` short links, or Threads search URLs—the scraper normalizes and routes them automatically.

Deleted posts, nonexistent handles, invalid URLs, and private accounts (in user posts mode) are skipped cleanly and recorded in `RUN_SUMMARY` at no charge.

### Input Examples

#### 1. Collect Paginated Posts & Profiles from Public Accounts

```json
{
  "mode": "user_posts",
  "usernames": ["@openai", "@mosseri"],
  "maxPosts": 50,
  "includeProfile": true
}
```

#### 2. Extract User Profile Metadata

```json
{
  "mode": "profiles",
  "usernames": ["@zuck", "@mosseri", "@openai"]
}
```

#### 3. Extract Post Details & Public Replies

```json
{
  "mode": "post_replies",
  "postUrls": [
    "https://www.threads.com/@mosseri/post/DgIelvvmi00"
  ],
  "replySort": "top_and_recent",
  "maxReplies": 40,
  "includeMainPost": true
}
```

#### 4. Search Public Threads Posts by Keyword

```json
{
  "mode": "search",
  "queries": ["AI agents", "openai"],
  "searchSort": "both",
  "maxPosts": 35
}
```

### Output Schema

Every dataset record includes a `recordType` discriminator (`post`, `reply`, or `profile`) so flat CSV/Excel exports and JSON streams stay clean and consistent.

#### Post Record (`recordType: "post"`)

```json
{
  "recordType": "post",
  "postId": "4037611601218121012",
  "code": "DgIelvvmi00",
  "threadId": "4037611601218121012",
  "authorId": "63482099442",
  "authorUsername": "mosseri",
  "authorFullName": "Adam Mosseri",
  "authorIsVerified": true,
  "authorProfilePicUrl": "https://...",
  "text": "We recently rolled out a new feature...",
  "likeCount": 1527,
  "replyCount": 939,
  "repostCount": 50,
  "quoteCount": 24,
  "reshareCount": 58,
  "createdAtIso": "2026-11-24T16:00:32.000Z",
  "url": "https://www.threads.com/@mosseri/post/DgIelvvmi00",
  "mediaType": "text",
  "imageUrls": [],
  "videoUrls": [],
  "hasAudio": false,
  "topicTag": null,
  "language": "en",
  "isEdited": false,
  "isReply": false,
  "replyToPostId": null,
  "replyToUsername": null,
  "linkPreview": null,
  "quotedPost": null,
  "repostedPost": null,
  "sourceMode": "user_posts"
}
```

#### Reply Record (`recordType: "reply"`)

```json
{
  "recordType": "reply",
  "replyId": "4037614704533410995",
  "code": "DgIfS57m5Sz",
  "rootPostId": "4037611601218121012",
  "rootPostCode": "DgIelvvmi00",
  "parentPostId": "4037611601218121012",
  "depth": 0,
  "authorId": "63640368523",
  "authorUsername": "a.m.riley",
  "authorFullName": "",
  "authorIsVerified": false,
  "authorProfilePicUrl": "https://...",
  "text": "Great point about creator controls.",
  "likeCount": 1002,
  "replyCount": 8,
  "repostCount": 1,
  "quoteCount": 0,
  "createdAtIso": "2026-11-24T16:06:42.000Z",
  "url": "https://www.threads.com/@a.m.riley/post/DgIfS57m5Sz",
  "mediaType": "text",
  "imageUrls": [],
  "videoUrls": [],
  "isRootAuthor": false
}
```

#### Profile Record (`recordType: "profile"`)

```json
{
  "recordType": "profile",
  "userId": "63299409527",
  "username": "openai",
  "fullName": "OpenAI",
  "biography": "OpenAI’s mission is to ensure artificial general intelligence benefits all of humanity.",
  "followerCount": 795249,
  "isVerified": true,
  "isPrivate": false,
  "profilePicUrl": "https://...",
  "bioLinks": [
    {
      "url": "http://openai.com/",
      "title": ""
    }
  ],
  "url": "https://www.threads.com/@openai"
}
```

### Pricing

Simple pay-per-event pricing based solely on delivered records. Skipped, invalid, private, or deleted targets are never billed, and runs honor your maximum total charge limit automatically.

| Event | Included Records | Free | Bronze | Silver | Gold | Platinum | Diamond |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `threads-post` | Posts (user feeds, search, post details) & replies | $1.20 / 1k | $1.00 / 1k | $0.85 / 1k | $0.70 / 1k | $0.55 / 1k | $0.50 / 1k |
| `threads-profile` | User profile records | $4.00 / 1k | $3.60 / 1k | $3.30 / 1k | $3.00 / 1k | $2.70 / 1k | $2.50 / 1k |

### Integrations (MCP, n8n & API)

#### Model Context Protocol (MCP)

Use this Actor as a live Threads data tool inside Claude Desktop, Cursor, Windsurf, or custom AI agents via the Apify MCP Server (`https://mcp.apify.com`) or direct stdio MCP tools:

- `threads_user_posts` — collect paginated posts and optional profile records for one or more handles.
- `threads_profiles` — pull profile metrics, bios, verification badges, bio links, and HD avatars.
- `threads_post_replies` — retrieve post metadata and deduplicated top/recent reply trees.
- `threads_search_posts` — search public Threads posts by keyword across Top and Recent views.

#### n8n & Workflow Automation

1. Add the official **Apify** node in **n8n** and select **Run Actor** (or **Run Actor and get dataset items**).
2. Choose **Threads Scraper** and provide your JSON input (for example, `mode: "user_posts"`, `usernames: ["@openai", "@mosseri"]`, `maxPosts: 50`).
3. Route the returned dataset items straight into Slack, Google Sheets, Notion, Airtable, Postgres, or an LLM summarization step on a schedule.

You can also invoke runs programmatically over HTTPS via the Apify REST API or official JavaScript and Python clients.

### Run Summary

Every run writes a structured `RUN_SUMMARY` record to the default key-value store containing delivery totals, request duration, and skipped targets with their reasons.

# Actor input Schema

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

Choose which Threads dataset to collect.

## `usernames` (type: `array`):

Threads handles or profile URLs (e.g. @openai, @mosseri, https://www.threads.com/@zuck). Used in user posts and profiles modes.

## `postUrls` (type: `array`):

Threads post URLs (threads.com or threads.net), /t/ short links, or post codes for post details and reply extraction.

## `queries` (type: `array`):

Keywords or phrases to search across public Threads posts (e.g. "AI agents", "openai").

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

Optional mixed list of Threads URLs (profiles, posts, /t/ short links, or search pages). Automatically normalized and routed.

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

Maximum number of posts to collect per user profile (deep pagination) or per search query (up to ~35-40 unique results across Top and Recent views).

## `maxReplies` (type: `integer`):

Maximum number of public replies to extract per post in post replies mode (up to ~35-45 replies across Top and Recent views).

## `replySort` (type: `string`):

Reply ordering view to extract for each post.

## `searchSort` (type: `string`):

Search result view to collect for each query.

## `includeProfile` (type: `boolean`):

In user posts mode, also output a profile record with follower count, bio, verification status, and bio links.

## `includeMainPost` (type: `boolean`):

In post replies mode, include the root post record before its replies.

## `skipPrivateProfiles` (type: `boolean`):

In profiles mode, skip private accounts at no charge instead of outputting their public header.

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

Network routing settings for reliable large-scale collection.

## Actor input object example

```json
{
  "mode": "user_posts",
  "usernames": [
    "@openai",
    "@mosseri"
  ],
  "postUrls": [
    "https://www.threads.com/@mosseri/post/DgIelvvmi00"
  ],
  "queries": [
    "AI agents"
  ],
  "maxPosts": 30,
  "maxReplies": 40,
  "replySort": "top_and_recent",
  "searchSort": "both",
  "includeProfile": true,
  "includeMainPost": true,
  "skipPrivateProfiles": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `runSummary` (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 = {
    "usernames": [
        "@openai",
        "@mosseri"
    ],
    "postUrls": [
        "https://www.threads.com/@mosseri/post/DgIelvvmi00"
    ],
    "queries": [
        "AI agents"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("alias_md5/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 = {
    "usernames": [
        "@openai",
        "@mosseri",
    ],
    "postUrls": ["https://www.threads.com/@mosseri/post/DgIelvvmi00"],
    "queries": ["AI agents"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("alias_md5/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 '{
  "usernames": [
    "@openai",
    "@mosseri"
  ],
  "postUrls": [
    "https://www.threads.com/@mosseri/post/DgIelvvmi00"
  ],
  "queries": [
    "AI agents"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call alias_md5/threads-scraper --silent --output-dataset

```

## MCP server setup

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