# Threads Scraper — Posts, Users, Replies & Media (`heartening_ixia/thr2-3`) Actor

Scrape public Threads posts, search users, extract post details and replies, and collect image/video URLs. Includes multi-query search, keyword and date filters, engagement filters when counts are available, deduplication, and structured Apify Dataset exports.

- **URL**: https://apify.com/heartening_ixia/thr2-3.md
- **Developed by:** [Oleksiy Khanadyeyev](https://apify.com/heartening_ixia) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 results

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 — Search Posts, Find Users, Extract Replies & Media

**Threads Scraper** is an Apify Actor for collecting structured data from publicly accessible pages on [Threads](https://www.threads.com/). Use it as a **Threads post scraper**, **Threads search scraper**, **Threads profile scraper**, or **Threads media extractor**. It supports five operation modes in one Actor, multi-query search, keyword and date filters, deduplication, optional detail enrichment, and export to an Apify Dataset.

Search public Threads conversations by keywords, hashtags, brands, topics, or creator names. Or provide post URLs to inspect individual posts, collect visible replies, and discover image or video URLs. The Actor uses Playwright to read the public Threads website; it does not use a private API or promise access to content that Threads does not expose.

### Version 1.2.7 extraction improvements

The detail extractor checks bounded serialized public-page state as well as rendered page elements. It validates author names against common interface statistics (for example, `2.5K views`) and uses a public-profile fallback only when the post page does not provide a valid name or avatar. Engagement counts are read from their own structured-data fields or the matching action control; the extractor does not parse the first number from a shared parent container. Image/video type evidence is preserved even when a CDN URL has no file extension. These remain best-effort public-page extractions: Threads may omit fields, change its page structure, or restrict visibility, so unavailable metrics remain `null` and undiscovered media remains an empty list.

### What this Threads scraper can do

- **Search Threads posts:** search one or many keywords, phrases, or hashtags; choose recent or top ordering; filter by author, date, text, keywords, engagement counts when available, and media presence.
- **Find public Threads profiles:** search by name, username, keyword, or topic; optionally open discovered profiles for additional public profile fields.
- **Scrape post details:** provide one or more public Threads post URLs and extract the available normalized post data.
- **Collect replies:** inspect supplied post URLs and collect reply-like cards visible in the public page.
- **Extract Threads images and videos:** find accessible image/video URLs and optionally download files to the Actor's default Key-Value Store.
- **Export structured data:** write records to the Apify Dataset with `mode`, `recordType`, timestamps, source URLs, and mode-specific fields.

### Quick start: search Threads posts

Select `posts_search` mode (the default) and enter one or more search terms:

```json
{
  "mode": "posts_search",
  "searchQueries": ["UGC creator", "looking for content creator", "#ugc"],
  "sort": "recent",
  "maxResults": 100,
  "maxPages": 10,
  "enrichDetails": true,
  "maxDetailEnrich": 50,
  "includeKeywords": ["creator"],
  "keywordMatchMode": "any",
  "excludeKeywords": ["unpaid"]
}
```

The Actor searches each query, deduplicates matching posts, applies configured filters, and writes normalized records to the default Dataset. `searchQuery` remains supported for existing single-query integrations; use `searchQueries` for multiple terms.

### Five scraping modes

#### 1. `posts_search` — Threads keyword and hashtag search

Find public Threads posts by keyword, phrase, hashtag, brand, or topic. Use `searchQuery` for one query or `searchQueries` for multiple queries. Results from different queries are deduplicated.

```json
{
  "mode": "posts_search",
  "searchQueries": ["UGC creator", "#ugc", "content creator"],
  "sort": "recent",
  "maxResults": 100,
  "maxPages": 10,
  "enrichDetails": true
}
```

Available filters include:

| Input | Purpose |
|---|---|
| `fromUser` | Keep posts from one Threads username |
| `after`, `before` | Filter by publication date/time in UTC |
| `includeKeywords` | Require matching words or phrases |
| `keywordMatchMode` | Match `all` terms or `any` term |
| `excludeKeywords` | Exclude posts containing listed terms |
| `minLikes`, `maxLikes` | Filter by likes when the count is available |
| `minReplies`, `minReposts`, `minQuotes` | Filter by other engagement counts when available |
| `hasMedia`, `mediaTypes` | Keep posts with discovered images/videos and filter media type |
| `minTextLength`, `maxTextLength` | Filter by extracted text length |
| `enrichDetails`, `maxDetailEnrich` | Open a limited number of posts for additional extraction |

Unknown engagement counts are not converted to zero. If Threads does not expose a count, the corresponding field remains `null`. When you set a numeric engagement threshold or media-type filter, records with unknown values are excluded because the Actor cannot verify that they meet the requested condition.

#### 2. `user_search` — public Threads profile discovery

Search for public profile links surfaced by Threads search and optionally inspect those profiles.

```json
{
  "mode": "user_search",
  "userQueries": ["UGC creator", "beauty blogger"],
  "maxResults": 50,
  "maxPages": 5,
  "enrichProfiles": true,
  "maxProfileEnrich": 30
}
```

The Actor attempts to collect username, display name, profile URL, avatar, bio/description, verification indicator, and visible profile counts. Threads search may return posts instead of dedicated profile results, so this is best-effort profile discovery, not a complete or exhaustive user directory. Some profile fields may be unavailable.

#### 3. `post_details` — extract data from Threads post URLs

Provide one or more public post URLs to retrieve the normalized post structure.

```json
{
  "mode": "post_details",
  "postUrls": [
    "https://www.threads.com/@example/post/ABC123"
  ]
}
```

Each processed URL produces a post record with available fields, `sourceInputUrl`, and `detailFetchStatus`. If one URL is inaccessible or deleted, the Actor records the issue and continues with other URLs.

#### 4. `replies` — scrape visible replies

Collect reply-like cards visible on supplied public Threads post pages.

```json
{
  "mode": "replies",
  "postUrls": ["https://www.threads.com/@example/post/ABC123"],
  "maxReplies": 200,
  "maxDepth": 3,
  "includeNestedReplies": true
}
```

Reply visibility depends on the public page. Threads does not consistently expose stable reply IDs, parent relationships, or complete nested pagination. The current extractor collects visible reply-like cards and does **not** guarantee full recursive conversation capture; `maxDepth` and `includeNestedReplies` do not override this platform limitation. Reply IDs, parent IDs, and reply URLs may be `null`.

#### 5. `media` — extract or download Threads media

Extract accessible image and video URLs from supplied public posts. Optionally download the files.

```json
{
  "mode": "media",
  "postUrls": ["https://www.threads.com/@example/post/ABC123"],
  "downloadMedia": false,
  "mediaTypes": ["image", "video"],
  "maxMediaPerPost": 10,
  "maxMediaSizeMb": 25
}
```

With `downloadMedia: false`, the Actor returns discovered media URLs and metadata. With downloads enabled, accessible files are stored in the default Key-Value Store; Dataset rows contain storage keys and file metadata, not binary contents. Some media URLs may be temporary, protected, unavailable, or too large to download. A post can return an empty `mediaUrls` list when no eligible media URL is discovered in the accessible page.

### Output data

The Actor writes structured records to the default Apify Dataset. Post records preserve the familiar fields below; other modes add mode-specific user, reply, or media fields.

| Field | Description |
|---|---|
| `postId` | Threads post identifier when available |
| `postUrl`, `canonicalUrl` | Post URL and normalized canonical URL |
| `text` | Extracted post text after common interface fragments are removed |
| `timestamp` | Publication time in ISO 8601 UTC format when available |
| `username`, `displayName` | Author handle and display name when available |
| `avatarUrl` | Author profile/avatar image URL; kept separate from post media |
| `isVerified` | Verification indicator (`true`, `false`, or `null` when unknown) |
| `likesCount`, `repliesCount`, `repostsCount`, `quotesCount` | Engagement counts when exposed by the public page; otherwise `null` |
| `mediaUrls`, `mediaType` | Discovered post media URLs and type (`image`, `video`, `mixed`, or `null`) |
| `searchQuery` | Search term associated with the result in `posts_search` mode |
| `detailEnriched` | Whether detail-page enrichment ran for this record |
| `dataCompleteness` | Weighted estimate of populated/known fields, from 0 to 1; not a guarantee of accuracy or total platform coverage |
| `scrapedAt`, `schemaVersion` | Extraction time and output schema version |
| `mode`, `recordType` | Operation mode and record type for each row |

Missing data is represented as `null` or an empty list where appropriate. The Actor does not infer missing engagement counts as zero, and it does not fabricate author names, media URLs, or timestamps. `dataCompleteness` is an indicative score, not a confidence score.

### Run summary and diagnostics

At the end of a run, the Actor stores `RUN_SUMMARY` in the default Key-Value Store. It includes status (`success`, `empty`, `partial`, or `failed`), timing, query statistics, raw and unique record counts, errors, proxy state, and media download statistics where relevant.

### Common settings

- `proxyConfiguration`: optional Apify Proxy configuration for browser traffic; availability may depend on your Apify plan.
- `proxyFailureMode`: `direct` (default) logs a warning and continues without proxy if proxy setup fails; `fail` stops the run.
- `debug`: enables additional diagnostic logging for troubleshooting.
- `maxPages`: approximate browser scroll cycles, not a guaranteed count of server-side pages.

### Reliability, limitations, and responsible use

This Actor uses Playwright to access the public Threads website. Threads can change its interface, throttle requests, require login, hide engagement counts, or make posts and media unavailable. Results reflect only the content exposed during the run.

- Public search results are not guaranteed to be complete, exhaustive, or chronologically perfect.
- Display names, profile metadata, engagement counts, and media URLs are extracted only when identifiable in the loaded page; they may be missing or `null`.
- A `detailEnriched: true` record means detail enrichment ran; it does not mean every optional field was found.
- Empty media results mean no eligible URL was discovered, not proof that the original post never contained media.
- User search, reply collection, nested replies, and media downloads are best-effort and depend on Threads' public interface and URL accessibility.
- The Actor does not bypass authentication, private profiles, access controls, or anti-bot protections.

Use only public content you are authorized to access. Respect Meta/Threads terms, privacy requirements, copyright, and applicable laws. Do not use this Actor to collect private data, evade access restrictions, or harass users.

### Frequently asked questions

**Can I search multiple Threads keywords in one run?**\
Yes. Use `searchQueries` in `posts_search` mode. Results are deduplicated across queries.

**Can I scrape a specific Threads post?**\
Yes. Use `post_details`, `replies`, or `media` mode and pass one or more public post URLs in `postUrl` or `postUrls`.

**Does the Actor return likes and reply counts for every post?**\
No. Threads does not expose these values consistently. Available counts are returned; unavailable values remain `null`.

**Can it download images and videos?**\
It can attempt to download accessible media when `downloadMedia` is enabled. Download availability depends on the source URL, access restrictions, file type, and size limit.

**Does it collect private profiles or bypass login?**\
No. It is designed for publicly accessible pages and does not bypass authentication or access controls.

### Examples

The `examples/` directory contains ready-to-run input examples for post search, user search, post details, replies, and media extraction, plus an illustrative output record.

# Changelog

This Actor's version history is a separate document: https://apify.com/heartening_ixia/thr2-3/changelog.md

# Actor input Schema

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

Choose what to extract from public Threads pages: search posts, discover users, inspect specific posts, collect visible replies, or extract media.

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

Search public Threads posts by keyword, phrase, hashtag, or topic. Kept for compatibility with existing single-query inputs.

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

Run multiple Threads post searches in one Actor run. Results are deduplicated across queries and retain the query that found each post.

## `userQuery` (type: `string`):

Search for public Threads profiles by name, username, keyword, or topic. Use with user_search mode; provide userQueries instead for multiple searches.

## `userQueries` (type: `array`):

Search for public Threads profiles using multiple terms in one run. Discovered profiles are deduplicated across queries; results depend on profiles surfaced by Threads search.

## `postUrl` (type: `string`):

A public Threads post URL to inspect in post_details, replies, or media mode.

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

One or more public Threads post URLs to inspect. Used by post_details, replies, and media modes.

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

Choose recent to prioritize newer public posts or top to use Threads’ default/top search ordering. Applies to posts_search.

## `maxResults` (type: `integer`):

Maximum number of unique records to write to the Apify Dataset for the selected mode.

## `maxPages` (type: `integer`):

Approximate number of browser scroll cycles. This is not a guaranteed number of Threads server pages or a promise of complete search coverage.

## `fromUser` (type: `string`):

Keep posts from this Threads username only. Enter the handle without the @ symbol.

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

Keep posts published on or after this UTC date/time. Use YYYY-MM-DD or an ISO 8601 timestamp.

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

Keep posts published on or before this UTC date/time. Use YYYY-MM-DD or an ISO 8601 timestamp.

## `includeKeywords` (type: `array`):

Keep posts whose text matches the supplied terms. Use keywordMatchMode to require all terms or at least one term.

## `keywordMatchMode` (type: `string`):

Choose all to require every include keyword, or any to keep a post when at least one include keyword matches.

## `excludeKeywords` (type: `array`):

Discard posts when their text contains any listed term. Matching is applied to the extracted post text.

## `minLikes` (type: `integer`):

Keep posts with at least this many likes. If the public page does not expose the count, the post is excluded because the threshold cannot be verified.

## `maxLikes` (type: `integer`):

Keep posts with no more than this many likes. Posts with unavailable counts are excluded because the maximum cannot be verified.

## `minReplies` (type: `integer`):

Keep posts with at least this many replies. Posts with unavailable reply counts are excluded because the threshold cannot be verified.

## `minReposts` (type: `integer`):

Keep posts with at least this many reposts. Posts with unavailable repost counts are excluded because the threshold cannot be verified.

## `minQuotes` (type: `integer`):

Keep posts with at least this many quotes. Posts with unavailable quote counts are excluded because the threshold cannot be verified.

## `hasMedia` (type: `boolean`):

When enabled, keep only posts for which the scraper discovers at least one accessible image or video URL.

## `mediaTypes` (type: `array`):

Limit discovered media to images, videos, or both. In post search, a post is excluded if its media type cannot be established.

## `minTextLength` (type: `integer`):

Keep posts whose extracted text contains at least this many characters.

## `maxTextLength` (type: `integer`):

Keep posts whose extracted text contains no more than this many characters.

## `enrichDetails` (type: `boolean`):

Open matching posts to look for additional public fields such as author details, engagement counts, and media URLs. This adds browser requests and can increase run time.

## `maxDetailEnrich` (type: `integer`):

Limit the number of search results opened for detail extraction. Higher values can increase run time and resource use.

## `enrichProfiles` (type: `boolean`):

In user_search mode, open discovered public profiles to look for additional profile fields. Availability depends on what Threads exposes.

## `maxProfileEnrich` (type: `integer`):

Limit the number of discovered profiles opened for profile enrichment.

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

Maximum number of reply-like public cards to collect per supplied post. Threads may expose only a subset of replies.

## `maxDepth` (type: `integer`):

Requested nesting depth for replies. The current public-page extractor may only identify visible top-level reply-like cards; deeper recursion is not guaranteed.

## `includeNestedReplies` (type: `boolean`):

Include nested replies when the public page exposes them. Enabling this does not guarantee that Threads will load or reveal nested replies.

## `downloadMedia` (type: `boolean`):

When enabled, attempt to download accessible media files to the Actor’s default Key-Value Store. Dataset rows contain file metadata and storage keys, not embedded binary files.

## `maxMediaPerPost` (type: `integer`):

Maximum number of discovered media URLs to process for each supplied post.

## `maxMediaSizeMb` (type: `integer`):

Maximum allowed size for each downloaded image or video file. Larger files are skipped.

## `proxyFailureMode` (type: `string`):

Choose direct to continue without the proxy and record a warning, or fail to stop the run when proxy setup fails.

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

Optional Apify Proxy configuration for browser requests. Proxy availability and access may depend on your Apify plan.

## `debug` (type: `boolean`):

Write additional troubleshooting details to the run log. Keep disabled for normal production runs unless investigating a problem.

## Actor input object example

```json
{
  "mode": "posts_search",
  "sort": "recent",
  "maxResults": 50,
  "maxPages": 5,
  "keywordMatchMode": "all",
  "minLikes": 0,
  "hasMedia": false,
  "enrichDetails": true,
  "maxDetailEnrich": 50,
  "enrichProfiles": true,
  "maxProfileEnrich": 50,
  "maxReplies": 200,
  "maxDepth": 3,
  "includeNestedReplies": true,
  "downloadMedia": false,
  "maxMediaPerPost": 10,
  "maxMediaSizeMb": 25,
  "proxyFailureMode": "direct",
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "debug": false
}
```

# Actor output Schema

## `results` (type: `string`):

Open the default Apify Dataset to view exported Threads records and mode-specific fields.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("heartening_ixia/thr2-3").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("heartening_ixia/thr2-3").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 '{}' |
apify call heartening_ixia/thr2-3 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,heartening_ixia/thr2-3"
        }
    }
}
```

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/nOJhLfWDVXLzHMd1v/builds/om30NEFR4dFVxmoVu/openapi.json
