{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Lead Extractor",
    "description": "Discover Instagram profiles from usernames, hashtags, locations, search queries, datasets, or CSV — and extract emails, phones, and social handles from their bios.",
    "version": "0.1",
    "x-build-id": "reyAf2PuzyTJhMtAM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mukeshrana90~instagram-lead-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mukeshrana90-instagram-lead-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/mukeshrana90~instagram-lead-extractor/runs": {
      "post": {
        "operationId": "runs-sync-mukeshrana90-instagram-lead-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/mukeshrana90~instagram-lead-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-mukeshrana90-instagram-lead-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",
        "properties": {
          "usernames": {
            "title": "Usernames or profile URLs",
            "type": "array",
            "description": "Direct list of Instagram usernames or profile URLs. Most reliable source.",
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtag names (without #). Discovers profiles from recent posts under each tag.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Location URLs",
            "type": "array",
            "description": "Full Instagram location URLs, e.g. https://www.instagram.com/explore/locations/213385402/brooklyn-bridge/",
            "items": {
              "type": "string"
            }
          },
          "followersOf": {
            "title": "Followers of (requires session cookies)",
            "type": "array",
            "description": "Scrape followers of these target accounts. Requires sessionCookies — Instagram does not serve follower lists to unauthenticated requests.",
            "items": {
              "type": "string"
            }
          },
          "followingOf": {
            "title": "Following of (requires session cookies)",
            "type": "array",
            "description": "Scrape who these accounts follow. Requires sessionCookies.",
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Post URLs (engagers)",
            "type": "array",
            "description": "Scrape commenters on these public posts. Likers require sessionCookies.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Free-text queries; returns top matching accounts. Volume is small per query.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Upstream Apify dataset ID",
            "type": "string",
            "description": "Read usernames from another actor's output dataset."
          },
          "datasetUsernameField": {
            "title": "Dataset username field",
            "type": "string",
            "description": "Field name in the upstream dataset that holds the username.",
            "default": "username"
          },
          "csvUrl": {
            "title": "CSV or Google Sheets URL",
            "type": "string",
            "description": "Public CSV URL, or Google Sheets export URL (?format=csv)."
          },
          "csvUsernameColumn": {
            "title": "CSV username column",
            "type": "string",
            "description": "Column header that holds the username.",
            "default": "username"
          },
          "maxProfiles": {
            "title": "Max profiles (global cap)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on total profiles scraped after deduplication.",
            "default": 1000
          },
          "maxProfilesPerHashtag": {
            "title": "Max profiles per hashtag",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on profiles discovered per hashtag before moving to the next.",
            "default": 500
          },
          "maxProfilesPerLocation": {
            "title": "Max profiles per location",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on profiles discovered per location URL.",
            "default": 500
          },
          "maxFollowersPerTarget": {
            "title": "Max followers per target",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on followers scraped per target account (auth-only mode).",
            "default": 5000
          },
          "maxEngagersPerPost": {
            "title": "Max engagers per post",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on commenters/likers scraped per post URL.",
            "default": 500
          },
          "scrapeExternalUrl": {
            "title": "Follow link-in-bio and scan for emails",
            "type": "boolean",
            "description": "Fetch the profile's external URL and scan its HTML for contacts. SSRF-guarded (rejects private IPs, capped size/timeout).",
            "default": false
          },
          "includeRelatedProfiles": {
            "title": "Include related profiles",
            "type": "boolean",
            "description": "Also enqueue Instagram's suggested 'related profiles' for each scraped account.",
            "default": false
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxy required for production scale. Datacenter IPs are challenged quickly.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "sessionCookies": {
            "title": "Session cookies",
            "type": "string",
            "description": "Optional Instagram session cookie string. Required for followersOf, followingOf, and likers. Treated as sensitive — never logged."
          },
          "minDelayMs": {
            "title": "Min delay between requests (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Lower bound of the randomised delay between profile fetches.",
            "default": 1500
          },
          "maxDelayMs": {
            "title": "Max delay between requests (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Upper bound of the randomised delay between profile fetches. Must be >= minDelayMs.",
            "default": 4500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}