{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram & Threads Scraper API: Search, Profiles & Posts",
    "description": "Search Instagram and Threads by keyword in one Actor. Get accounts, hashtags with post counts, and Threads posts with like, reply, repost and quote counts - plus profile and post modes for any creator. Signed-in search is built in, so you get the full results with nothing to set up.",
    "version": "0.2",
    "x-build-id": "Zpxnj5mNLhbEh24sk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/trakk~threads-profile-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-trakk-threads-profile-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/trakk~threads-profile-scraper/runs": {
      "post": {
        "operationId": "runs-sync-trakk-threads-profile-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/trakk~threads-profile-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-trakk-threads-profile-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": [
              "META_SEARCH",
              "INSTAGRAM_SEARCH",
              "THREADS_SEARCH",
              "INSTAGRAM_PROFILES",
              "THREADS_PROFILES",
              "INSTAGRAM_POSTS",
              "THREADS_POSTS",
              "PROFILE_COMPARISON",
              "ALL_CONTENT"
            ],
            "type": "string",
            "description": "Pick a workflow. Search modes find accounts, hashtags and posts by keyword. Profile and post modes pull data for specific creators. Comparison lines a creator up across both platforms.",
            "default": "META_SEARCH"
          },
          "queries": {
            "title": "🔎 Search queries",
            "maxItems": 50,
            "type": "array",
            "description": "Keywords or hashtags to search, one per row. Used by the three search modes. Instagram returns accounts, hashtags (with post counts) and places; Threads returns matching posts and their authors.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "searchSort": {
            "title": "↕️ Sort search results",
            "enum": [
              "top",
              "recent"
            ],
            "type": "string",
            "description": "Order search results by most relevant (top) or newest (recent). Applies to Threads search.",
            "default": "top"
          },
          "usernames": {
            "title": "👤 Usernames or profile URLs",
            "type": "array",
            "description": "Instagram or Threads creators to pull data for, one per row — a username, @handle, or full profile URL. Used by the profile, post, comparison and all-content modes.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "directUrls": {
            "title": "🔗 Direct URLs",
            "type": "array",
            "description": "Paste Instagram or Threads URLs — profile URLs, Threads post URLs, or hashtag URLs (instagram.com/explore/tags/…). Profile and post URLs are scraped for that creator; hashtag URLs are added to the search queries. Mixed Instagram and Threads URLs are fine.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxResults": {
            "title": "🎯 Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard stop for the number of paid rows written to the main Results dataset for the whole run.",
            "default": 100
          },
          "resultsLimit": {
            "title": "🔢 Results per profile / query",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many posts to collect per profile, or how many hits to collect per search query, before duplicates are removed.",
            "default": 10
          },
          "onlyPostsNewerThan": {
            "title": "📅 Only posts newer than",
            "type": "string",
            "description": "Keep only posts published on or after this moment. Accepts a date (2024-01-31), an ISO timestamp, or a relative value like \"7 days\", \"2 months\", \"1 year\". Leave empty for no date filter."
          },
          "maxResultsPerQuery": {
            "title": "🔢 Results per query (override)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Advanced override of Results per profile / query for search modes only. Leave empty to use Results per profile / query."
          },
          "maxPostsPerProfile": {
            "title": "🗂️ Posts per profile (override)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Advanced override of Results per profile / query for the profile and post modes only. Leave empty to use Results per profile / query."
          },
          "maxConcurrency": {
            "title": "⚡ Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum parallel HTTP requests. Keep the default for most runs.",
            "default": 40
          },
          "maxRetries": {
            "title": "🔁 Max retries",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Retry budget for temporary source or connection errors.",
            "default": 1
          },
          "timeoutSecs": {
            "title": "⏱️ Request timeout",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time for one HTTP request.",
            "default": 8
          },
          "rawOutput": {
            "title": "🧪 Include raw fields",
            "type": "boolean",
            "description": "Keep selected source payloads for debugging. Leave disabled for clean tables.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "Proxy settings. Residential proxy is recommended for the largest runs; direct requests are used by default.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}