# Threads API - Search, Profiles, Posts & Replies as JSON (`alom/threads-api`) Actor

Threads keyword and #hashtag search as a real-time HTTP API: one GET request returns posts as JSON in seconds, no run to start and no Meta App Review. Text, author, likes, replies, reposts, media, links and date; top or newest first, filters, and an only-new monitor per caller.

- **URL**: https://apify.com/alom/threads-api.md
- **Developed by:** [Alom Dev](https://apify.com/alom) (community)
- **Categories:** Social media, Developer tools, Agents
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 api results

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

**Threads as a real-time HTTP API: keyword and #hashtag search, profiles, posts and replies as JSON.** One GET request
returns the data in seconds. No run to start, no Meta App Review, no Threads login.

```bash
curl -H "Authorization: Bearer $APIFY_TOKEN" \
  "https://alom--threads-api.apify.actor/search?q=espresso%20machine&maxPosts=20"
```

| Endpoint | Returns |
|---|---|
| `GET /search?q=coffee,#espresso` | Posts for up to 5 keywords or #hashtags: text, author, likes, replies, reposts, media, links, date |
| `GET /profile?username=zuck,mosseri` | Profiles: name, bio, followers, verified, bio links, e-mails written in the bio. Add `posts=10` for their latest posts |
| `GET /post?url=https://www.threads.com/@user/post/CODE` | A post by URL with its likes, replies and reposts, and the author's own continuation of the thread |
| `GET /replies?url=https://www.threads.com/@user/post/CODE` | The replies under a post, top or newest first |

- **Who it is for:** developers, AI agents and automations that need Threads data on demand. Meta's official API only
  searches Threads by keyword after App Review (`threads_keyword_search`).
- **What it costs:** $0.005 per request plus $2.50 per 1,000 results (posts, replies or profiles), down to $1.50 on
  higher Apify plans. Failed requests are free. The Apify Free plan's $5 monthly credit covers about 90 searches of 20
  posts, 650 profile lookups, or 1,000 monitor checks that find nothing new.
- **Prefer scheduled runs, CSV exports or add-ons?** The same data comes as
  [Threads Scraper](https://apify.com/alom/threads-scraper) runs.

### Quick start

1. Get your Apify API token: [Console → Settings → API & Integrations](https://console.apify.com/settings/integrations).
2. Call an endpoint with the token in the `Authorization` header (or `?token=` in the URL, which is less safe).
3. Read the JSON reply.

**Python**

```python
import os, requests

API = "https://alom--threads-api.apify.actor"
headers = {"Authorization": f"Bearer {os.environ['APIFY_TOKEN']}"}

r = requests.get(f"{API}/search", params={"q": "#coffee", "maxPosts": 20, "sort": "recent"}, headers=headers, timeout=300)
for post in r.json()["posts"]:
    print(post["date"], post["username"], post["likeCount"], post["text"][:80])

profile = requests.get(f"{API}/profile", params={"username": "zuck", "posts": 5}, headers=headers, timeout=300).json()
print(profile["profiles"][0]["followerCount"], len(profile["posts"]))
```

**JavaScript**

```js
const API = 'https://alom--threads-api.apify.actor';
const headers = { Authorization: `Bearer ${process.env.APIFY_TOKEN}` };

const { posts } = await (await fetch(`${API}/search?q=coffee,espresso&maxPosts=10`, { headers })).json();
const url = encodeURIComponent(posts[0].url);
const { replies } = await (await fetch(`${API}/replies?url=${url}&maxReplies=50&sort=recent`, { headers })).json();
```

**POST with a JSON body** works on every endpoint, with the same parameters:

```bash
curl -X POST -H "Authorization: Bearer $APIFY_TOKEN" -H "content-type: application/json" \
  -d '{"searchQueries": ["yourbrand", "#yourbrand"], "sort": "recent", "onlyNew": true, "monitorName": "brand"}' \
  https://alom--threads-api.apify.actor/search
```

`GET /` returns a short description of the endpoints. The **Server** tab of this Actor in Apify Console has the
OpenAPI description and a request builder.

### Parameters

**/search**

| Parameter | What it does |
|---|---|
| `q` (or `searchQueries`) | Keywords or #hashtags, comma-separated. At most 5 per request. |
| `maxPosts` | Posts per keyword, 1–100. Default 20. |
| `sort` | `top` (default) or `recent`: the posts found, newest first. |
| `after`, `before` | Date window: `2026-11-01`, an ISO time, or `48 hours` / `7 days`. |
| `minLikes`, `minReplies` | Only posts with at least this many likes or replies. |
| `languages` | Two-letter codes, e.g. `en,de`. |
| `requireKeywordMatch` | `true` drops related posts that don't contain the keyword. |
| `onlyNew` + `monitorName` | Only posts this monitor has not returned before (see below). |

**/profile**

| Parameter | What it does |
|---|---|
| `username` | Usernames, @handles or profile URLs, comma-separated. At most 5 per request. |
| `posts` | Latest posts per account, 0–50. Default 0: the profile only. |
| `after`, `before`, `minLikes`, `minReplies`, `languages` | Filters for those posts. |

**/post** and **/replies**

| Parameter | What it does |
|---|---|
| `url` | Post URLs (`https://www.threads.com/@user/post/CODE`), comma-separated. At most 5 per request. |
| `maxReplies` | /replies: replies per post, 1–200. Default 50. |
| `sort` | /replies: `top` (default) or `recent` (newest first). |
| `nested` | /replies: `true` also returns replies to replies. Slower: one page per reply. |
| `includePost` | /replies: `true` also returns the post itself. |
| `after`, `before`, `minLikes` | /replies: filters for the replies. |
| `onlyNew` + `monitorName` | /replies: only replies this monitor has not returned before. |

### Reply

```json
{
  "ok": true,
  "count": 2,
  "posts": [
    {
      "postId": "3712345678901234567",
      "url": "https://www.threads.com/@someone/post/DExampleCode",
      "date": "2026-11-24T18:03:11.000Z",
      "username": "someone",
      "text": "Finally upgraded my espresso machine...",
      "likeCount": 41,
      "replyCount": 6,
      "repostCount": 2,
      "keywordMatch": true,
      "searchKeyword": "espresso machine",
      "language": "en",
      "mediaType": "image"
    }
  ],
  "notices": [],
  "charged": { "api-request": 1, "api-post": 2 },
  "durationMs": 6120
}
```

`/profile` answers with `profiles` (and `posts`), `/replies` with `replies`. Every post and reply has the same fields
as a [Threads Scraper](https://apify.com/alom/threads-scraper) row, including media URLs, links, mentions, hashtags,
quoted posts and reply context.

| Status | Meaning | Charged |
|---|---|---|
| 200 | Data found (`count` can be 0). `notices` names any account or post that failed | One request + one per result |
| 400 | Bad parameters; `error` says what to fix | No |
| 402 | Apify did not accept the charge (credit or limits) | No data returned |
| 404 | None of the accounts or posts exists or is public | No |
| 502 | Threads did not answer; try again in a minute | No |

A request that takes longer than 20 seconds gets its `200` status line right away, and then spaces until its JSON follows, so slow connections are not dropped on the way. In that case the real status is in the body as
`status`, next to `ok`: check `ok` rather than the HTTP status.

### Monitoring: only new posts or replies

Add `onlyNew=true&monitorName=brand` to `/search` or `/replies`, and each request returns only what that monitor
hasn't returned before. Call it every few minutes from cron, n8n, Make or Zapier, and send the new posts wherever you
need them. Each Apify user has their own monitors, so a name is never shared with anyone else. A check with nothing
new costs one request fee ($0.005).

### How it works and its limits

- Logged-out Threads pages on fresh datacenter IPs. Search reads several result pages per keyword, merged and
  de-duplicated: **about 60–85 posts per keyword** at most, not every post ever written.
- **"recent"** in search sorts the posts found newest first. Threads shows logged-out visitors no "Recent" tab.
- **Speed:** a search usually takes 5–20 seconds for one keyword. A profile or a single post is one page. If the
  endpoint has been idle, the first request also waits a few seconds while it starts.
- At most 5 keywords, accounts or posts per request. A request still working after 100 seconds returns what it found so far.
- **Not here:** view counts, author details on search results, photo and video downloads, and your own session
  cookie. For those, use [Threads Scraper](https://apify.com/alom/threads-scraper) runs.

### Pricing

| | Free plan | Bronze | Silver | Gold and up |
|---|---|---|---|---|
| Per request | $0.005 | $0.005 | $0.005 | $0.005 |
| Per 1,000 results (posts, replies, profiles) | $2.50 | $2.00 | $1.75 | $1.50 |

Requests that fail (400, 404, 502) are not charged. Runs started from the input form instead of the API are a
keyword search priced like Threads Search Scraper runs: $0.005 per run plus the same per-post price.

### More Threads tools

- [Threads Scraper](https://apify.com/alom/threads-scraper): everything in one Actor, as scheduled runs with CSV/Excel
  export, view counts and add-ons
- [Threads Search Scraper](https://apify.com/alom/threads-search-scraper): keyword and #hashtag search runs
- [Threads Hashtag & Keyword Monitor](https://apify.com/alom/threads-keyword-monitor): only the new posts for your
  keywords, for scheduled runs
- [Threads Replies Scraper](https://apify.com/alom/threads-replies-scraper): the replies under any post
- [Threads Profile Scraper](https://apify.com/alom/threads-profile-scraper): profiles and their latest posts

### FAQ

**Do I need a Threads or Instagram account?** No. Nothing is logged in, so there is nothing to ban.

**Can I use it from an AI agent?** Yes. Add `https://mcp.apify.com/?tools=alom/threads-api` as an MCP connector, or
give the agent the OpenAPI description from the Server tab.

**Is it legal?** It reads public posts and profiles that anyone can see without logging in. You are responsible for
how you use personal data in the results.

Missing something? Open an issue in the Issues tab.

# Actor input Schema

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

Keywords, <code>#hashtags</code>, or threads.com search / <code>/tag/</code> URLs. Threads shows logged-out visitors ~20 posts per result page, so the Actor opens several result pages (keyword search, tag search, tag page) from fresh IPs and merges them: typically <b>60-85 unique posts per keyword</b>. In <b>accounts</b> mode: keywords to find profiles by (up to 100 per keyword). In the profile modes: keywords only <i>flag</i> matching rows (<code>keywordMatch</code>).

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

<b>Recent</b> returns the posts found newest first. The real "Recent" tab of Threads needs a logged-in account: with your own session cookie (below) it is used, without one the Actor sorts what it found.

## `requireKeywordMatch` (type: `boolean`):

Threads' search also returns loosely related posts. Turn on to drop hits whose text, topic tag or link title does not contain the keyword (dropped posts are not charged). Every search row has <code>keywordMatch</code> either way.

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

Threads shows logged-out visitors ~20 posts per result page; the Actor merges several result pages, typically 60-85 unique posts per keyword. With your own session cookie the Recent tab pages much deeper.

## `postedAfter` (type: `string`):

Date (UTC), ISO timestamp or relative like <code>7 days</code> or <code>48 hours</code>.

## `postedBefore` (type: `string`):

Date (UTC) or ISO timestamp (exclusive).

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

Keep only posts with at least this many likes. Leave empty for no limit. Handy for search, where many results have no engagement at all.

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

Keep only posts with at least this many replies. Leave empty for no limit.

## `languages` (type: `array`):

Keep only posts in these languages, as two-letter codes: <code>en</code>, <code>es</code>, <code>pt</code>, <code>fr</code>, <code>de</code>, <code>ja</code>, <code>ko</code>, <code>zh</code>, <code>ru</code>… The language is guessed from the text of each post (see the <code>language</code> field). Posts too short to tell are kept.

## `includeViews` (type: `boolean`):

Fill <code>viewCount</code> (the number Threads shows under a post, e.g. 423K views) on every post. Each count is read from the post's own page: one extra request per post, so the run takes longer. Not charged extra. A post you give by URL always has its view count.

## `onlyNewSinceLastRun` (type: `boolean`):

Skip posts an earlier run with the same monitor name already returned (not charged). Pair with a Schedule to get only fresh posts. For a dedicated monitor see Threads Hashtag & Keyword Monitor.

## `monitorName` (type: `string`):

Keep separate memories for different monitors (e.g. <code>competitors-daily</code>). Defaults to <code>default</code>.

## `sessionCookie` (type: `string`):

<b>Optional, never required.</b> Cookies of a logged-in threads.com tab (the Cookie header or a JSON export; at least sessionid, ideally also csrftoken and ds_user_id). Searches then use Threads' real "Recent" tab (about 2x more recent posts in our tests). Requests are made <b>as your account</b> (one IP, at most 2 at a time): Meta may rate-limit or ban it, so use a spare account. A bad cookie is skipped and the run says so. Stored encrypted, never logged.

## `maxConcurrency` (type: `integer`):

Keywords searched in parallel (each also loads up to 3 result pages at once). Higher = faster runs, same results.

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

The default Apify datacenter proxy works and is included in the price. Residential proxies aren't available on this Actor: if you pick them, the run uses the datacenter proxy instead (logged). Your own proxy URLs work as usual.

## Actor input object example

```json
{
  "searchQueries": [
    "espresso machine",
    "#coffee"
  ],
  "searchSort": "top",
  "requireKeywordMatch": false,
  "maxPosts": 50,
  "includeViews": false,
  "onlyNewSinceLastRun": false,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (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 = {
    "searchQueries": [
        "espresso machine",
        "#coffee"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("alom/threads-api").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": [
        "espresso machine",
        "#coffee",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("alom/threads-api").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 '{
  "searchQueries": [
    "espresso machine",
    "#coffee"
  ]
}' |
apify call alom/threads-api --silent --output-dataset

```

## MCP server setup

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

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/nWJTDyS2QpvSSMBmj/builds/uhPeV5TxdfbvxZiqT/openapi.json
