{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Following Scraper With Lead Enrichment",
    "description": "Instagram Following Scraper 👥📸 extracts following lists from public Instagram profiles, including usernames, profile URLs, bios, and account details. Ideal for audience research, influencer discovery, competitor tracking, and social network analysis. Fast, scalable, and automation-ready. 🚀📊",
    "version": "0.1",
    "x-build-id": "SOPUpzeOKxcTy5xnX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapio~instagram-following-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapio-instagram-following-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/scrapio~instagram-following-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapio-instagram-following-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/scrapio~instagram-following-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapio-instagram-following-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": "🔗 Input profiles (URLs or usernames)",
            "type": "array",
            "description": "Full profile links, `@handle`, or plain `handle` all work.\n\nExample: `nasa`, `nasaearth`, `nasahubble` → accounts followed by 2+ of them are surfaced with their overlap count.",
            "items": {
              "type": "string"
            }
          },
          "scrapeMode": {
            "title": "🔀 Edge type to intersect",
            "enum": [
              "following",
              "followers"
            ],
            "type": "string",
            "description": "`following` = accounts each input **follows** (shared interests / common connections). `followers` = accounts that **follow** each input (shared audience). Default is `following`.",
            "default": "following"
          },
          "maxItems": {
            "title": "📊 Max accounts to fetch per input",
            "minimum": 0,
            "type": "integer",
            "description": "Caps how many follow-edges to pull **for each input account** (top-level parents). The shared/overlap rows are derived from these and are NOT capped by this value.\n\n`0` = no cap (fetch the full list). Example: 300. Bigger = longer runs.",
            "default": 0
          },
          "minOverlap": {
            "title": "🔢 Minimum overlap",
            "minimum": 1,
            "type": "integer",
            "description": "Only emit accounts followed by **at least this many** of your inputs. `1` = every account seen; `2` = only accounts shared by 2+ inputs (the actual 'common connections'). Default is 1.",
            "default": 1
          },
          "onlyVerified": {
            "title": "✅ Verified accounts only",
            "type": "boolean",
            "description": "Keep only accounts with the blue-verified badge (`is_verified`). Default is off.",
            "default": false
          },
          "excludePrivate": {
            "title": "🚫 Exclude private accounts",
            "type": "boolean",
            "description": "Drop private accounts (`is_private`) from the results. Default is off.",
            "default": false
          },
          "includeProfileDetails": {
            "title": "🧩 Enrich shared accounts (bio, follower counts, contacts)",
            "type": "boolean",
            "description": "For each unique shared account, fetch its public profile: biography, follower/following counts, external URL, business email/phone, category. Bio contacts (emails/phones/links) are regex-parsed from the biography. Adds one request per unique shared account. Default is off.",
            "default": false
          },
          "aiEnhancement": {
            "title": "🤖 AI niche labelling",
            "type": "boolean",
            "description": "When on (and enrichment on), an LLM assigns each enriched account a short niche label from its real bio. Requires an API key below. Default is off.",
            "default": false
          },
          "aiModel": {
            "title": "🤖 AI Model / Provider",
            "enum": [
              "claude-haiku-4-5",
              "claude-sonnet-5",
              "claude-opus-4-8",
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1-mini",
              "gemini-2.0-flash-lite",
              "gemini-2.0-flash",
              "gemini-2.5-flash",
              "grok-3-mini",
              "deepseek-chat",
              "sonar",
              "mistral-small-latest"
            ],
            "type": "string",
            "description": "Provider auto-detected from the name: claude-*=Anthropic, gpt-*/o1/o3=OpenAI, gemini-*=Google, grok-*=xAI, deepseek-*=DeepSeek, sonar*=Perplexity, mistral-*=Mistral. Cheaper mini/flash/haiku/lite models are recommended for classification.",
            "default": "claude-haiku-4-5"
          },
          "aiApiKey": {
            "title": "🔑 AI API key",
            "type": "string",
            "description": "API key for the selected provider. Falls back to the matching env var if empty (ANTHROPIC_API_KEY / OPENAI_API_KEY / GEMINI_API_KEY / XAI_API_KEY / DEEPSEEK_API_KEY / PERPLEXITY_API_KEY / MISTRAL_API_KEY). Only used when AI niche labelling is on."
          },
          "sessionId": {
            "title": "🔑 Instagram sessionid cookie",
            "type": "string",
            "description": "Copy the `sessionid` cookie value from a browser logged into Instagram and paste it here. Kept private to your run. You can leave it empty, but runs may be blocked more often."
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy settings",
            "type": "object",
            "description": "Default runs direct (no proxy). Toggle Apify Proxy here if your network needs it."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}