{
  "openapi": "3.0.1",
  "info": {
    "title": "Threads Scraper: Posts, Profiles & Search",
    "description": "Scrape public Threads profiles, recent posts, direct posts, visible replies, keyword search, engagement metrics, and media. No login required.",
    "version": "0.1",
    "x-build-id": "gc775hWQuCu1jZZgj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetch_cat~threads-profile-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetch_cat-threads-profile-posts-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/fetch_cat~threads-profile-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fetch_cat-threads-profile-posts-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/fetch_cat~threads-profile-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fetch_cat-threads-profile-posts-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": {
          "usernames": {
            "title": "Threads usernames or profile URLs",
            "maxItems": 100,
            "type": "array",
            "description": "Public Threads handles or profile URLs. Used by Profile details and Profile posts modes. At most 100 combined inputs across all input lists.",
            "items": {
              "type": "string",
              "maxLength": 2048
            }
          },
          "postUrls": {
            "title": "Threads post URLs",
            "maxItems": 100,
            "type": "array",
            "description": "Full public post URLs such as https://www.threads.com/@zuck/post/SHORTCODE. Direct post mode returns each post and can include its visible replies.",
            "items": {
              "type": "string",
              "maxLength": 2048
            }
          },
          "searchQueries": {
            "title": "Keywords or hashtags",
            "maxItems": 100,
            "type": "array",
            "description": "Search terms such as artificial intelligence, your brand name, or #marketing. Threads exposes a limited recent public search window.",
            "items": {
              "type": "string",
              "maxLength": 200
            }
          },
          "maxPosts": {
            "title": "Maximum posts per target",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum post rows per username or search query. Public logged-out pages may expose fewer rows than this limit.",
            "default": 20
          },
          "includeProfile": {
            "title": "Include profile details",
            "type": "boolean",
            "description": "Save one profile row before post rows in Profile posts mode.",
            "default": true
          },
          "includeReplies": {
            "title": "Include visible replies",
            "type": "boolean",
            "description": "In Direct posts and replies mode, request additional visible replies. The initial visible reply window can still be returned when false. Set maxRepliesPerPost to 0 for only the root post.",
            "default": true
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "posts",
              "profile",
              "post",
              "search",
              "auto"
            ],
            "type": "string",
            "description": "Profile details and Profile posts require usernames or legacy profile inputs; Direct posts requires postUrls; Keyword search requires searchQueries. Auto processes every supplied input type, including legacy profile inputs. If no valid inputs match the selected mode, the run performs no collection and explains the correction in a warning and RUN_SUMMARY.",
            "default": "posts"
          },
          "profileUrlsOrUsernames": {
            "title": "Legacy profile URLs or usernames",
            "maxItems": 100,
            "type": "array",
            "description": "Backward-compatible alias for usernames. Existing API calls and saved tasks can keep using this field.",
            "items": {
              "type": "string",
              "maxLength": 2048
            }
          },
          "maxPostsPerProfile": {
            "title": "Legacy maximum posts per profile",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Backward-compatible alias for maxPosts. This legacy field takes precedence when both are supplied, including when maxPosts was added by a form default."
          },
          "maxRepliesPerPost": {
            "title": "Maximum replies per direct post",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum visible reply rows saved for each direct post URL.",
            "default": 20
          },
          "postedAfter": {
            "title": "Posted at or after",
            "type": "string",
            "description": "Optional inclusive ISO 8601 date or timestamp, for example 2026-07-01T00:00:00Z."
          },
          "postedBefore": {
            "title": "Posted before",
            "type": "string",
            "description": "Optional exclusive ISO 8601 date or timestamp. Must be later than Posted at or after."
          },
          "connectionMode": {
            "title": "Connection",
            "enum": [
              "automatic",
              "direct"
            ],
            "type": "string",
            "description": "Automatic preserves the existing managed-proxy-first strategy, with bounded retries and direct fallback. Managed proxy traffic may add platform costs. Direct makes only direct requests, with no paid fallback. Explicit proxyConfiguration settings take precedence over this choice, including saved opt-outs and customer pools. Omitted settings use Automatic.",
            "default": "automatic"
          },
          "proxyConfiguration": {
            "title": "Existing or custom proxy settings (optional)",
            "type": "object",
            "description": "Optional legacy managed settings or customer proxy pool. When supplied, these settings override Connection, including its form default. Existing useApifyProxy:false stays direct unless a customer pool is supplied. Customer pools retain their existing bounded rotation and direct fallback. Named groups require account access. Leave this field absent to use Connection. Invalid settings fail rather than enabling another paid route."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}