{
  "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": "iipESr8WKwfuzL6f5"
  },
  "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
          },
          "loginCookies": {
            "title": "Login Cookies (Optional)",
            "type": "string",
            "description": "Instagram cookies from your browser. 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. Get from DevTools → Application → Cookies → instagram.com. Unlocks: exact like/comment counts, postId, tagged users, location, carousel images, video URLs, comments, hashtag posts, tagged media."
          },
          "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. 'None' works for most modes. 'Residential (built-in)' routes all requests through a residential IP to prevent cookie sessions from being flagged by Instagram's security system — applies to all modes automatically, adds ~$0.003/result to cover proxy bandwidth. 'Bring your own' lets you supply your own residential proxy URL in proxyConfiguration below (DataImpulse ~$1/GB, Evomi ~$0.49/GB).",
            "default": "none"
          },
          "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. Recommended providers for residential: DataImpulse (https://dataimpulse.com, ~$1/GB) or Evomi (https://evomi.com, ~$0.49/GB).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}