{
  "openapi": "3.0.1",
  "info": {
    "title": "Threads Search Scraper: Posts by Keyword & Hashtag",
    "description": "Search Threads posts by keyword, phrase or #hashtag without login: newest first or top, any date range, one author only. Text, likes, replies, reposts, exact views, media, links. Only new posts since the last run for brand and topic monitoring.",
    "version": "0.1",
    "x-build-id": "upPomJbZk6EBbA63f"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s_actors~threads-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s_actors-threads-search-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/s_actors~threads-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-s_actors-threads-search-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/s_actors~threads-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-s_actors-threads-search-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": {
          "searchQueries": {
            "title": "🔍 Search keywords",
            "type": "array",
            "description": "One per line: a keyword, a phrase, a #hashtag or a Threads search link (threads.com/search?q=...). Each search is run separately; a post found by two searches is written and charged once.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "↕️ Sort",
            "enum": [
              "recent",
              "top"
            ],
            "type": "string",
            "description": "Recent = the newest matching posts, going back hour by hour (best for monitoring and brand mentions). Top = the posts Threads ranks highest: first the overall top, then the top of each day going back (best with a date range).",
            "default": "recent"
          },
          "maxPostsPerQuery": {
            "title": "📝 Max posts per search",
            "minimum": 0,
            "type": "integer",
            "description": "How many posts to scrape for each search. 0 = all that Threads gives (up to a few thousand for busy keywords; rare keywords have fewer posts).",
            "default": 100
          },
          "postedAfter": {
            "title": "📅 Posted after",
            "type": "string",
            "description": "Only posts published after this: a date like 2026-01-01 or a period like 24 hours, 7 days, 2 weeks, 6 months (ago). The search stops there."
          },
          "postedBefore": {
            "title": "📅 Posted before",
            "type": "string",
            "description": "Only posts published before this: a date like 2026-03-01 or a period like 30 days (ago). Together with Posted after = search any past period."
          },
          "fromAuthor": {
            "title": "👤 Only posts by this profile",
            "type": "string",
            "description": "Optional: search only one account's posts (@username, a username or a profile link), like Threads' own \"from:\" filter."
          },
          "minLikes": {
            "title": "❤️ Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many likes. Leave empty for all."
          },
          "excludeReplies": {
            "title": "🚫 Skip replies",
            "type": "boolean",
            "description": "Leave out matching posts that are replies to someone else's post (keep only original posts).",
            "default": false
          },
          "includeViews": {
            "title": "👁️ View counts",
            "type": "boolean",
            "description": "Exact view count of each post (and the engagement rate from it). Threads shows views only on the post page, so the Actor reads the start of each page: about 0.2 seconds per post. Turn off for the fastest runs.",
            "default": true
          },
          "onlyNewPosts": {
            "title": "🔔 Only new posts since the previous run",
            "type": "boolean",
            "description": "Recent: output only posts newer than the newest post of the previous run for the same search and author (key-value store threads-search-state); the search stops there. Top: only posts no earlier run delivered. The first run outputs posts as usual and remembers them. A run with no new posts costs only the start.",
            "default": false
          },
          "maxConcurrency": {
            "title": "⚡ Searches at the same time",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many searches run in parallel. Each search pages back on its own (12-20 posts a call).",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy",
            "type": "object",
            "description": "Requests go direct first and switch to Apify datacenter proxies (then residential) when Threads refuses them. The default works for most runs.",
            "default": {
              "useApifyProxy": true
            }
          },
          "debugLog": {
            "title": "🐞 Debug log",
            "type": "boolean",
            "description": "Log every retried request (for troubleshooting).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}