{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Profile Reels Scraper & Comment Replies",
    "description": "Instagram Profile Reels Scraper extracts public Reels, captions, media URLs, timestamps, views, likes, comments, hashtags, and creator details. Collect comment replies to analyze audience engagement, content performance, influencer activity, and competitor strategies.",
    "version": "0.1",
    "x-build-id": "R3YHCfYpnw0BWVdQ3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api-empire~instagram-profile-reels-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api-empire-instagram-profile-reels-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/api-empire~instagram-profile-reels-scraper/runs": {
      "post": {
        "operationId": "runs-sync-api-empire-instagram-profile-reels-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/api-empire~instagram-profile-reels-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-api-empire-instagram-profile-reels-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "💬 Profiles whose reel comments you want",
            "type": "array",
            "description": "Instagram profiles to read. Accepts a username (natgeo), an @handle (@natgeo) or a full profile URL. Every reel on each profile is returned with its comment thread attached.",
            "items": {
              "type": "string"
            }
          },
          "resultsLimit": {
            "title": "🎬 Reel threads per profile",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "How many reels to open per profile. One reel = one charged row = one comment thread. 1-9 is honoured literally (you are never charged for 10 when you asked for 1). 10000 means exactly 10000. 0 means unlimited, capped at a 2000-reel-per-profile safety ceiling. Default is 10.",
            "default": 10
          },
          "extractComments": {
            "title": "🧵 Open the comment thread on every reel",
            "type": "boolean",
            "description": "Fetches real comments, 15 per request, cursor-paged. Measured 72/72 reels returned comments logged out on 2026-07-25. With a session cookie the actor switches to Instagram's app listing, which returns the same top-level comments and additionally states a real reply count on every one of them (populated on 350/350 comments on the verification run, including genuine zeros). Turn this off for a reel-metrics-only run; the comment fields are then emitted as null, never as an empty string.",
            "default": true
          },
          "maxCommentsPerReel": {
            "title": "🔢 Comments to collect per reel",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper bound on top-level comments per reel. The pager returns about 15 per request, so 20 costs 2 requests and roughly 1.4 s. 0 collects the whole thread (373 comments in 25 pages / 15.6 s measured on one cristiano reel). Default is 20.",
            "default": 20
          },
          "includeReplies": {
            "title": "↩️ Also fetch reply threads (needs a session cookie)",
            "type": "boolean",
            "description": "Replies are the one part of Instagram's comment surface that is login-gated. With a live session cookie they come back in full: real text, author, likes and timestamp on every reply node, paged until the thread is exhausted. Measured on the platform on one natgeo reel: 142 comments + 53 replies = 195 of the 219 Instagram declares (89.0%), against 142 of 219 (64.8%) with no cookie. Reply recovery against Instagram's own per-thread reply count is partial and says so: 59 of 70 declared over the whole run (84.3%), 77.6% across 44 threads in wider testing - deleted and spam-filtered replies stay inside Instagram's aggregate. With this on and no cookie the run still succeeds - repliesCount is emitted as null, never as 0.",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "↪️ Replies to collect per comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper bound on replies fetched under each comment when a live session cookie is supplied. Instagram serves 6-9 replies per request and ignores any page-size hint, so 10 costs about 2 requests per threaded comment. Only comments Instagram says have replies are opened, so most cost nothing. 0 disables reply fetching. Default is 10.",
            "default": 10
          },
          "sessionId": {
            "title": "🔑 Instagram sessionid cookie",
            "type": "string",
            "description": "Optional. Paste either the bare `sessionid` value from a logged-in instagram.com browser session, or the whole cookie string (`sessionid=...; csrftoken=...`) - both are accepted and the log says which form was read. Use a throwaway account. It unlocks two things: real reply text under each comment, and Instagram's own reply count on every comment (which is null without it). Every top-level comment is still collected without it. If the cookie is dead the run logs it and continues logged out instead of failing."
          },
          "commentKeywords": {
            "title": "🔍 Keep only comments containing",
            "type": "array",
            "description": "Case-insensitive substrings. A comment is kept only if its text contains at least one of them. Example: [\"how much\", \"price\", \"where can i\"] to surface buying questions. Empty means keep everything.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeCommentKeywords": {
            "title": "🚫 Drop comments containing",
            "type": "array",
            "description": "Case-insensitive substrings. Any comment containing one of them is dropped before output. Useful for stripping bot spam such as [\"follow me\", \"check my page\"].",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minCommentLikes": {
            "title": "👍 Minimum comment likes",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only comments with at least this many likes. comment_like_count is present on 1018/1018 comments measured, but most comments have 0 likes, so anything above 1 filters aggressively. Default is 0 (no filter).",
            "default": 0
          },
          "onlyVerifiedCommenters": {
            "title": "✔️ Only comments from verified accounts",
            "type": "boolean",
            "description": "Keeps only comments whose author carries Instagram's verified badge. Measured at 22/1018 = 2.2% of comments across six mixed creators, so expect a short list. Default is off.",
            "default": false
          },
          "extractEngagement": {
            "title": "📊 Include reel like / play / comment counts",
            "type": "boolean",
            "description": "Adds likesCount, commentsCount, playCount and igPlayCount to each reel row - all present on 72/72 reels measured. Turn it off and those fields are emitted as null, never as a fabricated 0.",
            "default": true
          },
          "includeCommentsDataset": {
            "title": "🗂️ Also write a flat one-row-per-comment dataset",
            "type": "boolean",
            "description": "Mirrors every comment and reply into a separate, uncharged dataset named comments-<runId>, one row each, keyed by reelId with type=comment/reply and isReply. Handy for spreadsheets. The reel rows in the main dataset are unaffected.",
            "default": true
          },
          "aiCommentAnalysis": {
            "title": "🤖 Classify each comment with AI",
            "type": "boolean",
            "description": "Off by default. Labels every comment as question / complaint / praise / spam / purchase-intent / other plus a sentiment, and adds a per-reel split. The raw comment text is always emitted unchanged next to the label so you can audit it, and AI never filters or blocks a row. If the model fails, the labels stay null.",
            "default": false
          },
          "aiModel": {
            "title": "🧠 AI model / provider",
            "enum": [
              "claude-haiku-4-5",
              "claude-sonnet-5",
              "claude-opus-4-8",
              "claude-fable-5",
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1-mini",
              "gpt-4.1",
              "o3-mini",
              "o1",
              "gemini-2.0-flash-lite",
              "gemini-2.0-flash",
              "gemini-1.5-pro",
              "gemini-2.5-flash",
              "gemini-2.5-pro",
              "grok-2-latest",
              "grok-3-mini",
              "grok-3",
              "grok-beta",
              "deepseek-chat",
              "deepseek-reasoner",
              "sonar",
              "sonar-pro",
              "sonar-reasoning",
              "mistral-small-latest",
              "mistral-large-latest"
            ],
            "type": "string",
            "description": "Provider is auto-detected from the name: claude-*=Anthropic, gpt-*/o1/o3=OpenAI, gemini-*=Google, grok-*=xAI, deepseek-*=DeepSeek, sonar*=Perplexity, mistral-*=Mistral. The cheap mini/flash/haiku models are more than enough for this classification.",
            "default": "claude-haiku-4-5"
          },
          "aiApiKey": {
            "title": "🔐 AI provider API key",
            "type": "string",
            "description": "Key for the provider implied by the chosen model. Falls back to the matching environment variable when left empty: ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY / GOOGLE_API_KEY, XAI_API_KEY, DEEPSEEK_API_KEY, PERPLEXITY_API_KEY, MISTRAL_API_KEY. Without a key the comments are still returned in full and the AI labels stay null."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "Your selection is used as given: proxy groups, country and custom proxy URLs are all honoured, and one sticky session is held for the whole run so Instagram's csrftoken stays valid. Residential exits are the most reliable for Instagram.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}