{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Profile Extract By URL & Keyword",
    "description": "Scrape detailed Instagram profiles with the Instagram Profile Scraper. Retrieve usernames, full names, bios, follower counts, following counts, posts, and engagement stats. Ideal for influencer research, audience analysis, and social media insights. Fast, accurate, and scalable for bulk scraping.",
    "version": "0.1",
    "x-build-id": "e5Dmcn6wkxGqtXhdA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapier~instagram-profile-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapier-instagram-profile-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/scrapier~instagram-profile-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapier-instagram-profile-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/scrapier~instagram-profile-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapier-instagram-profile-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",
        "properties": {
          "startUrls": {
            "title": "🎯 Target Profiles",
            "type": "array",
            "description": "Instagram profiles to scrape. Accepts full URLs (`https://www.instagram.com/nasa/`), `instagram.com/nasa`, or bare usernames (`nasa`, `@nasa`). Post/reel URLs (`/p/...`, `/reel/...`) are rejected with a clear error row — they are not profiles. Example: `nasa`.",
            "items": {
              "type": "string"
            }
          },
          "searchKeywords": {
            "title": "🔍 Keyword Discovery",
            "type": "array",
            "description": "Optional. Find profiles by keyword via Instagram's top-search (instead of, or in addition to, known handles). Example: `fitness coach` → matching profiles are scraped, up to `maxProfilesPerKeyword` each. NOTE: Instagram gates the search endpoint (HTTP 401) for anonymous requests — provide a `sessionId` for keyword discovery to return results.",
            "items": {
              "type": "string"
            }
          },
          "maxProfilesPerKeyword": {
            "title": "🔢 Max Profiles Per Keyword",
            "minimum": 1,
            "type": "integer",
            "description": "Cap on how many discovered profiles to scrape per keyword. Example: 10. Default is 10.",
            "default": 10
          },
          "maxItems": {
            "title": "🧮 Max Profiles (top-level cap)",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on the number of PROFILE rows scraped (0 = unlimited). Child rows (posts/reels/highlights/followers) do NOT count toward this — they are bounded only by their own caps. Default is 0.",
            "default": 0
          },
          "maxPosts": {
            "title": "📷 Max Extra Posts",
            "minimum": 0,
            "type": "integer",
            "description": "Fetch posts BEYOND the ~12 embedded in the profile row, via feed pagination. Each becomes a child row (type=post). Works anonymously. 0 = disabled. Example: 30. Default is 0.",
            "default": 0
          },
          "maxReels": {
            "title": "🎬 Max Reels",
            "minimum": 0,
            "type": "integer",
            "description": "Fetch reels via the clips endpoint. Each becomes a child row (type=reel). 0 = disabled. NOTE: Instagram gates this endpoint (HTTP 403) for anonymous requests — provide a `sessionId` for it to return data. Reel/video content also appears in the extra-posts feed. Default is 0.",
            "default": 0
          },
          "includeHighlights": {
            "title": "✨ Include Highlights",
            "type": "boolean",
            "description": "Fetch the profile's story-highlights list (title, media count, cover). Each becomes a child row (type=highlight). NOTE: anonymous requests receive an empty tray — provide a `sessionId` for highlights to return data. Default is false.",
            "default": false
          },
          "includeFollowers": {
            "title": "👥 Include Followers Sample",
            "type": "boolean",
            "description": "Fetch a sample of followers as child rows (type=follower). HIGH block risk: this endpoint usually requires a logged-in session — provide `sessionId` for reliable results. Default is false.",
            "default": false
          },
          "includeFollowing": {
            "title": "➡️ Include Following Sample",
            "type": "boolean",
            "description": "Fetch a sample of accounts this profile follows as child rows (type=following). HIGH block risk: usually requires a logged-in session — provide `sessionId`. Default is false.",
            "default": false
          },
          "maxFollowersPerProfile": {
            "title": "🔢 Max Followers/Following Per Profile",
            "minimum": 1,
            "type": "integer",
            "description": "Cap on how many follower/following rows to fetch per profile. Example: 50. Default is 50.",
            "default": 50
          },
          "sessionId": {
            "title": "🔑 Instagram sessionid (optional)",
            "type": "string",
            "description": "Optional Instagram `sessionid` cookie value. Only needed to unlock auth-gated data (followers/following, richer About). Leave empty for anonymous scraping. Use a throwaway account — sessions can be rate-limited or challenged."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "Proxy used for ALL requests (HTTP + browser fallback). This actor HONORS your selection. Residential is recommended for Instagram; datacenter is often blocked."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}