# Threads Keyword & Hashtag Search Scraper (`moonweil/threads-keyword-search`) Actor

Search Threads by keyword or hashtag, many keywords per run, no login. Get post text, author, likes, replies, reposts, hashtags, links and media. Monitor mode returns only new posts. No start fee: pay only per post.

- **URL**: https://apify.com/moonweil/threads-keyword-search.md
- **Developed by:** [Aleksandr Jelohhin](https://apify.com/moonweil) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 posts

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 Keyword & Hashtag Search Scraper

Search **Threads by keyword or hashtag** and get one clean table of posts: text, author, likes, replies, reposts, quotes, hashtags, mentions, links, media and the post URL. Put **dozens of keywords in one run**, and schedule it as a **monitor** that returns only posts it hasn't seen before.

- **No login, no cookies.** It reads the same public search pages a logged-out visitor sees.
- **Many keywords per run.** Every row says which keyword found it. A post that matches two keywords is returned (and charged) once.
- **No start fee.** You pay per post. Empty or failed keywords cost nothing.
- **Monitor mode.** Set a monitor name, schedule the Actor, and each run returns only new posts.
- **More than one result page.** Reads Threads' top results, tag results and the hashtag form of your keyword (`ai agents` → `#aiagents`), then merges them.

### What you can use it for

- **Brand and competitor monitoring.** Watch your brand, product names and competitors every hour and send new posts to Slack, a sheet or a webhook.
- **Trend and topic research.** Pull what people post about a topic, with engagement numbers to rank it.
- **Lead and creator discovery.** Find authors who post about your niche, with verified status and profile links.
- **Sentiment and AI datasets.** Feed post text into sentiment models, LLM pipelines or research.

### Input

| Field | What it does |
|---|---|
| `keywords` | What to search, one per line: words (`"ai agents"`) or hashtags (`"#nba"`). |
| `maxPostsPerKeyword` | Cap per keyword (default 40, max 200). It also caps your cost. |
| `searchViews` | Result pages to read: `top`, `tags`, `hashtag`, `more`. Default: top, tags and hashtag. |
| `sort` | `relevance` (Threads' order) or `newest`. |
| `postedAfter` | Only posts after a date (`2026-11-01`) or a period (`"7 days"`, `"36 hours"`). |
| `minLikes` | Skip posts with fewer likes. |
| `languages` | Keep only these languages (`en`, `es`, `pt`…). |
| `strictKeywordMatch` | Keep only posts whose text or hashtags contain every word of the keyword. |
| `monitorName`, `onlyNewPosts` | Turn on monitoring. Use the same name on each scheduled run. |
| `maxConcurrency`, `proxyConfiguration` | Advanced. The defaults work. |

```json
{
  "keywords": ["ai agents", "#nba", "bitcoin"],
  "maxPostsPerKeyword": 40,
  "postedAfter": "7 days"
}
```

### Output

One row per post. A real row from a search for `#nba` on 10 November 2026 (media URLs shortened):

```json
{
  "type": "post",
  "keyword": "#nba",
  "position": 2,
  "postId": "4027076405187368999",
  "code": "DfjDKd2jNgn",
  "url": "https://www.threads.com/@hillbillybogey/post/DfjDKd2jNgn",
  "threadId": "4027076405187368999",
  "text": "Closest to the pin! #lakers #nba #golf #hillbillybogey …",
  "publishedAt": "2026-11-10T04:29:01.000Z",
  "language": "en",
  "authorUsername": "hillbillybogey",
  "authorName": "Hillbilly Bogey",
  "authorId": "63454620212",
  "authorIsVerified": false,
  "authorProfilePicUrl": "https://instagram.fpnq7-8.fna.fbcdn.net/…",
  "likeCount": 3,
  "replyCount": 0,
  "repostCount": 1,
  "quoteCount": 0,
  "shareCount": 1,
  "isReply": false,
  "replyToUsername": null,
  "isQuote": false,
  "quotedPostUrl": null,
  "hashtags": ["lakers", "nba", "golf", "hillbillybogey"],
  "mentions": ["austinreaves12"],
  "links": [],
  "mediaType": "video",
  "imageUrls": ["https://scontent-arn2-1.cdninstagram.com/…"],
  "videoUrl": "https://scontent-arn2-1.cdninstagram.com/….mp4",
  "foundIn": ["top"],
  "containsKeyword": true,
  "scrapedAt": "2026-11-10T13:02:14.195Z"
}
```

`isNew` is added when a monitor name is set. The `SUMMARY` record in the run's key-value store lists posts per keyword and per result page, keywords that were empty or failed, and request statistics.

### Monitoring

1. Set `monitorName` (for example `my-brand`) and save the run as a task.
2. Schedule the task (hourly or daily).
3. Run 1 is the **baseline**: every post comes back with `isNew: true`.
4. From then on, with `onlyNewPosts` on (the default), you get and pay for only posts that no earlier run returned.

The list of seen posts lives in a key-value store named `threads-search-<monitorName>` on your own account. Posts not seen for 60 days are dropped.

### Pricing

**$0.001 per post** (pay per event). There is no start fee and no monthly rental.

| Job | Posts | Cost |
|---|---:|---:|
| 10 keywords × 40 posts | 400 | $0.40 |
| 100 keywords × 20 posts | 2,000 | $2.00 |
| Hourly monitor of 5 brand keywords, only new posts | usually a few dozen a day | a few cents a day |

Platform usage is billed separately by Apify, and it is small: each keyword is one to four plain page loads.

### Use it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/moonweil~threads-keyword-search/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"keywords":["ai agents"],"maxPostsPerKeyword":20}'
```

```js
import { ApifyClient } from "apify-client";
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor("moonweil/threads-keyword-search").call({ keywords: ["ai agents", "#nba"], postedAfter: "7 days" });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

### FAQ

**How many posts can I get per keyword?**
Logged-out Threads shows about 20 posts per result page and doesn't page further. Reading the top, tags and hashtag pages usually gives 20–50 unique posts per keyword. For more coverage, add related keywords and hashtags, or schedule a monitor: each run picks up what is new.

**Can I sort by latest?**
Threads doesn't offer a recency sort to logged-out visitors. `sort: newest` orders the posts that were found by date, and `postedAfter` drops old ones.

**Does it need my Threads account?**
No. It never logs in and reads only public posts.

**What if Threads blocks the run?**
The Actor retries on fresh sessions. If Threads keeps showing the login page, it switches to residential proxies by itself. A keyword that still fails is listed in the `SUMMARY` record and is not charged. If every keyword fails, the run fails, so a scheduled monitor alerts you instead of returning an empty success.

**Why does a row have `containsKeyword: false`?**
Threads search also returns related posts. Turn on `strictKeywordMatch` to keep only exact matches.

**Something is missing or broken?**
Open an issue on the Actor's Issues tab with the run ID.

# Actor input Schema

## `keywords` (type: `array`):

What to search on Threads, one per line. Plain words ("ai agents") or hashtags ("#nba"). Add as many as you like: each one is searched separately and every row says which keyword found it.

## `maxPostsPerKeyword` (type: `integer`):

Upper limit of posts returned for each keyword. Logged-out Threads shows about 20 posts per result page, so reading more pages (see Result pages) gives more posts. You pay per post, so this also caps the cost.

## `searchViews` (type: `array`):

Which Threads result pages to read for each keyword. Posts that appear on several pages are returned once. More pages give more posts and take a little longer.

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

Order of the rows for each keyword.

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

Keep only posts published after this point. A date (2026-11-01) or a period back from now ("7 days", "36 hours", "2 weeks").

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

Skip posts with fewer likes than this.

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

Keep only posts in these languages, as two-letter codes (en, es, pt, ja…). Posts Threads didn't label are kept. Empty means every language.

## `strictKeywordMatch` (type: `boolean`):

Threads search also returns related posts. Turn this on to keep only posts whose text (or hashtags) contains every word of the keyword. Every row has a containsKeyword field either way.

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

Set a name and schedule this Actor (e.g. every hour) to watch keywords. Posts seen on earlier runs get isNew = false. Use the same name on each run; the list of seen posts is kept in a key-value store on your account.

## `onlyNewPosts` (type: `boolean`):

With a monitor name: return (and pay for) only posts that no earlier run returned. The first run returns everything as the baseline.

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

How many keywords are searched at the same time.

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

The default Apify proxy works for most runs. If Threads keeps showing the login page, the Actor switches to residential proxies by itself.

## Actor input object example

```json
{
  "keywords": [
    "ai agents",
    "#nba"
  ],
  "maxPostsPerKeyword": 20,
  "searchViews": [
    "top",
    "tags",
    "hashtag"
  ],
  "sort": "relevance",
  "minLikes": 0,
  "strictKeywordMatch": false,
  "onlyNewPosts": true,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `posts` (type: `string`):

One row per post per keyword: text, author, likes, replies, reposts, hashtags, links, media and post URL.

## `summary` (type: `string`):

Posts per keyword and result page, keywords that were empty or failed, new versus already-seen posts, and request statistics.

# 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 = {
    "keywords": [
        "ai agents",
        "#nba"
    ],
    "maxPostsPerKeyword": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("moonweil/threads-keyword-search").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 = {
    "keywords": [
        "ai agents",
        "#nba",
    ],
    "maxPostsPerKeyword": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("moonweil/threads-keyword-search").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 '{
  "keywords": [
    "ai agents",
    "#nba"
  ],
  "maxPostsPerKeyword": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call moonweil/threads-keyword-search --silent --output-dataset

```

## MCP server setup

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

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/xwxSbcq5ydnAakaJ3/builds/gzIRTYWFyOgGbNmZf/openapi.json
