{
  "openapi": "3.0.1",
  "info": {
    "title": "Threads Scraper — Posts, Users, Replies & Media",
    "description": "Scrape public Threads posts, search users, extract post details and replies, and collect image/video URLs. Includes multi-query search, keyword and date filters, engagement filters when counts are available, deduplication, and structured Apify Dataset exports.",
    "version": "0.0",
    "x-build-id": "om30NEFR4dFVxmoVu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/heartening_ixia~thr2-3/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-heartening_ixia-thr2-3",
        "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/heartening_ixia~thr2-3/runs": {
      "post": {
        "operationId": "runs-sync-heartening_ixia-thr2-3",
        "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/heartening_ixia~thr2-3/run-sync": {
      "post": {
        "operationId": "run-sync-heartening_ixia-thr2-3",
        "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": "Operation mode",
            "enum": [
              "posts_search",
              "user_search",
              "post_details",
              "replies",
              "media"
            ],
            "type": "string",
            "description": "Choose what to extract from public Threads pages: search posts, discover users, inspect specific posts, collect visible replies, or extract media.",
            "default": "posts_search"
          },
          "searchQuery": {
            "title": "Post search query",
            "type": "string",
            "description": "Search public Threads posts by keyword, phrase, hashtag, or topic. Kept for compatibility with existing single-query inputs."
          },
          "searchQueries": {
            "title": "Post search queries",
            "type": "array",
            "description": "Run multiple Threads post searches in one Actor run. Results are deduplicated across queries and retain the query that found each post.",
            "items": {
              "type": "string"
            }
          },
          "userQuery": {
            "title": "User search query",
            "type": "string",
            "description": "Search for public Threads profiles by name, username, keyword, or topic. Use with user_search mode; provide userQueries instead for multiple searches."
          },
          "userQueries": {
            "title": "User search queries",
            "type": "array",
            "description": "Search for public Threads profiles using multiple terms in one run. Discovered profiles are deduplicated across queries; results depend on profiles surfaced by Threads search.",
            "items": {
              "type": "string"
            }
          },
          "postUrl": {
            "title": "Threads post URL",
            "type": "string",
            "description": "A public Threads post URL to inspect in post_details, replies, or media mode."
          },
          "postUrls": {
            "title": "Threads post URLs",
            "type": "array",
            "description": "One or more public Threads post URLs to inspect. Used by post_details, replies, and media modes.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Post search sorting",
            "enum": [
              "recent",
              "top"
            ],
            "type": "string",
            "description": "Choose recent to prioritize newer public posts or top to use Threads’ default/top search ordering. Applies to posts_search.",
            "default": "recent"
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of unique records to write to the Apify Dataset for the selected mode.",
            "default": 50
          },
          "maxPages": {
            "title": "Maximum search scrolls",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Approximate number of browser scroll cycles. This is not a guaranteed number of Threads server pages or a promise of complete search coverage.",
            "default": 5
          },
          "fromUser": {
            "title": "Filter by author username",
            "type": "string",
            "description": "Keep posts from this Threads username only. Enter the handle without the @ symbol."
          },
          "after": {
            "title": "Published after (UTC)",
            "type": "string",
            "description": "Keep posts published on or after this UTC date/time. Use YYYY-MM-DD or an ISO 8601 timestamp."
          },
          "before": {
            "title": "Published before (UTC)",
            "type": "string",
            "description": "Keep posts published on or before this UTC date/time. Use YYYY-MM-DD or an ISO 8601 timestamp."
          },
          "includeKeywords": {
            "title": "Include keywords or phrases",
            "type": "array",
            "description": "Keep posts whose text matches the supplied terms. Use keywordMatchMode to require all terms or at least one term.",
            "items": {
              "type": "string"
            }
          },
          "keywordMatchMode": {
            "title": "Keyword matching rule",
            "enum": [
              "all",
              "any"
            ],
            "type": "string",
            "description": "Choose all to require every include keyword, or any to keep a post when at least one include keyword matches.",
            "default": "all"
          },
          "excludeKeywords": {
            "title": "Exclude keywords or phrases",
            "type": "array",
            "description": "Discard posts when their text contains any listed term. Matching is applied to the extracted post text.",
            "items": {
              "type": "string"
            }
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Keep posts with at least this many likes. If the public page does not expose the count, the post is excluded because the threshold cannot be verified.",
            "default": 0
          },
          "maxLikes": {
            "title": "Maximum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Keep posts with no more than this many likes. Posts with unavailable counts are excluded because the maximum cannot be verified."
          },
          "minReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "type": "integer",
            "description": "Keep posts with at least this many replies. Posts with unavailable reply counts are excluded because the threshold cannot be verified."
          },
          "minReposts": {
            "title": "Minimum reposts",
            "minimum": 0,
            "type": "integer",
            "description": "Keep posts with at least this many reposts. Posts with unavailable repost counts are excluded because the threshold cannot be verified."
          },
          "minQuotes": {
            "title": "Minimum quote posts",
            "minimum": 0,
            "type": "integer",
            "description": "Keep posts with at least this many quotes. Posts with unavailable quote counts are excluded because the threshold cannot be verified."
          },
          "hasMedia": {
            "title": "Require image or video",
            "type": "boolean",
            "description": "When enabled, keep only posts for which the scraper discovers at least one accessible image or video URL.",
            "default": false
          },
          "mediaTypes": {
            "title": "Media type filter",
            "type": "array",
            "description": "Limit discovered media to images, videos, or both. In post search, a post is excluded if its media type cannot be established.",
            "items": {
              "type": "string",
              "enum": [
                "image",
                "video"
              ]
            }
          },
          "minTextLength": {
            "title": "Minimum post text length",
            "minimum": 0,
            "type": "integer",
            "description": "Keep posts whose extracted text contains at least this many characters."
          },
          "maxTextLength": {
            "title": "Maximum post text length",
            "minimum": 0,
            "type": "integer",
            "description": "Keep posts whose extracted text contains no more than this many characters."
          },
          "enrichDetails": {
            "title": "Open posts for detail enrichment",
            "type": "boolean",
            "description": "Open matching posts to look for additional public fields such as author details, engagement counts, and media URLs. This adds browser requests and can increase run time.",
            "default": true
          },
          "maxDetailEnrich": {
            "title": "Maximum posts to enrich",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Limit the number of search results opened for detail extraction. Higher values can increase run time and resource use.",
            "default": 50
          },
          "enrichProfiles": {
            "title": "Enrich discovered profiles",
            "type": "boolean",
            "description": "In user_search mode, open discovered public profiles to look for additional profile fields. Availability depends on what Threads exposes.",
            "default": true
          },
          "maxProfileEnrich": {
            "title": "Maximum profiles to enrich",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Limit the number of discovered profiles opened for profile enrichment.",
            "default": 50
          },
          "maxReplies": {
            "title": "Maximum visible replies per post",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of reply-like public cards to collect per supplied post. Threads may expose only a subset of replies.",
            "default": 200
          },
          "maxDepth": {
            "title": "Requested reply depth",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Requested nesting depth for replies. The current public-page extractor may only identify visible top-level reply-like cards; deeper recursion is not guaranteed.",
            "default": 3
          },
          "includeNestedReplies": {
            "title": "Include visible nested replies",
            "type": "boolean",
            "description": "Include nested replies when the public page exposes them. Enabling this does not guarantee that Threads will load or reveal nested replies.",
            "default": true
          },
          "downloadMedia": {
            "title": "Download image and video files",
            "type": "boolean",
            "description": "When enabled, attempt to download accessible media files to the Actor’s default Key-Value Store. Dataset rows contain file metadata and storage keys, not embedded binary files.",
            "default": false
          },
          "maxMediaPerPost": {
            "title": "Maximum media files per post",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of discovered media URLs to process for each supplied post.",
            "default": 10
          },
          "maxMediaSizeMb": {
            "title": "Maximum media file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum allowed size for each downloaded image or video file. Larger files are skipped.",
            "default": 25
          },
          "proxyFailureMode": {
            "title": "Proxy failure behavior",
            "enum": [
              "direct",
              "fail"
            ],
            "type": "string",
            "description": "Choose direct to continue without the proxy and record a warning, or fail to stop the run when proxy setup fails.",
            "default": "direct"
          },
          "proxyConfiguration": {
            "title": "Apify Proxy settings",
            "type": "object",
            "description": "Optional Apify Proxy configuration for browser requests. Proxy availability and access may depend on your Apify plan.",
            "default": {
              "useApifyProxy": false
            }
          },
          "debug": {
            "title": "Enable diagnostic logs",
            "type": "boolean",
            "description": "Write additional troubleshooting details to the run log. Keep disabled for normal production runs unless investigating a problem.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}