{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Comments Scraper (Spam & Toxic Comment Detection)",
    "description": "Instagram Comments Scraper extracts comments from any public Instagram post, including usernames, comment text, timestamps, likes, replies, and comment IDs. Perfect for sentiment analysis, audience research, trend monitoring, and automating large-scale Instagram comment data collection.",
    "version": "0.1",
    "x-build-id": "f1MNNVIexm2oU6TPF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/simpleapi~instagram-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-simpleapi-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/simpleapi~instagram-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-simpleapi-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/simpleapi~instagram-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-simpleapi-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": {
          "moderatePostUrls": {
            "title": "🛡️ Posts to moderate",
            "type": "array",
            "description": "Instagram post/reel URLs whose comment sections you want to moderate. Accepts /p/, /reel/, /tv/ URLs and bare shortcodes. Example: https://www.instagram.com/p/DN8-GjPkgjS/",
            "items": {
              "type": "string"
            }
          },
          "maxComments": {
            "title": "💬 Max comments per post",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Top-level comments to scan per post. Replies are ADDITIONAL and not counted here. Example: 20 → up to 20 comments scanned + their replies. Default 20.",
            "default": 20
          },
          "reviewMode": {
            "title": "🔍 Review mode",
            "enum": [
              "all",
              "toxic",
              "profanity",
              "spam",
              "scam",
              "duplicate",
              "bot"
            ],
            "type": "string",
            "description": "Restrict output to one moderation queue. 'all' = every comment (with flags). Others keep only rows matching that risk. Example: reviewMode=scam → only scam-pattern rows. Default all.",
            "default": "all"
          },
          "flaggedOnly": {
            "title": "🚩 Flagged rows only",
            "type": "boolean",
            "description": "When on, output ONLY comments/replies that tripped at least one flag (toxic, profane, spam, scam, blocklist, duplicate or bot). Clean rows are dropped. Default off.",
            "default": false
          },
          "customBlocklist": {
            "title": "🚫 Custom blocklist terms",
            "type": "array",
            "description": "Your own banned words/phrases. Any comment containing one is flagged (category 'blocklist' if nothing worse matched) and the term appears in matchedTerms. Case-insensitive. Example: [\"my brand\", \"competitor\"].",
            "items": {
              "type": "string"
            }
          },
          "minReplyCount": {
            "title": "🧵 Min replies to include a comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Only include top-level comments that have at least this many replies (useful for surfacing pile-ons / heated threads). 0 = no minimum. Default 0.",
            "default": 0
          },
          "scanReplies": {
            "title": "↪️ Scan replies",
            "type": "boolean",
            "description": "Fetch and moderate replies too. Each reply becomes its own flat row (type=reply, isReply=true, parentId) and is mirrored to a per-run child dataset. Default on."
          },
          "repliesPerComment": {
            "title": "↪️ Max replies per comment",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Cap replies scanned per comment. Example: maxComments=20 + repliesPerComment=5 → up to 20 comments and up to 100 reply rows. Default 5."
          },
          "sessionId": {
            "title": "🔐 Instagram Session ID",
            "type": "string",
            "description": "Your Instagram `sessionid` cookie. Instagram now requires a logged-in session to read comments, so provide this for comment access. Copy it from your browser cookies for instagram.com."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "Optional proxy. The actor auto-escalates (none → datacenter → residential) when Instagram blocks a request."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}