{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Post Engagement Scraper – Commenters & Engagement",
    "description": "Analyze who engaged with a set of Instagram posts: extract every comment (id, username, text, likes, timestamp) and report like/comment counts. Public data only by default, no login.\nOptional Instagram cookies also resolve who liked - which is a unique feature!",
    "version": "0.1",
    "x-build-id": "iylvpk1xfOqrOIWM1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation_nerd~instagram-post-engagement-actor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation_nerd-instagram-post-engagement-actor",
        "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/automation_nerd~instagram-post-engagement-actor/runs": {
      "post": {
        "operationId": "runs-sync-automation_nerd-instagram-post-engagement-actor",
        "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/automation_nerd~instagram-post-engagement-actor/run-sync": {
      "post": {
        "operationId": "run-sync-automation_nerd-instagram-post-engagement-actor",
        "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",
        "required": [
          "posts"
        ],
        "properties": {
          "posts": {
            "title": "Posts",
            "type": "array",
            "description": "Instagram posts to analyze. Paste full post/reel URLs (https://www.instagram.com/p/SHORTCODE/) or bare shortcodes. Each post is analyzed independently and produces one dataset item.",
            "items": {
              "type": "string"
            }
          },
          "maxComments": {
            "title": "Max comments per post",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper bound on how many comments to fetch per post (pagination stops there). Lower = faster and cheaper. Instagram itself caps public comment access at roughly 500 top-level comments per post.",
            "default": 200
          },
          "includeReplies": {
            "title": "Include reply threads",
            "type": "boolean",
            "description": "Also fetch the replies under each top-level comment. More thorough for engagement analysis, but slower and uses more requests.",
            "default": false
          },
          "onlyDataAfter": {
            "title": "Only comments after (date/time)",
            "type": "string",
            "description": "Optional. Keep only comments posted AFTER this moment; older ones are skipped and counted in 'skippedCommentCount'. Accepts a date (2026-07-01), an ISO datetime (2026-07-01T14:30:00Z) or a Unix timestamp. Note: applies to COMMENTS only — Instagram's likers list has no timestamp, so likers can't be date-filtered."
          },
          "cookies": {
            "title": "Instagram cookies (optional — unlocks likers)",
            "type": "string",
            "description": "OPTIONAL. Leave empty for public scraping (comments + like/comment counts). Provide your Instagram login to ALSO get the LIKERS of each post (the users who liked it), which Instagram hides from anonymous requests. Three accepted formats: (1) the JSON export from the Cookie-Editor browser extension while on instagram.com [recommended — one click 'Export']; (2) a cookie header string like 'sessionid=...; csrftoken=...; ds_user_id=...'; (3) just your 'sessionid' value. The actor needs sessionid (ds_user_id is derived from it automatically). Secret field: Apify stores it encrypted and never shows it in the log, input or dataset. Use an account you control; in authenticated mode all requests run on a single pinned proxy IP."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Instagram blocks datacenter IPs. Use Apify Residential proxies (default). You can pick a country to match your audience.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "maxConcurrency": {
            "title": "Max concurrency (parallel posts)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many posts to scrape in parallel. Higher = faster, but a higher chance of hitting Instagram rate limits. Each post uses its own rotating proxy IP.",
            "default": 3
          },
          "maxRequestRetries": {
            "title": "Max retries per post",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "How often to retry a post on a transient error (rate limit / 5xx / connection / block). Reported per item as 'attempts'.",
            "default": 3
          },
          "commentsDocId": {
            "title": "Comments GraphQL doc_id (advanced)",
            "type": "string",
            "description": "Advanced/optional. The actor fetches comments via Instagram's logged-out GraphQL query, which uses a numeric doc_id that Instagram rotates every few weeks. Leave empty to use the built-in default. If comments stop coming back, open a public post in a logged-out browser, find the Network request with x-fb-friendly-name = PolarisLoggedOutDesktopWWWPostCommentsPaginationQuery, and paste its doc_id here."
          },
          "debug": {
            "title": "Debug logging",
            "type": "boolean",
            "description": "Log every Instagram API request URL and its response status (→ GET … / ← 302 …). Useful to inspect exactly what is called and where a block happens. Same as running with APIFY_LOG_LEVEL=DEBUG.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}