# Threads (`canadesk/threads`) Actor

Collect or Search for Posts and User profiles on Threads. It's fast and costs little!

- **URL**: https://apify.com/canadesk/threads.md
- **Developed by:** [Canadesk Support](https://apify.com/canadesk) (community)
- **Categories:** SEO tools, Social media, News
- **Stats:** 374 total users, 12 monthly users, 99.2% runs succeeded, 19 bookmarks
- **User rating**: 1.00 out of 5 stars

## Pricing

$5.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#rental-actors

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

⚡ Threads public website only returns a limited number of posts. The best way to collect posts is to schedule this Actor on a daily basis, with "since date" set to yesterday/today's date.

### Input

- Process (select)

  - **Get User Profile**

    Returns profile information.

  - **Get User Posts / Replies / Reposts**

    Returns profile information and posts.

  - **Search for User**

    Returns the username matching exactly the search terms.

  - **Search**

    Returns posts matching the search terms.

- User Profiles (array)

  Expected format: Username (microsoft365), ID or URL (https://www.threads.net/@spotify/)

- Sort by (select)

  Pinned first, or most recent.

- Since date (string)

  Applied AFTER data collection. Removes any entry before the specified date.

  Expected format: YYYY-MM-DD.

- Include Raw data (select)

  Also returns the raw data from Threads (additional fields).

### Output

💡 Media content, such as images, videos, etc., can be found in the "raw" key. Input "includeRaw" must be enabled.

**Search for User** returns:

```
{
    "id": "625400346",
    "username": "microsoft365",
    "full_name": "Microsoft 365",
    "url": "https://www.threads.net/@microsoft365",
    "profile_pic_url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.2885-19/357911524_3437512953129560_1652925957295034534_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=EbgIQi5sj4sQ7kNvgG6-qPM&_nc_gid=e9854be2981a401da68a7fee711b6ea1&edm=APs17CUBAAAA&ccb=7-5&oh=00_AYABRpR5TQCHzTtNm5hJXOoMh6-Ctz-mhMwnamNCIu0O8g&oe=67847355&_nc_sid=10d13b",
    "follower_count": 276234,
    "biography": "Blocked our calendar to thread",
    "is_verified": true,
    "website": "https://clicklinkin.bio/microsoft365",
    "raw": []   // Full details
}
```

**Search** returns:

```
[
    {
        "id": "3522365518020531801_625400346",
        "url": "https://www.threads.net/@microsoft365/post/DDh9Ma-stZZ",
        "text": "It's \"let's circle back after the holidays\" season. 💙",
        "likes": 129,
        "replies": 11,
        "reposts": 8,
        "quotes": 1,
        "shared": 2,
        "timestamp": 1734118714,
        "date": "2024-12-13",
        "pinned": false,
        "user": null,
        "reply": null,
        "raw": []   // Full details
    },
    ...
]
```

**Get User Profile** returns:

```
{
    "pk": "625400346",
    "text_post_app_is_private": false,
    "hd_profile_pic_versions": [
        {
            "height": 320,
            "url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.2885-19/357911524_3437512953129560_1652925957295034534_n.jpg?stp=dst-jpg_s320x320_tt6&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=EbgIQi5sj4sQ7kNvgGi_Jnu&_nc_gid=994b3785a2254332aa9fca65b577180b&edm=APs17CUBAAAA&ccb=7-5&oh=00_AYB5ar57ZTeoYfK-KC-JDjrhwA8C8y7nM-gGIeOKOYKDlw&oe=6783CA95&_nc_sid=10d13b",
            "width": 320
        }
    ],
    "profile_pic_url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.2885-19/357911524_3437512953129560_1652925957295034534_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_cat=108&_nc_ohc=EbgIQi5sj4sQ7kNvgGi_Jnu&_nc_gid=994b3785a2254332aa9fca65b577180b&edm=APs17CUBAAAA&ccb=7-5&oh=00_AYD72Yw_IMZO0IuHh4mjyphEMcOc8c0wIv68Z1Jmy-1v_g&oe=6783CA95&_nc_sid=10d13b",
    "username": "microsoft365",
    "friendship_status": null,
    "account_warning": null,
    "follower_count": 276277,
    "profile_context_facepile_users": null,
    "text_app_last_visited_time": null,
    "biography": "Blocked our calendar to thread",
    "text_app_biography": {
        "text_fragments": {
            "fragments": [
                {
                    "fragment_type": "plaintext",
                    "link_fragment": null,
                    "mention_fragment": null,
                    "plaintext": "Blocked our calendar to thread",
                    "tag_fragment": null,
                    "linkified_web_url": null
                }
            ]
        }
    },
    "account_badges": [],
    "text_post_app_remove_mention_entrypoint": null,
    "show_text_post_app_replies_tab": true,
    "is_verified": true,
    "full_name": "Microsoft 365",
    "bio_links": [
        {
            "url": "https://clicklinkin.bio/microsoft365",
            "is_verified": false,
            "link_id": "18098940622336912"
        }
    ],
    "transparency_label": null,
    "is_threads_only_user": false,
    "show_text_post_app_badge": true,
    "eligible_for_text_app_activation_badge": null,
    "hide_text_app_activation_badge_on_text_app": false,
    "text_app_favorite_user_notification_setting": null,
    "id": "625400346",
    "gating": null
}
```

**Get User Posts/Reposts** returns:

```
{
	"user": object,         // Same as "Get User Profile"
	"threads": array        // Same as "Search"
}
```

**Get User Replies** returns:

```
{
    "user": object,         // Same as "Get User Profile",
    "threads": [
        {
            "id": "3537687215457445735_46045452966",
            "url": "https://www.threads.net/@microsoftteams/post/DEYY8dryCdn",
            "text": "Our New Years resolution is to check our mic before speaking so we never have to say the words \"sorry I was on mute\" again.",
            "likes": 1144,
            "replies": 42,
            "reposts": 86,
            "quotes": 10,
            "shared": 66,
            "timestamp": 1735945203,
            "date": "2025-01-03",
            "pinned": false,
            "user": {                                               // User to which the account replied to
                "id": "46045452966",
                "username": "microsoftteams",
                "full_name": "",
                "url": "https://www.threads.net/@microsoftteams",
                "profile_pic_url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.2885-19/358209840_555660569905506_700622218812049265_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_cat=106&_nc_ohc=AY8HdTkxXHIQ7kNvgFdrvQa&_nc_gid=d49061c20a6c433a878e426cdd877edf&edm=APs17CUBAAAA&ccb=7-5&oh=00_AYDgOgSUZt6nr4oKA2yEwxVkZSWR9eO1mmQJG3nmLBsoXQ&oe=67849CC7&_nc_sid=10d13b",
                "follower_count": 0,
                "biography": "",
                "is_verified": true,
                "website": ""
            },
            "reply": {                                              // Reply content
                "id": "3539048076592196112_60457800418",
                "url": "https://www.threads.net/@0/post/DEdOXmYTqoQ",
                "text": "Aha, so true! Happy New Year!",
                "likes": 6,
                "replies": 0,
                "reposts": 1,
                "quotes": 0,
                "shared": 0,
                "timestamp": 1736107428,
                "date": "2025-01-05",
                "pinned": false,
                "user": null,
                "reply": null
            }
        },
        ...
    ]
}
```

### Limitations

⚠ Threads public frontend only returns the first page of posts.

### Support

Always use a proxy!

Open a new issue for bugs, please share your Run URL and Input 🎈

# Actor input Schema

## `process` (type: `string`):

No description

## `keyword` (type: `array`):

Format: Username or ID or URL.

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

Only applies to Search.

## `since` (type: `string`):

Applied after data collection. Format: YYYY-MM-DD

## `includeraw` (type: `string`):

Includes raw data.

## `maximum` (type: `integer`):

No description

## `pause` (type: `integer`):

Wait time between requests.

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "process": "gt",
  "keyword": [
    "microsoft365",
    "https://www.threads.net/@spotify/"
  ],
  "sort": "pinned",
  "includeraw": "no",
  "maximum": 25,
  "pause": 2,
  "proxy": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "keyword": [
        "microsoft365",
        "https://www.threads.net/@spotify/"
    ],
    "since": "",
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("canadesk/threads").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 = {
    "keyword": [
        "microsoft365",
        "https://www.threads.net/@spotify/",
    ],
    "since": "",
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("canadesk/threads").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 '{
  "keyword": [
    "microsoft365",
    "https://www.threads.net/@spotify/"
  ],
  "since": "",
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call canadesk/threads --silent --output-dataset

```

## MCP server setup

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

```

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/NzdcBhNkm63221iqF/builds/5UCXnebdc7mjuAUvC/openapi.json
