# Threads Scraper | Profiles, Posts & Search (HTTP) (`andok/threads-scraper`) Actor

Scrape public Meta Threads profiles and posts without login. Profile mode (followers, bio, recent posts) and keyword search mode. $0.002/item + $0.02 start.

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

## Pricing

from $2.00 / 1,000 item scrapeds

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 Scraper | Profiles, Posts & Keyword Search over HTTP

Scrape public **Meta Threads** (threads.com) data without logging in and without a browser. Get profile stats (followers, thread count, bio, avatar), the full text of public posts, and keyword-based post discovery, all as clean JSON. It is fast, cheap, and designed for social listening, creator research, brand monitoring and AI agents that need Threads context.

### Modes

**Profile mode** takes a list of usernames or profile URLs. For each one it returns a `profile` item (display name, followers, thread count, bio, avatar) and then up to `postsPerProfile` recent public `post` items discovered for that user.

**Search mode** takes keyword queries. Threads does not offer anonymous search, so posts are discovered through public web search restricted to `threads.com`, and each discovered post is then fetched directly. This works well for topic and brand monitoring.

You can also pass `postUrls[]` in either mode to scrape specific posts directly.

### Output

Profile item: `record_type: "profile"`, `username`, `display_name`, `bio`, `followers`, `followers_text`, `threads_count`, `avatar_url`, `url`.

Post item: `record_type: "post"`, `username`, `display_name`, `text`, `image_url`, `video_url`, `post_code`, `posted_at`, `url`, plus `source` (`profile`, `search` or `url`) and the originating `query` or `source_username`.

`posted_at` is decoded from the post shortcode, which embeds the creation timestamp, so it is accurate to the millisecond without extra requests. Engagement counters (likes, replies) are not exposed on logged-out pages and are therefore not returned.

### How it works

Threads serves rich Open Graph metadata to link-preview crawlers. The Actor requests public profile and post pages the same way a link unfurler does and parses the metadata with Cheerio, so no JavaScript rendering, cookies or login are needed. Keyword and per-profile post discovery uses public search results. If Threads answers with its login wall or rate limits the request, you get a free `error` row with `blocked: true` instead of a failed run.

### Proxy recommendation

Small runs work from a datacenter IP. Meta rate limits aggressively, so for more than a few dozen items use **residential proxies** in `proxyConfiguration` and keep `delayMs` at 500 or higher.

### Input example

```json
{
  "mode": "profile",
  "usernames": ["zuck", "https://www.threads.com/@mosseri"],
  "postsPerProfile": 5,
  "maxItems": 20,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

```json
{ "mode": "search", "queries": ["ai agents", "open source llm"], "maxItems": 30 }
```

### Pricing (pay per event)

| Event | Price |
|---|---|
| Actor start | $0.02 |
| Item scraped (profile or post) | $0.002 |

Example: 100 profiles with 5 posts each is 600 items, which costs 600 x $0.002 + $0.02 = **$1.22**. Error and blocked rows are free. `maxItems` and Apify's max-total-charge setting both cap spending, and the run stops cleanly when the limit is hit.

### Limitations

- Only public content is available. Private accounts, replies threads and follower lists require login and are not supported.
- Post discovery depends on what public search engines have indexed, so it is a sample of recent posts rather than a complete timeline.
- Meta changes its markup and anti-bot rules without notice. Structured errors tell you when that happens.
- Respect Threads' terms and applicable privacy law when storing personal data.

### Run locally

```bash
cd apify-threads-scraper
echo '{"mode":"profile","usernames":["zuck"],"postsPerProfile":3}' > storage/key_value_stores/default/INPUT.json
apify run
```

# Actor input Schema

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

profile: scrape the listed usernames (profile stats plus recent public posts). search: discover public posts for each keyword query.

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

Threads usernames or profile URLs, e.g. zuck or https://www.threads.com/@zuck.

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

Keywords or phrases. Posts are discovered through public web search restricted to threads.com.

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

Optional direct Threads post URLs to scrape, e.g. https://www.threads.com/@zuck/post/DMF6tMAxkX8.

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

Upper bound on charged items (profiles + posts) across the whole run.

## `postsPerProfile` (type: `integer`):

Profile mode only: number of recent public posts to discover per username. 0 returns profile stats only.

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

Profile mode only: push a profile item (followers, bio, thread count) for each username.

## `timeoutSeconds` (type: `integer`):

Per-request timeout.

## `delayMs` (type: `integer`):

Polite pause between requests to reduce rate limiting.

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

Recommended for larger runs. Meta rate limits datacenter IPs; residential proxies are the most reliable.

## Actor input object example

```json
{
  "mode": "profile",
  "usernames": [
    "zuck"
  ],
  "queries": [
    "ai agents"
  ],
  "postUrls": [],
  "maxItems": 20,
  "postsPerProfile": 5,
  "includeProfile": true,
  "timeoutSeconds": 30,
  "delayMs": 500,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `items` (type: `string`):

No description

## `itemsCsv` (type: `string`):

No description

## `run` (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": [
        "zuck"
    ],
    "queries": [
        "ai agents"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("andok/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": ["zuck"],
    "queries": ["ai agents"],
    "proxyConfiguration": { "useApifyProxy": False },
}

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

```

## MCP server setup

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