{
  "openapi": "3.0.1",
  "info": {
    "title": "Threads Scraper - Profiles, Posts, Replies & Leads",
    "description": "Scrape Threads (Meta): full profiles (followers, bio, verified, links), posts with likes/replies/reposts/quotes & media, post replies, plus creator/brand leads with emails & socials. Monitor for new posts.",
    "version": "1.0",
    "x-build-id": "zGlSgplmnYfSmN5cW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~threads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-threads-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/scrapesage~threads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-threads-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/scrapesage~threads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-threads-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": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "profiles",
              "userPosts",
              "post"
            ],
            "type": "string",
            "description": "<b>Profiles</b> = full profile for each username/URL (followers, bio, verified, links, recent posts + optional contact leads). <b>User posts</b> = a profile's recent posts/replies as individual records. <b>Post</b> = a single post/thread by URL, with its replies.",
            "default": "profiles"
          },
          "usernames": {
            "title": "Usernames / profile URLs",
            "type": "array",
            "description": "Threads usernames or profile URLs for <b>Profiles</b> and <b>User posts</b> modes. Accepts <code>@zuck</code>, <code>zuck</code>, or <code>https://www.threads.com/@zuck</code>.",
            "items": {
              "type": "string"
            }
          },
          "includePosts": {
            "title": "Include recent posts on each profile",
            "type": "boolean",
            "description": "In <b>Profiles</b> mode, attach the profile's most recent posts (with full engagement & media) inline on the profile record.",
            "default": true
          },
          "postTabs": {
            "title": "Which posts to collect",
            "type": "array",
            "description": "In <b>User posts</b> mode (and for inline profile posts), which profile tabs to pull recent posts from. <code>threads</code> = the user's own posts, <code>replies</code> = posts they replied to, <code>media</code> = their media posts. Combine for more depth (~4–6 recent items per tab).",
            "items": {
              "type": "string",
              "enum": [
                "threads",
                "replies",
                "media"
              ]
            },
            "default": [
              "threads"
            ]
          },
          "maxPostsPerProfile": {
            "title": "Max posts per profile",
            "minimum": 1,
            "type": "integer",
            "description": "Cap the number of recent posts collected per profile (across the selected tabs).",
            "default": 20
          },
          "enrichLeads": {
            "title": "Enrich profiles into contact leads",
            "type": "boolean",
            "description": "In <b>Profiles</b> mode, parse contact emails & phone from the bio, classify linked socials, crawl the linked website (home + contact/about, max 3 pages) for emails/phone/socials, and compute a 0–100 lead score. Turns each profile into a ready-to-contact B2B/creator lead.",
            "default": false
          },
          "leadsOnly": {
            "title": "Only output profiles that became leads",
            "type": "boolean",
            "description": "When lead enrichment is on, only emit profiles that yielded at least one contact email (skip profiles with no reachable contact).",
            "default": false
          },
          "postUrls": {
            "title": "Post / thread URLs",
            "type": "array",
            "description": "Threads post URLs for <b>Post</b> mode, e.g. <code>https://www.threads.com/@zuck/post/DZpPDXbCeTt</code> or a short <code>https://www.threads.com/t/DZpPDXbCeTt</code>. A bare post code also works.",
            "items": {
              "type": "string"
            }
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "In <b>Post</b> mode, also output the replies in the thread (each as its own record) below the root post.",
            "default": true
          },
          "maxRepliesPerPost": {
            "title": "Max replies per post",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the number of replies collected per thread.",
            "default": 50
          },
          "startUrls": {
            "title": "Start URLs (profiles or posts)",
            "type": "array",
            "description": "Paste Threads URLs — profile pages (<code>/@user</code>) or post pages (<code>/@user/post/CODE</code>, <code>/t/CODE</code>). Each is auto-routed to the right scraper.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of records to return for this run (0 = no limit).",
            "default": 0
          },
          "monitorMode": {
            "title": "Monitor mode (only new data)",
            "type": "boolean",
            "description": "Remember records seen on previous runs (in a named key-value store) and output only NEW ones — perfect for alerting on new posts from tracked creators or new replies on a thread. Combine with Apify <a href='https://docs.apify.com/platform/schedules'>Schedules</a> to poll automatically.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Name of the key-value store that holds the 'seen' fingerprints for monitor mode. Use different names to track different watchlists independently.",
            "default": "threads-monitor"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Threads works on Apify's datacenter proxy (fast & cheap, recommended). Switch to residential if you hit blocks from your region.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}