# 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:** 364 total users, 12 monthly users, 100.0% 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/platform/actors/running/actors-in-store#rental-actors

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=canadesk/threads",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Threads",
        "description": "Collect or Search for Posts and User profiles on Threads. It's fast and costs little!",
        "version": "1.4",
        "x-build-id": "5UCXnebdc7mjuAUvC"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/canadesk~threads/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-canadesk-threads",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/canadesk~threads/runs": {
            "post": {
                "operationId": "runs-sync-canadesk-threads",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/canadesk~threads/run-sync": {
            "post": {
                "operationId": "run-sync-canadesk-threads",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "keyword"
                ],
                "properties": {
                    "process": {
                        "title": "Process",
                        "enum": [
                            "gu",
                            "gt",
                            "gi",
                            "go",
                            "su",
                            "st"
                        ],
                        "type": "string",
                        "description": "",
                        "default": "gt"
                    },
                    "keyword": {
                        "title": "User Profiles",
                        "type": "array",
                        "description": "Format: Username or ID or URL.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "sort": {
                        "title": "Filter - Sorting",
                        "enum": [
                            "pinned",
                            "recent"
                        ],
                        "type": "string",
                        "description": "Only applies to Search.",
                        "default": "pinned"
                    },
                    "since": {
                        "title": "Filter - Since date",
                        "type": "string",
                        "description": "Applied after data collection. Format: YYYY-MM-DD"
                    },
                    "includeraw": {
                        "title": "Filter - Raw data",
                        "enum": [
                            "no",
                            "yes"
                        ],
                        "type": "string",
                        "description": "Includes raw data.",
                        "default": "no"
                    },
                    "maximum": {
                        "title": "Maximum results",
                        "minimum": 25,
                        "type": "integer",
                        "description": "",
                        "default": 25
                    },
                    "pause": {
                        "title": "Delay",
                        "minimum": 1,
                        "maximum": 30,
                        "type": "integer",
                        "description": "Wait time between requests.",
                        "default": 2
                    },
                    "proxy": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxies to be used by your crawler."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
