{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Comment Leads Extractor",
    "description": "Extract leads from Instagram post and reel comments. Enrich commenter profiles, detect buying intent, score leads, and export flat CSV-friendly rows for outreach, prospecting, and social listening.",
    "version": "1.0",
    "x-build-id": "P9O7tNfhAHdNrg7xz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~instagram-comment-leads-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-instagram-comment-leads-extractor",
        "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/coregent~instagram-comment-leads-extractor/runs": {
      "post": {
        "operationId": "runs-sync-coregent-instagram-comment-leads-extractor",
        "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/coregent~instagram-comment-leads-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-instagram-comment-leads-extractor",
        "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": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "Post / Reel URLs",
            "type": "array",
            "description": "Instagram post or reel URLs to extract comments from. Examples: https://www.instagram.com/p/ABC123/ or https://www.instagram.com/reel/XYZ789/",
            "items": {
              "type": "string"
            },
            "default": [
              "https://www.instagram.com/p/DG8ntZ1OuGu/"
            ]
          },
          "maxCommentsPerUrl": {
            "title": "Max Comments Per URL",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of comments to extract per post or reel URL.",
            "default": 500
          },
          "maxRepliesPerComment": {
            "title": "Max Replies Per Comment",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of replies to fetch per top-level comment (when replies are enabled).",
            "default": 10
          },
          "maxUrls": {
            "title": "Max URLs to Process",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of input URLs to process in a single run.",
            "default": 50
          },
          "outputMode": {
            "title": "Output Mode",
            "enum": [
              "comment_rows",
              "commenter_rows",
              "both"
            ],
            "type": "string",
            "description": "Choose the output format: one row per comment, one row per commenter (aggregated), or both.",
            "default": "comment_rows"
          },
          "includeReplies": {
            "title": "Include Replies",
            "type": "boolean",
            "description": "Include replies to top-level comments. Increases run time and data volume.",
            "default": false
          },
          "onlyPinnedComments": {
            "title": "Only Pinned Comments",
            "type": "boolean",
            "description": "Extract only pinned comments (best effort, if detectable).",
            "default": false
          },
          "sortMode": {
            "title": "Sort Mode",
            "enum": [
              "default",
              "top_first",
              "newest_first"
            ],
            "type": "string",
            "description": "Comment sort order (best effort, depends on API availability).",
            "default": "default"
          },
          "minCommentLikes": {
            "title": "Minimum Comment Likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only include comments with at least this many likes. Leave 0 for no minimum.",
            "default": 0
          },
          "keywordInclude": {
            "title": "Keyword Include",
            "type": "array",
            "description": "Only include comments containing at least one of these keywords (case-insensitive).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "keywordExclude": {
            "title": "Keyword Exclude",
            "type": "array",
            "description": "Exclude comments containing any of these keywords (case-insensitive).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "languageAllowlist": {
            "title": "Language Allowlist",
            "type": "array",
            "description": "Only include comments that appear to be in one of these languages (best effort). Use two-letter codes: en, es, fr, etc.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "enrichCommenterProfile": {
            "title": "Enrich Commenter Profile",
            "type": "boolean",
            "description": "Fetch public profile data for each commenter (followers, bio, external URL). Significantly increases run time and cost.",
            "default": false
          },
          "includeProfileBio": {
            "title": "Include Profile Bio",
            "type": "boolean",
            "description": "Include commenter's biography text when profile enrichment is enabled.",
            "default": true
          },
          "includeProfileExternalUrl": {
            "title": "Include Profile External URL",
            "type": "boolean",
            "description": "Include commenter's external URL when profile enrichment is enabled.",
            "default": true
          },
          "includeProfileCounts": {
            "title": "Include Profile Counts",
            "type": "boolean",
            "description": "Include follower, following, and post counts when profile enrichment is enabled.",
            "default": true
          },
          "includeRecentActivitySnapshot": {
            "title": "Include Recent Activity Snapshot",
            "type": "boolean",
            "description": "Include a recent posting activity snapshot when profile enrichment is enabled.",
            "default": false
          },
          "detectIntentSignals": {
            "title": "Detect Intent Signals",
            "type": "boolean",
            "description": "Detect buying intent, contact intent, and other commercial signals in comments.",
            "default": true
          },
          "detectQuestionComments": {
            "title": "Detect Question Comments",
            "type": "boolean",
            "description": "Flag comments that contain questions.",
            "default": true
          },
          "tagKeywords": {
            "title": "Tag Keywords",
            "type": "array",
            "description": "Custom keywords to match and tag in comments. Matched keywords appear in the matchedKeywords field.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "enableLeadScore": {
            "title": "Enable Lead Score",
            "type": "boolean",
            "description": "Compute a heuristic lead score (0-100) for each comment based on intent signals and commenter profile.",
            "default": true
          },
          "dedupeCommentersAcrossUrls": {
            "title": "Deduplicate Commenters Across URLs",
            "type": "boolean",
            "description": "When using commenter rows output, aggregate commenters across multiple input URLs.",
            "default": true
          },
          "keepFirstSeenCommentOnly": {
            "title": "Keep First Seen Comment Only",
            "type": "boolean",
            "description": "In comment rows mode, only keep the first comment per commenter (skip duplicates).",
            "default": false
          },
          "aggregateCommenterMetrics": {
            "title": "Aggregate Commenter Metrics",
            "type": "boolean",
            "description": "When using commenter rows output, aggregate comment counts and intent tags per commenter.",
            "default": true
          },
          "requestTimeoutSecs": {
            "title": "Request Timeout (seconds)",
            "minimum": 30,
            "maximum": 600,
            "type": "integer",
            "description": "Maximum time in seconds for processing each input URL.",
            "default": 300
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum number of URLs to process concurrently.",
            "default": 1
          },
          "debugMode": {
            "title": "Debug Mode",
            "type": "boolean",
            "description": "Enable verbose logging for debugging.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}