{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Posts Scraper",
    "description": "Scrape posts and reels from any Instagram profile (e.g. instagram.com/meta) with a start/end date filter. Returns caption, hashtags, likes, comments, views, media URLs, location, tagged users, music and profile stats. Requires a session (cookies or automated login).",
    "version": "0.0",
    "x-build-id": "OlDOOSdV4xhtkCqfs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/outspoken_strategy~instagram-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-outspoken_strategy-instagram-posts-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/outspoken_strategy~instagram-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-outspoken_strategy-instagram-posts-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/outspoken_strategy~instagram-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-outspoken_strategy-instagram-posts-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": {
          "profileUrl": {
            "title": "Profile URL",
            "type": "string",
            "description": "The Instagram profile to scrape, e.g. https://www.instagram.com/meta. A username (\"meta\" or \"@meta\") works too."
          },
          "profileUrls": {
            "title": "Profile URLs (multiple)",
            "type": "array",
            "description": "Several profiles to scrape — each is scraped separately and results are combined. \"Number of posts\" applies PER profile.",
            "items": {
              "type": "string"
            }
          },
          "numberOfPosts": {
            "title": "Number of posts",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of posts to return per profile (after date filtering).",
            "default": 25
          },
          "scrapeAll": {
            "title": "Scrape all (auto-paginate)",
            "type": "boolean",
            "description": "Keep paging until the target count is reached, the date range is passed, or the profile runs out of posts. When unchecked only the first page (12 posts) is fetched.",
            "default": true
          },
          "start_date": {
            "title": "Start Date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only return posts published on or after this date (format: yyyy-mm-dd)."
          },
          "end_date": {
            "title": "End Date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only return posts published on or before this date, inclusive (format: yyyy-mm-dd)."
          },
          "includePinned": {
            "title": "Include pinned posts",
            "type": "boolean",
            "description": "Pinned posts sit at the top of a profile regardless of age. Uncheck to always exclude them.",
            "default": true
          },
          "cookies": {
            "title": "Instagram session cookies",
            "type": "array",
            "description": "Cookies of a logged-in Instagram session exported with Cookie-Editor / EditThisCookie (JSON array). The \"sessionid\" cookie carries the session. Alternatively set the IG_COOKIES env var."
          },
          "igUsername": {
            "title": "Instagram username (automated login)",
            "type": "string",
            "description": "Throwaway account username (2FA off), used only when no valid cookies are available. Prefer the IG_USERNAME env var."
          },
          "igPassword": {
            "title": "Instagram password (automated login)",
            "type": "string",
            "description": "Password for igUsername. Prefer the IG_PASSWORD secret env var."
          },
          "timeSince": {
            "title": "Since date (alias of Start Date)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Alias of start_date, matching the Facebook profile posts actor."
          },
          "timeUntil": {
            "title": "Until date (alias of End Date)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Alias of end_date."
          },
          "resultsLimit": {
            "title": "Results limit (alias of Number of posts)",
            "minimum": 1,
            "type": "integer",
            "description": "Alias of numberOfPosts for integrations built against other Instagram actors."
          },
          "usernames": {
            "title": "Usernames (alias of Profile URLs)",
            "type": "array",
            "description": "Alias of profileUrls.",
            "items": {
              "type": "string"
            }
          },
          "proxySessionId": {
            "title": "Pinned proxy session id (keeps the session alive)",
            "type": "string",
            "description": "Stable id (or the IG_PROXY_SESSION env var) to keep the account on ONE exit IP across runs — Instagram flags sessions that hop IPs. One id per account, e.g. \"igacct1\"."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxies with a fixed country are strongly recommended; Instagram blocks datacenter IPs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          },
          "enrichPosts": {
            "title": "Fetch full post details (views, location, alt text)",
            "type": "boolean",
            "description": "The profile grid omits view/play counts, location and alt text. With this on, the actor requests each kept post's full details (one extra request per post, so runs are slower). Turned off automatically if Instagram rate-limits the requests.",
            "default": true
          },
          "headless": {
            "title": "Run browser headless",
            "type": "boolean",
            "description": "Uncheck only for local debugging.",
            "default": true
          },
          "debug": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Save Instagram API/GraphQL responses, a screenshot and the page HTML to the run's key-value store. For troubleshooting.",
            "default": false
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}