{
  "openapi": "3.0.1",
  "info": {
    "title": "All-in-One Instagram Scraper",
    "description": "Instagram scraper — 11 modes: profiles, posts, reels, comments, hashtags, tagged, search, followers count & more. No browser needed — HTTP-only, 256MB, fast. Premium residential proxy (~95% success rate). Pay per result: 40% cheaper. MCP-ready for AI agents.",
    "version": "0.1",
    "x-build-id": "KehKUgaCB02OEttZa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/get-leads~all-in-one-instagram-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-get-leads-all-in-one-instagram-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/get-leads~all-in-one-instagram-scraper/runs": {
      "post": {
        "operationId": "runs-sync-get-leads-all-in-one-instagram-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/get-leads~all-in-one-instagram-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-get-leads-all-in-one-instagram-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": [
          "scrapeMode"
        ],
        "properties": {
          "scrapeMode": {
            "title": "Scrape Mode",
            "enum": [
              "instagram-scraper",
              "instagram-profile-scraper",
              "instagram-post-scraper",
              "instagram-reels-scraper",
              "instagram-comment-scraper",
              "instagram-hashtag-scraper",
              "instagram-tagged-scraper",
              "instagram-search-scraper",
              "instagram-followers-count-scraper",
              "instagram-data-extractor",
              "instagram-monitor"
            ],
            "type": "string",
            "description": "Choose which Instagram scraper to run.",
            "default": "instagram-profile-scraper"
          },
          "profiles": {
            "title": "Profiles",
            "type": "array",
            "description": "Instagram usernames, @handles, or full profile URLs. Duplicates are removed automatically. Used by: profile-scraper, tagged-scraper, followers-count, instagram-scraper, data-extractor.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "postURLs": {
            "title": "Post/Reel URLs",
            "type": "array",
            "description": "Instagram post or reel URLs (e.g., https://www.instagram.com/p/ABC123/ or https://www.instagram.com/reel/ABC123/). Also accepts shortcodes. Used by: post-scraper, reels-scraper, comment-scraper, instagram-scraper, data-extractor.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtags to scrape (with or without #). Also accepts explore/tags URLs. Used by: hashtag-scraper, instagram-scraper, data-extractor.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "Search for users, hashtags, or places on Instagram. Used by: search-scraper, instagram-scraper, data-extractor.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "resultsPerPage": {
            "title": "Results Per Page",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of results per hashtag, tagged user, or search query.",
            "default": 50
          },
          "maxPostsPerProfile": {
            "title": "Max Posts Per Profile",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of latest posts to embed within each profile result (0-100, default: 12).",
            "default": 12
          },
          "maxCommentsPerPost": {
            "title": "Max Comments Per Post",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of comments to scrape per post (comment-scraper mode). Requires login cookies for best results.",
            "default": 100
          },
          "rateLimitProfile": {
            "title": "Rate Limit Profile (Cookie Runs)",
            "enum": [
              "conservative",
              "moderate",
              "aggressive"
            ],
            "type": "string",
            "description": "Controls how strictly the actor throttles cookie-using runs to protect your IG account from automated-behavior detection. Only applies when authenticated mode is active (Comments + Search modes always; other modes when `useAuthMode=true`).\n\n🛡️ Day-4 (2026-04-26): added after our reference IG account triggered an 'automated behavior' warning at 31 runs/hour from one cookie. Conservative defaults keep total cookie-correlated activity well below IG's empirical ~50 sessions/24h flag threshold.\n\nProfile multipliers (applied to per-cookie hourly + daily caps; cooldown stays at 60s regardless):\n• conservative: 5 runs/hr, 30/day, 2 concurrent — safe-by-default after the 2026-04-25 incident\n• moderate: 10 runs/hr, 60/day, 4 concurrent — for established accounts with a clean history\n• aggressive: 20 runs/hr, 120/day, 8 concurrent — matches the run pattern that triggered the incident; not recommended\n\nWhen the gate rejects a run, you get an `input_validation_error` dataset item with retry-after guidance and ZERO billing. Set env var IG_ADMISSION_GATE_DISABLED=1 to disable entirely (NOT recommended).",
            "default": "conservative"
          },
          "useAuthMode": {
            "title": "Use Authenticated Mode (informational, deprecated 2026-05-08)",
            "type": "boolean",
            "description": "Deprecated as of 2026-05-08. This field is preserved for backward compatibility but no longer changes behavior — to enable authenticated mode, simply provide your cookies in the `loginCookies` field below. Cookies pasted there implicitly enable authenticated mode for cookie-optional modes; absence of cookies in cookie-required modes (Comments, Search) fails fast with `input_validation_error`.\n\nLegacy behavior (pre-2026-05-08): toggling this ON would cause the scraper to fall back to the operator's `IG_LOGIN_COOKIES` env var. That fallback has been removed for the customer-vs-operator cookie boundary — every authenticated run now uses the cookies you provide via `loginCookies`, attributing the activity to your own IG account.",
            "default": false
          },
          "loginCookies": {
            "title": "Your Instagram cookies (REQUIRED for Comments and Search modes)",
            "type": "string",
            "description": "Customer-supplied: paste your OWN Instagram cookies from a logged-in browser session (DevTools → Application → Cookies → instagram.com). Accepts multiple formats: (1) Standard: sessionid=XXX; csrftoken=XXX; ds_user_id=XXX (2) JSON object: {\"sessionid\":\"XXX\",\"csrftoken\":\"XXX\"} (3) JSON array: [{\"name\":\"sessionid\",\"value\":\"XXX\"}] (4) Raw sessionid value. Must include a valid sessionid — cookies without it are rejected at pre-flight with NO billing (secret values are masked in the error preview).\n\n**REQUIRED for**: Comments Scraper, Search Scraper. **Optional for**: Profile, Post, Reels, Hashtag, Tagged, Followers Count, Data Extractor, all-in-one — these run anonymously by default for safer behavior; supplying cookies here unlocks +6 enhanced fields (avgLikes, avgComments, engagementRate, businessEmail, businessPhoneNumber, pronouns) and exact like/comment counts on posts/reels of any age via the shortcode→PK mobile-API path, plus owner details, dimensions, accessibility caption, tagged users, location, carousel images, video URLs/duration, reel plays/shares/saves/audio, hashtag topPosts, real tagged media feed, and search follower-count enrichment.\n\n**Important: this actor does NOT include any Instagram cookies for customer runs.** When a mode requires authentication, you must paste **your own** cookies into this field. There is no shared cookie pool, no built-in fallback, and no operator-side cookie injection — every authenticated run uses the cookies you provide, attributing the activity to *your* Instagram account. (Operator daily-tests use the same `loginCookies` input field, with cookies passed by the daily-test orchestrator.)\n\n🛡️ Comments and Search modes run a 2-second cookie-health probe before any work — if the cookie is expired, the run aborts with an `input_validation_error` dataset item and is NOT billed. No wasted minutes on dead sessions."
          },
          "cookieCountry": {
            "title": "Cookie Country (2-letter code)",
            "type": "string",
            "description": "Country where you logged into Instagram (e.g., NL, US, GB, DE). The proxy will use this country to match your login IP location. Instagram invalidates cookies used from a different country. Required when using login cookies.",
            "default": ""
          },
          "alertEmail": {
            "title": "Alert Email (Monitor Mode)",
            "type": "string",
            "description": "Email address for health check alerts. Used in Monitor mode — receives alerts when the cookie expires or test runs fail."
          },
          "webhookUrl": {
            "title": "Webhook URL (Monitor Mode)",
            "type": "string",
            "description": "Webhook URL to receive alert notifications (n8n, Zapier, Slack, etc.). When Monitor mode detects issues (expired cookie, failed runs), it sends a POST request with alert details to this URL."
          },
          "proxyTier": {
            "title": "Proxy Tier",
            "enum": [
              "none",
              "residential",
              "custom"
            ],
            "type": "string",
            "description": "Choose your proxy setup. 'Residential (built-in)' is the recommended default — it routes every request through a residential IP so Instagram does not flag your cookie sessions, and it is required for the authenticated endpoints behind Comments, Search, and full Reels/Tagged data. 'None' uses datacenter IPs (faster and cheaper but Instagram rate-limits these aggressively on auth endpoints). 'Bring your own' lets you supply your own residential proxy URL in the Proxy Configuration below.",
            "default": "residential"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration (Option: bring your own)",
            "type": "object",
            "description": "Supply your own proxy. Used when proxyTier is 'Bring your own' or when you want to override proxy settings. Any residential proxy provider that issues a standard http://user:pass@host:port URL is supported.",
            "default": {}
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}