{
  "openapi": "3.0.1",
  "info": {
    "title": "Threads Com Scraper - Posts, Likes & Replies by Profile",
    "description": "Scrape threads.com — records. Every record carries publish date, like and view counts disabled and replies the source publishes. Replies is included where the source lists it. Structured rows, ready to import into a CRM or a spreadsheet.",
    "version": "0.1",
    "x-build-id": "JKbqJuBwIdxe4gag8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/blackfalcondata~threads-com-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-blackfalcondata-threads-com-scraper",
        "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/blackfalcondata~threads-com-scraper/runs": {
      "post": {
        "operationId": "runs-sync-blackfalcondata-threads-com-scraper",
        "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/blackfalcondata~threads-com-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-blackfalcondata-threads-com-scraper",
        "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",
        "properties": {
          "query": {
            "title": "👤 Threads Profile(s)",
            "type": "string",
            "description": "Threads handle or profile URL — e.g. `nasa`, `@nasa` or `https://www.threads.com/@nasa`. Paste a JSON array for several profiles, e.g. [\"nasa\",\"zuck\"]. Used when no Start URLs, Post URLs, keywords or hashtags are given."
          },
          "maxResults": {
            "title": "💯 Max Posts",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum total posts across all profiles (0 = unlimited).",
            "default": 100
          },
          "startUrls": {
            "title": "🔗 Start URLs",
            "type": "array",
            "description": "Paste Threads URLs: profile URLs (`https://www.threads.com/@nasa`, read with the chosen Profile Mode), post URLs (`https://www.threads.com/@nasa/post/DfQYRbLEQA9`, the post plus its replies) search URLs (`https://www.threads.com/search?q=space`, `&serp_type=recent` for the Recent tab, `&serp_type=tags` for a hashtag, `&serp_type=accounts` for matching profiles) or tag URLs (`https://www.threads.com/tag/coffee`). Each URL becomes its own task; results are merged and deduped by post ID. When any URL, keyword, hashtag or account search is given, the profile field is not used (unsupported URLs are skipped, and if none is supported the run stops with an input error).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "mode": {
            "title": "🧭 Profile Mode",
            "enum": [
              "posts",
              "replies",
              "reposts",
              "profile"
            ],
            "type": "string",
            "description": "What to read from each profile: `posts` = the profile's own posts (default), `replies` = the replies it wrote, `reposts` = posts it reposted (each row is the reposted post, with `repostedBy`), `profile` = one profile row per account (followers, bio, links) instead of posts.",
            "default": "posts"
          },
          "postUrls": {
            "title": "🧵 Post URLs",
            "type": "array",
            "description": "Specific posts to scrape, e.g. `https://www.threads.com/@nasa/post/DfQYRbLEQA9`. Each delivers the post itself, plus its replies when Include Replies is on.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "includeReplies": {
            "title": "💬 Include Replies",
            "type": "boolean",
            "description": "For post URLs: also deliver the replies under the post (each reply row carries `replyToPostCode`).",
            "default": true
          },
          "searchQueries": {
            "title": "🔍 Keyword Search",
            "type": "array",
            "description": "Keywords to search Threads for, e.g. `climate change`. Logged-out Threads shows one result page per search (about 15–20 posts), so each keyword delivers at most that many posts.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "expandQueries": {
            "title": "🧩 Expand Keywords",
            "type": "boolean",
            "description": "Also search each keyword on the other tab (Top and Recent), as a hashtag (spaces removed, e.g. `coffee shop` → #coffeeshop) and in its singular/plural form (`coffee shops`). Reaches more posts per keyword; duplicates are delivered once. Off by default.",
            "default": false
          },
          "profileSearchQueries": {
            "title": "🧑 Find Profiles",
            "type": "array",
            "description": "Keywords to discover Threads accounts, e.g. `coffee roaster`. Each keyword delivers up to 10 matching accounts (the most Threads shows logged-out) as profile rows with username, name, profile link, picture and verification.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "hashtags": {
            "title": "#️⃣ Hashtags",
            "type": "array",
            "description": "Hashtags to read, with or without `#`, e.g. `coffee`. Like keyword search, each hashtag delivers one result page (about 15–20 posts).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "searchSortType": {
            "title": "↕️ Search Sort",
            "enum": [
              "top",
              "recent"
            ],
            "type": "string",
            "description": "For keyword search: `top` = Threads' Top tab, `recent` = the Recent tab (newest first).",
            "default": "top"
          },
          "postedAfter": {
            "title": "📅 Posted After",
            "type": "string",
            "description": "Only deliver posts published after this date: an absolute date (`2026-10-01`) or a window back from now (`7 days`, `24 hours`, `2 weeks`). On a profile feed the run also stops reading once a whole page is older."
          },
          "postedBefore": {
            "title": "📅 Posted Before",
            "type": "string",
            "description": "Only deliver posts published before this date (`2026-10-31`) or window (`30 days`)."
          },
          "minLikes": {
            "title": "❤️ Min Likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only deliver posts with at least this many likes (0 = no filter).",
            "default": 0
          },
          "minReplies": {
            "title": "💬 Min Replies",
            "minimum": 0,
            "type": "integer",
            "description": "Only deliver posts with at least this many replies (0 = no filter).",
            "default": 0
          },
          "includeDetails": {
            "title": "📋 Include Author Details",
            "type": "boolean",
            "description": "Also fetch the profile record so each post carries author follower count and biography.",
            "default": true
          },
          "textMaxLength": {
            "title": "✂️ Post Text Max Length",
            "minimum": 0,
            "type": "integer",
            "description": "Truncate post text to N characters. 0 = no truncation.",
            "default": 0
          },
          "compact": {
            "title": "📦 Compact Output",
            "type": "boolean",
            "description": "Core fields only (for AI-agent/MCP workflows).",
            "default": false
          },
          "excludeEmptyFields": {
            "title": "Exclude empty fields from output",
            "type": "boolean",
            "description": "Drop null, empty-string, and empty-array fields from each record before push. Smaller payloads for AI agents and dashboards.",
            "default": false
          },
          "incrementalMode": {
            "title": "♻️ Incremental Mode",
            "type": "boolean",
            "description": "Compare against previous run state. stateKey is optional — defaults to a value derived from the profiles requested so different profile sets never share state.",
            "default": false
          },
          "stateKey": {
            "title": "🔑 State Key",
            "type": "string",
            "description": "Optional. Stable identifier for the tracked profile universe. Leave empty to auto-generate from the requested profiles."
          },
          "includeKeywords": {
            "title": "🔎 Only Posts Containing",
            "type": "array",
            "description": "Keep only posts whose text contains at least one of these words or phrases (not case-sensitive). Leave empty to keep all posts. Posts that are filtered out are not returned, not charged and do not count toward Max Posts.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "🚫 Skip Posts Containing",
            "type": "array",
            "description": "Skip posts whose text contains any of these words or phrases (not case-sensitive). Leave empty to skip nothing. Skipped posts are not returned, not charged and do not count toward Max Posts.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "skipReposts": {
            "title": "🚫 Skip Reposts",
            "type": "boolean",
            "description": "When incremental, skip posts whose content matches a post that disappeared in a prior run (cross-run duplicate detection).",
            "default": false
          },
          "emitUnchanged": {
            "title": "🔄 Emit Unchanged Posts",
            "type": "boolean",
            "description": "When incremental mode is on, also emit posts whose content has not changed since the last run.",
            "default": false
          },
          "emitExpired": {
            "title": "⚰️ Emit Deleted Posts",
            "type": "boolean",
            "description": "When incremental mode is on, also emit posts that were seen before but are no longer found.",
            "default": false
          },
          "notifyOnlyChanges": {
            "title": "🔄 Notify Only New/Updated",
            "type": "boolean",
            "description": "When Incremental Mode is on, only send notifications for NEW and UPDATED posts. Has no effect outside incremental mode.",
            "default": false
          },
          "notificationLimit": {
            "title": "📊 Max Posts Per Notification",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of posts included in each notification message (1–20).",
            "default": 5
          },
          "telegramToken": {
            "title": "🔑 Telegram Bot Token",
            "type": "string",
            "description": "Telegram bot token (from @BotFather). Required for Telegram notifications."
          },
          "telegramChatId": {
            "title": "💬 Telegram Chat ID",
            "type": "string",
            "description": "Telegram chat or channel ID (e.g. \"-100123456789\"). Required when telegramToken is set."
          },
          "discordWebhookUrl": {
            "title": "🎮 Discord Webhook URL",
            "type": "string",
            "description": "Discord incoming webhook URL. Server Settings → Integrations → Webhooks → New Webhook."
          },
          "slackWebhookUrl": {
            "title": "💼 Slack Webhook URL",
            "type": "string",
            "description": "Slack incoming webhook URL. api.slack.com/messaging/webhooks."
          },
          "whatsappPhoneNumberId": {
            "title": "📞 WhatsApp Phone Number ID",
            "type": "string",
            "description": "Your WhatsApp Business phone-number ID (numeric, from Meta dashboard). Required when whatsappAccessToken is set."
          },
          "whatsappAccessToken": {
            "title": "📱 WhatsApp Access Token",
            "type": "string",
            "description": "WhatsApp Cloud API permanent access token (System User token from Meta Business). Recipient must have messaged the business number within the last 24h (service-conversation window — free since Nov 2024)."
          },
          "whatsappTo": {
            "title": "📲 WhatsApp Recipient",
            "type": "string",
            "description": "Recipient phone in E.164 format without + (e.g. \"436641234567\"). Recipient must have messaged your business number within last 24h."
          },
          "webhookUrl": {
            "title": "🪝 Generic Webhook URL",
            "type": "string",
            "description": "Receives a JSON POST with {metadata, items} after each run. Universal escape hatch for n8n / Make / Zapier / custom backends."
          },
          "webhookHeaders": {
            "title": "📋 Webhook Headers",
            "type": "object",
            "description": "Optional JSON object of custom headers (e.g. {\"Authorization\":\"Bearer ...\"})."
          },
          "appConnector": {
            "title": "Send results to a connected app",
            "type": "string",
            "description": "Optional. Pick a connected app under Settings → API & Integrations to receive your results. Best-effort across MCP connectors as Apify expands its catalog."
          },
          "mcpIssueTeam": {
            "title": "Issue tracker team",
            "type": "string",
            "description": "Only when the connected app is an issue tracker: the team (name or ID) the summary issue is created under, if that app requires one."
          },
          "descriptionFormat": {
            "title": "📝 Description Format",
            "enum": [
              "all",
              "text",
              "html",
              "markdown"
            ],
            "type": "string",
            "description": "Which text variants each post carries. `all` keeps `text`, `textHtml` and `textMarkdown`; `text` keeps only `text`; `html` keeps `text` and `textHtml`; `markdown` keeps `text` and `textMarkdown`.",
            "default": "all"
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}