{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Comment Scraper",
    "description": "Scrape Instagram comments from posts or reels. Just add one or more Instagram post URLs to get comment text, post and comment IDs, replies, timestamp, owner IDs, usernames, profile pics. Export scraped datasets, run the scraper via API, schedule and monitor runs or integrate with other tools.",
    "version": "1.1",
    "x-build-id": "2oe1S19M04HIakU5m"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapeai~instagram-comment-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapeai-instagram-comment-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/scrapeai~instagram-comment-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapeai-instagram-comment-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/scrapeai~instagram-comment-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapeai-instagram-comment-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": {
          "startUrls": {
            "title": "Target Start URLs",
            "type": "array",
            "description": "Live public target URLs to request first. These can be replaced at run time.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "URL",
                  "description": "Absolute live target URL.",
                  "type": "string"
                }
              },
              "required": [
                "url"
              ]
            },
            "default": [
              {
                "url": "https://www.instagram.com/p/DRaAMuaiTZR/"
              }
            ]
          },
          "endUrls": {
            "title": "Target End URLs",
            "type": "array",
            "description": "Optional live target boundary URLs. They are fetched after start URLs and are kept separate in output.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "URL",
                  "description": "Absolute live target URL.",
                  "type": "string"
                }
              },
              "required": [
                "url"
              ]
            },
            "default": []
          },
          "query": {
            "title": "Search Query",
            "type": "string",
            "description": "Target query used by a derived source URL when the actor supports query search.",
            "default": "p DRaAMuaiTZR"
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of live records to return. Production default/prefill is 50; maximum is 50. Local input.json stays capped at 10.",
            "default": 50
          },
          "maxRequestRetries": {
            "title": "Max Request Retries",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Number of retries for a live target request.",
            "default": 1
          },
          "requestTimeoutSecs": {
            "title": "Request Timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time to wait for one live target request.",
            "default": 25
          },
          "maxPages": {
            "title": "Maximum Live Pages",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum live listing/API pages to request, including discovered next pages.",
            "default": 3
          },
          "crawlDetails": {
            "title": "Fetch Detail Pages",
            "type": "boolean",
            "description": "When live rows expose same-site item URLs, fetch those detail pages in bulk and attach their fields.",
            "default": true
          },
          "maxDetailPages": {
            "title": "Maximum Detail Pages",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum same-site detail URLs to fetch per run.",
            "default": 5
          },
          "detailConcurrency": {
            "title": "Detail Concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum number of live detail requests in flight at once.",
            "default": 4
          },
          "browserFallback": {
            "title": "Browser DOM Fallback",
            "type": "boolean",
            "description": "If the direct live request is blocked or returns a JavaScript shell, render the same target in a local headless browser and parse the live DOM.",
            "default": true
          },
          "proxyEnabled": {
            "title": "Enable Apify Proxy",
            "type": "boolean",
            "description": "If the direct live request fails without a clear access challenge, retry once through the configured Apify datacenter proxy.",
            "default": true
          },
          "targetInput": {
            "title": "Original Target Input",
            "type": "object",
            "description": "Optional source-specific fields copied from this actor input schema. URL/query values are normalized by this actor.",
            "properties": {
              "postUrls": {
                "title": "Instagram Post URLs",
                "type": "array",
                "description": "List of Instagram post or reel URLs to scrape comments from. Supports formats: /p/, /reel/, /tv/, /share/, or direct shortcodes.",
                "prefill": [
                  "https://www.instagram.com/p/DRaAMuaiTZR/"
                ]
              },
              "maxCommentsPerPost": {
                "title": "Max Comments Per Post",
                "type": "integer",
                "description": "Maximum number of comments to scrape per post, up to 10000. Higher values may take longer.",
                "default": 100
              },
              "includeReplies": {
                "title": "Include Replies",
                "type": "boolean",
                "description": "Include comment replies (nested comments). Enabling this will expand reply threads.",
                "default": true
              },
              "maxRepliesPerComment": {
                "title": "Max Replies Per Comment",
                "type": "integer",
                "description": "Maximum number of replies to fetch per individual comment thread (when Include Replies is enabled). For example, 5 means at most 5 replies are returned per parent comment. Set to 0 for unlimited replies per thread.",
                "default": 0
              },
              "cookies": {
                "title": "Instagram Cookies (Optional)",
                "type": "string",
                "description": "Instagram authentication cookies in JSON format. Optional — if not provided, authentication is handled automatically. Format: [{\"name\":\"sessionid\",\"value\":\"...\",\"domain\":\".instagram.com\"}, ...]"
              },
              "sessionName": {
                "title": "Saved Session Name (Optional)",
                "type": "string",
                "description": "If you've saved cookies to key-value storage, enter the session name here instead of pasting cookies."
              }
            },
            "default": {},
            "additionalProperties": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}