{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Highlights Scraper - Stories & Media",
    "description": "Scrape Instagram story highlights from any public profile or highlight ID. Returns every story item with image/video URLs, timestamps, captions, video duration, and music, plus highlight titles and covers. No login or cookies. MCP-ready. $0.003 per story item.",
    "version": "1.0",
    "x-build-id": "1UHxq0g6RHoRacSOc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~instagram-highlights-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-instagram-highlights-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/khadinakbar~instagram-highlights-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-instagram-highlights-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/khadinakbar~instagram-highlights-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-instagram-highlights-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": {
          "usernames": {
            "title": "Instagram usernames or profile URLs",
            "maxItems": 100,
            "type": "array",
            "description": "Instagram usernames whose public story highlights should be scraped. Accepts plain handles (e.g. \"instagram\"), @handles (e.g. \"@natgeo\"), or full profile URLs (e.g. \"https://www.instagram.com/instagram/\"). Leave empty if you only pass highlightIds. NOT post, reel, or hashtag URLs.",
            "items": {
              "type": "string"
            }
          },
          "highlightIds": {
            "title": "Highlight IDs or highlight URLs",
            "maxItems": 200,
            "type": "array",
            "description": "Direct Instagram highlight IDs (e.g. \"18142207969557132\") or highlight URLs (e.g. \"https://www.instagram.com/stories/highlights/18142207969557132/\") whose story items should be scraped without listing a profile first. Combine with usernames or use alone. NOT a story, post, or profile URL.",
            "items": {
              "type": "string"
            }
          },
          "includeStories": {
            "title": "Expand every story inside each highlight",
            "type": "boolean",
            "description": "When true (default), each highlight is opened and one row is saved per story item with media URLs, timestamps, captions, and video metadata. When false, only the highlight list is saved (one row per highlight: title, cover, owner) at a lower per-row price. Turning this off is useful for cheap highlight discovery before deep-diving selected highlights.",
            "default": true
          },
          "maxHighlightsPerUser": {
            "title": "Max highlights per user",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Upper bound on how many highlights are processed per username, newest-tray order first. Accepts 1-200; defaults to 20. Raises the run cost ceiling because each highlight costs one provider call. NOT a cap on story items — use maxStoriesPerHighlight for that.",
            "default": 20
          },
          "maxStoriesPerHighlight": {
            "title": "Max story items per highlight",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper bound on story items saved per expanded highlight. Accepts 1-1000; defaults to 100. Most highlights contain 5-50 items. NOT a global cap — use maxTotalItems for that.",
            "default": 100
          },
          "maxTotalItems": {
            "title": "Max total rows per run",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard global cap on saved rows across all targets; the run stops gracefully when reached. Accepts 1-100000; defaults to 5000. Works as a spend guard together with the per-result event price. NOT a per-target limit.",
            "default": 5000
          },
          "providerOrder": {
            "title": "Data provider order",
            "enum": [
              "scrapecreators-first",
              "sociavault-first",
              "scrapecreators-only",
              "sociavault-only"
            ],
            "type": "string",
            "description": "Order in which the backing data providers are tried for every request. Defaults to scrapecreators-first; the fallback provider is used automatically when the primary fails. Use sociavault-first to invert the order or a -only value to pin one provider. Providers are owner-configured secrets; you never need an API key.",
            "default": "scrapecreators-first"
          },
          "includeRawData": {
            "title": "Include raw provider payload",
            "type": "boolean",
            "description": "When true, each row also carries the unmodified provider item under a \"raw\" key for debugging or field-level analysis. Defaults to false because raw payloads roughly triple row size. NOT needed for normal scraping — every normalized field is already extracted.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}