{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Related Person Scraper With Profile Enrichment",
    "description": "Scrapes related people from any Instagram profile, capturing suggested accounts, usernames, bios, follower counts, categories, and profile URLs. Ideal for influencer discovery, audience mapping, competitor research, and automated identification of similar Instagram profiles",
    "version": "0.1",
    "x-build-id": "WKbpVXnXAsZOcT3I4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapio~instagram-related-person-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapio-instagram-related-person-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-related-person-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapio-instagram-related-person-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-related-person-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapio-instagram-related-person-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": "🔗 Profiles / Usernames / IDs",
            "type": "array",
            "description": "One or more Instagram profiles to find related accounts for. Accepts mixed formats: full URL (https://www.instagram.com/nasa/), @handle (@nasa), plain username (nasa), or a numeric user ID (528817151). You may also pass per-item objects to set a custom limit, e.g. {\"username\": \"nasa\", \"limit\": 20}.",
            "items": {
              "type": "string"
            }
          },
          "max_profiles": {
            "title": "📊 Max Related Profiles per Seed",
            "minimum": 0,
            "maximum": 80,
            "type": "integer",
            "description": "How many related profiles to keep per seed (rank order). Instagram returns a fixed set of ~30-80 related accounts per profile in a single request — there is NO pagination, so this only slices the returned list. Example: 30 keeps the first 30. Default is 30.",
            "default": 30
          },
          "outputMode": {
            "title": "🧾 Output Mode",
            "enum": [
              "flat",
              "nested"
            ],
            "type": "string",
            "description": "flat (default): one row per related profile — best for CSV/Sheets and per-profile billing. nested: one row per seed with a related_profiles[] array (back-compat with the original actor).",
            "default": "flat"
          },
          "depth": {
            "title": "🔁 Crawl Depth (1-3)",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "How deep to follow the related-account graph. 1 = only each seed's related profiles (default). 2 = also fetch the related profiles of those (related-of-related). 3 = one level further. Higher depth = many more requests and longer runs. Each row is tagged with its depth and discoveredVia.",
            "default": 1
          },
          "enrichProfiles": {
            "title": "✨ Enrich Related Profiles",
            "type": "boolean",
            "description": "When ON, re-fetch each related profile to fill follower/following/post counts, biography, category, external URL, business flags and bio emails/links. Adds one request per enriched profile. When OFF, these fields are null (never fabricated). Default is false.",
            "default": false
          },
          "maxEnrichedProfiles": {
            "title": "🔢 Max Enriched Profiles",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on how many related profiles to enrich (protects run time / cost). Only applies when Enrich Related Profiles is ON. Example: 25 enriches the first 25 related profiles. Default is 25.",
            "default": 25
          },
          "verifiedOnly": {
            "title": "✅ Verified Only",
            "type": "boolean",
            "description": "Keep only verified (blue-check) related profiles. Free filter — applied directly from the related-account node, no enrichment needed. Default is false.",
            "default": false
          },
          "excludePrivate": {
            "title": "🚫 Exclude Private",
            "type": "boolean",
            "description": "Drop private related profiles. Free filter — applied directly from the related-account node, no enrichment needed. Default is false.",
            "default": false
          },
          "minFollowers": {
            "title": "👥 Minimum Followers",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only related profiles with at least this many followers. Requires Enrich Related Profiles = ON (follower counts are only known after enrichment). If set while enrichment is OFF, it is ignored and a warning is logged. Default is 0 (no minimum).",
            "default": 0
          },
          "bioKeyword": {
            "title": "🔍 Bio Keyword",
            "type": "string",
            "description": "Keep only related profiles whose biography contains this text (case-insensitive). Requires Enrich Related Profiles = ON. If set while enrichment is OFF, it is ignored and a warning is logged. Example: 'photographer'."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "Apify Proxy settings. Residential proxies are strongly recommended — Instagram throttles/blocks datacenter IPs. The actor requests residential IPs when Apify Proxy is enabled."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}