{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Scraper - Posts, Profiles & Reels",
    "description": "Scrape Instagram profiles, posts, reels, comments, followers, hashtags, locations, search, and more through 36 API endpoints with automatic pagination. Powered by Titan Network.",
    "version": "0.1",
    "x-build-id": "NaNOAK0Zp8pPdYyYW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/titan_network~dataclawd-instagram-data-collector/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-titan_network-dataclawd-instagram-data-collector",
        "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/titan_network~dataclawd-instagram-data-collector/runs": {
      "post": {
        "operationId": "runs-sync-titan_network-dataclawd-instagram-data-collector",
        "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/titan_network~dataclawd-instagram-data-collector/run-sync": {
      "post": {
        "operationId": "run-sync-titan_network-dataclawd-instagram-data-collector",
        "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": {
          "task": {
            "title": "采集任务 / Collection task",
            "enum": [
              "userInfo",
              "userPosts",
              "userReels",
              "userFollowers",
              "userFollowing",
              "postDetail",
              "postComments",
              "postLikers",
              "hashtagTop",
              "hashtagRecent",
              "search",
              "searchUsers",
              "searchPlaces",
              "locationFeeds",
              "explore"
            ],
            "type": "string",
            "description": "要采集的 Instagram 数据场景。选一个即可，Actor 会自动映射到对应端点；参数填在下方对应字段（username/userId/shortcode/q 等）。留空则须在「高级选项」里手动指定 endpoint。 / The Instagram data scenario to collect. Choose one and the Actor maps it to the corresponding endpoint automatically; fill in the parameters in the matching fields below (username/userId/shortcode/q, etc.). Leave empty to manually specify the endpoint in \"Advanced options\"."
          },
          "endpoint": {
            "title": "采集端点 / Collection endpoint",
            "enum": [
              "auto",
              "idUserId",
              "idUsername",
              "idMediaId",
              "idMediaShortcode",
              "userInfo",
              "userProfile",
              "userProfile2",
              "userWebProfile",
              "userPosts",
              "userPosts2",
              "userReels",
              "userTagged",
              "userReposts",
              "userRelatedProfiles",
              "userFollowers",
              "userFollowing",
              "postDetail",
              "postComments",
              "postTopComments",
              "postLikers",
              "postDownloadLink",
              "postVideoUrl",
              "hashtagInfo",
              "hashtagRecent",
              "hashtagTop",
              "search",
              "searchUsers",
              "searchHashtags",
              "searchPlaces",
              "exploreSection",
              "exploreSections",
              "locationFeeds",
              "locationInfo2",
              "directoryCities",
              "directoryLocations",
              "musicInfo"
            ],
            "type": "string",
            "description": "高级选项：默认 auto（按「采集任务 task」自动选择端点）；也可手动指定具体端点覆盖 task。 / Advanced options: defaults to auto (the endpoint is selected automatically based on the \"Collection task\" field); you can also manually specify a concrete endpoint to override task.",
            "default": "auto"
          },
          "userId": {
            "title": "Instagram 用户 ID / Instagram user ID",
            "type": "string",
            "description": "Instagram 数字用户 ID（user* 多数端点必填）。可用 idUserId 端点由用户名获取。 / Instagram numeric user ID (required by most user* endpoints). Use the idUserId endpoint to obtain it from a username."
          },
          "username": {
            "title": "Instagram 用户名 / Instagram username",
            "type": "string",
            "description": "Instagram 用户名（不含 @），例如 instagram。部分端点按用户名查询。 / Instagram username without @, e.g. instagram. Some endpoints query by username."
          },
          "shortcode": {
            "title": "帖子短码 / Post shortcode",
            "type": "string",
            "description": "帖子/Reel 短码（帖子 URL 中 /p/ 或 /reel/ 后的部分），例如 C4PYiJQubeR。post* 端点需要。 / Post/Reel shortcode (the part after /p/ or /reel/ in the post URL), e.g. C4PYiJQubeR. Required by post* endpoints."
          },
          "url": {
            "title": "帖子 URL / Post URL",
            "type": "string",
            "description": "帖子/Reel 完整 URL（与 shortcode 二选一），例如 https://www.instagram.com/reel/C4PYiJQubeR/。 / Full post/Reel URL (alternative to shortcode), e.g. https://www.instagram.com/reel/C4PYiJQubeR/."
          },
          "q": {
            "title": "搜索关键词 / Search keyword",
            "type": "string",
            "description": "hashtag* / search* 端点必填，例如 nature、instagram。 / Required for hashtag* / search* endpoints, e.g. nature, instagram."
          },
          "type": {
            "title": "搜索类型 / Search type",
            "enum": [
              "blended",
              "users",
              "hashtags",
              "places"
            ],
            "type": "string",
            "description": "search 系列端点类型：blended（综合）/ users / hashtags / places。 / Type for search endpoints: blended (general) / users / hashtags / places.",
            "default": "blended"
          },
          "count": {
            "title": "每页条数 / Items per page",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "每页返回条数（IG 常用 12/30）。 / Number of items returned per page (12/30 is common on IG).",
            "default": 12
          },
          "locationPk": {
            "title": "地点 ID / Location ID",
            "type": "string",
            "description": "Instagram 地点 ID（location_pk），location* 端点需要。 / Instagram location ID (location_pk), required by location* endpoints."
          },
          "lat": {
            "title": "纬度 / Latitude",
            "type": "string",
            "description": "纬度（directory 端点按坐标搜索时用）。 / Latitude (used when searching by coordinates in directory endpoints)."
          },
          "lng": {
            "title": "经度 / Longitude",
            "type": "string",
            "description": "经度（directory 端点按坐标搜索时用）。 / Longitude (used when searching by coordinates in directory endpoints)."
          },
          "tab": {
            "title": "帖子 Tab / Posts tab",
            "enum": [
              "ranked",
              "recent"
            ],
            "type": "string",
            "description": "location/feeds 端点：ranked（热门）/ recent（最新）。 / For location/feeds endpoints: ranked (top) / recent (latest).",
            "default": "ranked"
          },
          "countryCode": {
            "title": "国家代码 / Country code",
            "type": "string",
            "description": "directory/cities 端点国家代码，例如 US。 / Country code for directory/cities endpoints, e.g. US."
          },
          "cityId": {
            "title": "城市 ID / City ID",
            "type": "string",
            "description": "directory/locations 端点城市 ID。 / City ID for directory/locations endpoints."
          },
          "page": {
            "title": "页码 / Page number",
            "minimum": 1,
            "type": "integer",
            "description": "directory 端点分页页码（从 1 开始）。 / Pagination page number for directory endpoints (starts from 1).",
            "default": 1
          },
          "musicId": {
            "title": "音乐 ID / Music ID",
            "type": "string",
            "description": "音乐 ID（musicInfo 端点需要）。 / Music ID (required by the musicInfo endpoint)."
          },
          "sectionId": {
            "title": "探索板块 ID / Explore section ID",
            "type": "string",
            "description": "explore 系列端点板块 ID（可选）。 / Section ID for explore endpoints (optional)."
          },
          "maxId": {
            "title": "起始游标 maxId / Start cursor maxId",
            "type": "string",
            "description": "search/hashtag/explore/music 系列端点的起始分页游标（max_id）。留空从第一页开始。 / Starting pagination cursor (max_id) for search/hashtag/explore/music endpoints. Leave empty to start from the first page."
          },
          "targets": {
            "title": "目标列表（可选）/ Target list (optional)",
            "type": "array",
            "description": "批量采集：每个元素是一组参数（覆盖上面各字段），Actor 会逐个目标采集。例如 [{\"userId\":\"25025320\"},{\"userId\":\"44196397\"}]。 / Batch collection: each element is a set of parameters (overriding the fields above), and the Actor collects each target one by one. For example [{\"userId\":\"25025320\"},{\"userId\":\"44196397\"}].",
            "items": {
              "type": "object"
            }
          },
          "proxyUrl": {
            "title": "代理 URL（可选）/ Proxy URL (optional)",
            "type": "string",
            "description": "Dataclawd 服务端请求 Instagram 时使用的代理地址。 / Proxy address used by the Dataclawd server when requesting Instagram."
          },
          "httpMethod": {
            "title": "请求方法 / HTTP method",
            "enum": [
              "GET",
              "POST"
            ],
            "type": "string",
            "description": "调用 Dataclawd 端点使用的 HTTP 方法（Instagram 端点在 Dataclawd 后端仅支持 GET）。 / HTTP method used to call the Dataclawd endpoint (Instagram endpoints support only GET on the Dataclawd backend).",
            "default": "GET"
          },
          "maxItems": {
            "title": "最多采集条数 / Maximum items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "整个运行最多写入 Dataset 的条目数，达到即停止。 / Maximum number of items written to the Dataset for the whole run; stops when reached.",
            "default": 100
          },
          "maxPages": {
            "title": "每目标最多页数 / Maximum pages per target",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "每个目标最多翻页次数（防止无限翻页）。 / Maximum number of pages per target (prevents infinite pagination).",
            "default": 10
          },
          "startCursor": {
            "title": "起始游标（可选）/ Start cursor (optional)",
            "type": "string",
            "description": "从指定游标开始翻页（续采上次未完成的数据）。留空从第一页开始。 / Start paginating from the specified cursor (to resume previously incomplete data). Leave empty to start from the first page."
          },
          "itemsPath": {
            "title": "条目提取路径（可选）/ Item extraction path (optional)",
            "type": "string",
            "description": "点号路径，指定响应中条目列表的位置。留空则自动探测（最大数组）。 / Dot path specifying the location of the item list in the response. Leave empty to auto-detect (the largest array)."
          },
          "nextCursorPath": {
            "title": "下一页游标路径（可选）/ Next cursor path (optional)",
            "type": "string",
            "description": "点号路径，指定响应中下一页游标的位置。留空自动探测（endCursor/maxId/end_cursor/max_id/profile_grid_items_cursor 等）。 / Dot path specifying the location of the next-page cursor in the response. Leave empty to auto-detect (endCursor/maxId/end_cursor/max_id/profile_grid_items_cursor, etc.)."
          },
          "paginationParam": {
            "title": "分页参数 / Pagination parameter",
            "enum": [
              "auto",
              "endCursor",
              "maxId",
              "none"
            ],
            "type": "string",
            "description": "翻页时使用的查询参数：auto 按端点自动选择（user/post 用 endCursor，search/hashtag 用 maxId）；none 不翻页。 / Query parameter used for pagination: auto chooses by endpoint (endCursor for user/post, maxId for search/hashtag); none disables pagination.",
            "default": "auto"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}