{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram & Threads Scraper: 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. Add your own cookies to search signed in and get the full results.",
    "version": "0.2",
    "x-build-id": "qUk2QCgWha6iRPegz"
  },
  "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",
              "PROFILE_COMPARISON",
              "INSTAGRAM_POSTS",
              "THREADS_POSTS",
              "ALL_CONTENT"
            ],
            "type": "string",
            "description": "Search public content by query. Legacy profile modes remain supported for existing API integrations.",
            "default": "META_SEARCH"
          },
          "queries": {
            "title": "🔎 Search query(ies)",
            "maxItems": 50,
            "type": "array",
            "description": "Enter keywords or hashtags, one per row. Instagram queries are searched as public hashtags; Threads queries search public indexed posts.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "instagramCookies": {
            "title": "🔑 Your Instagram cookies (unlocks real Instagram search)",
            "type": "string",
            "description": "Paste the cookies from a browser where you are signed in to Instagram — either a 'name=value; name2=value2' string or the JSON a cookie-export extension gives you. With a session the actor queries Instagram's own search and returns accounts (with follower context and a Threads badge), hashtags with post counts and places. Without it, search falls back to public results only."
          },
          "threadsCookies": {
            "title": "🔑 Your Threads cookies (unlocks Threads search)",
            "type": "string",
            "description": "Paste the cookies from a browser where you are signed in to Threads — a 'name=value; …' string or a cookie-export JSON. Threads shows no search results at all when signed out, so this is required for the Threads search mode. Returns matching posts with like, reply, repost and quote counts, plus one row per author found."
          },
          "maxResults": {
            "title": "🎯 Maximum output results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of paid rows written to the main Results dataset for this run.",
            "default": 100
          },
          "maxResultsPerQuery": {
            "title": "🔢 Results per query",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum public posts collected for each query and platform before duplicate URLs are removed.",
            "default": 10
          },
          "maxPostsPerProfile": {
            "title": "🗂️ Posts per profile (legacy)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Legacy profile-mode setting. Query modes use Results per query instead.",
            "default": 10
          },
          "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": "🌐 Connection settings",
            "type": "object",
            "description": "Optional connection settings. 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}