{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Followers And Following Scrapper with AI Enrichment",
    "description": "Extract followers and following lists from Instagram profiles with this scraper. Collect usernames, profile links, display names, and account details. Useful for audience research, influencer analysis, competitor monitoring, and tracking community growth on Instagram profiles.",
    "version": "0.1",
    "x-build-id": "cTQhbPvl5gpyytiUQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper-engine~instagram-followers-and-following-scrapper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper-engine-instagram-followers-and-following-scrapper",
        "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/scraper-engine~instagram-followers-and-following-scrapper/runs": {
      "post": {
        "operationId": "runs-sync-scraper-engine-instagram-followers-and-following-scrapper",
        "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/scraper-engine~instagram-followers-and-following-scrapper/run-sync": {
      "post": {
        "operationId": "run-sync-scraper-engine-instagram-followers-and-following-scrapper",
        "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": [
          "scrapeMode",
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "📋 Instagram Profile URLs or Usernames",
            "type": "array",
            "description": "List of Instagram profile URLs or usernames to analyze. Examples: https://www.instagram.com/nasa/ · nasa · @nasa. Multiple profiles are processed sequentially.",
            "items": {
              "type": "string"
            }
          },
          "scrapeMode": {
            "title": "🎯 Scrape Mode",
            "enum": [
              "followers",
              "following",
              "both"
            ],
            "type": "string",
            "description": "followers = who follows the target (inbound audience). following = who the target follows (outbound interests). both = fetch BOTH lists and compute mutuals / fans / non-followers-back + a reciprocity summary (the set-analytics mode).",
            "default": "both"
          },
          "maxData": {
            "title": "📊 Max Items per List (0 = unlimited)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cap per list. Example: 500 caps followers to 500 and following to 500. IMPORTANT for 'both' mode: for EXACT set math (fans / non-followers-back) leave this 0 (unlimited) so both lists are fully crawled; if you cap it, the crawl is flagged completeness=partial and the uncertain labels are downgraded to plain follower/following. Default 0.",
            "default": 0
          },
          "enrichProfiles": {
            "title": "💎 Enrich Profiles (bio, counts, business, email/phone, geo)",
            "type": "boolean",
            "description": "OFF by default. When ON, one extra request per user fetches bio, follower/following/media counts, business flags, category, public email/phone, geo, and the HD avatar. Absent values are emitted as null (never guessed); a coverage summary reports how often each field was actually present. Adds cost and ban-risk (1 request per user), so keep it off for very large lists.",
            "default": false
          },
          "pageSize": {
            "title": "📄 API Page Size (advanced)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Users fetched per API page (Instagram allows up to ~100). Larger = fewer requests = lower ban surface. Default 50.",
            "default": 50
          },
          "sessionId": {
            "title": "🍪 Instagram sessionid (required in practice)",
            "type": "string",
            "description": "The friendships and enrichment endpoints are login-walled, so a valid sessionid cookie is effectively required. Get it from your browser: DevTools → Application → Cookies → instagram.com → sessionid. Supplying it also enables the sticky-IP anti-ban path (one exit IP for the whole run)."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "Honored from the FIRST request (no direct-first override). RESIDENTIAL is strongly recommended for Instagram. On a soft-block the actor escalates to residential while preserving your country. With a sessionId the exit IP is sticky (anti-ban); without one it rotates per request.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}