{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Comments Scraper With Lead Enrichment",
    "description": "The Instagram Comments Scraper extracts comments from posts or reels, capturing usernames, text, timestamps, and engagement metrics. Ideal for social listening, sentiment analysis, and audience research, it delivers clean, structured data for insights, analytics, or API integration.",
    "version": "0.1",
    "x-build-id": "6bNpSxbSa7izJHMV7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper-engine~instagram-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper-engine-instagram-comments-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/scraper-engine~instagram-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraper-engine-instagram-comments-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/scraper-engine~instagram-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraper-engine-instagram-comments-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": {
          "targetPosts": {
            "title": "🎯 Target post / reel URLs",
            "type": "array",
            "description": "Instagram post or reel URLs whose comment sections you want to mine for leads. Example: https://www.instagram.com/p/SHORTCODE/",
            "items": {
              "type": "string"
            }
          },
          "maxComments": {
            "title": "💬 Max comments per post",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many top-level comments to scan per post. Example: 50. Default 10."
          },
          "includeReplies": {
            "title": "🧵 Include reply threads",
            "type": "boolean",
            "description": "Also scan replies under each comment (emitted as separate labeled child rows + a per-run replies dataset). Default true."
          },
          "maxReplies": {
            "title": "↪️ Max replies per comment",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Cap replies fetched per comment when reply threads are included. Example: 3. Default 5."
          },
          "detectLeadIntent": {
            "title": "🔎 Detect lead intent",
            "type": "boolean",
            "description": "Flag buying-intent, price-question, support-request and partnership-interest comments using a rule-based lexicon (keyless). Default true.",
            "default": true
          },
          "customIntentKeywords": {
            "title": "➕ Custom buying-intent keywords",
            "type": "array",
            "description": "Extra phrases that should mark a comment as buying-intent (e.g. your product name, 'où acheter'). Matched case-insensitively.",
            "items": {
              "type": "string"
            }
          },
          "leadsOnly": {
            "title": "✅ Leads only",
            "type": "boolean",
            "description": "Output ONLY comments that show commercial intent (buying/price/partnership) or carry a contact clue (email/link/phone candidate). Default false (emit all).",
            "default": false
          },
          "enrichCommenterProfiles": {
            "title": "👤 Enrich commenter profiles",
            "type": "boolean",
            "description": "Fetch each unique commenter's public profile (followers, bio, bioEmail, external link, business flags) via one extra request. Capped by the limit below. Default false.",
            "default": false
          },
          "maxProfileLookups": {
            "title": "🔢 Max profile lookups per run",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on unique commenter-profile fetches per run (repeat commenters are cached and don't re-count). Example: 20. Default 20.",
            "default": 20
          },
          "sessionId": {
            "title": "🔐 Instagram Session ID",
            "type": "string",
            "description": "Your Instagram `sessionid` cookie. Required to collect comments — Instagram gates comment data behind login, so logged-out runs return no comments. Copy it from your browser cookies for instagram.com."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "Optional proxy. Residential is recommended when enrichment is on."
          },
          "aiEnhancement": {
            "title": "🤖 AI intent classification (optional)",
            "type": "boolean",
            "description": "Add an AI lead-intent label on top of the rule engine. OFF by default; requires an API key below. Keyless runs are fully functional without it.",
            "default": false
          },
          "aiModel": {
            "title": "🤖 AI Model / Provider",
            "enum": [
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1-mini",
              "o3-mini",
              "claude-haiku-4-5",
              "claude-sonnet-5",
              "claude-opus-4-8"
            ],
            "type": "string",
            "description": "Provider auto-detected from the name: claude-*=Anthropic, gpt-*/o1/o3=OpenAI. Cheaper mini/haiku models are recommended for classification.",
            "default": "gpt-4o-mini"
          },
          "aiApiKey": {
            "title": "🔑 AI API Key",
            "type": "string",
            "description": "Provider API key (OpenAI or Anthropic). Only used when AI intent classification is ON. Leave blank to stay fully rule-based."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}