{
  "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 or video URL, timestamp, caption, duration and music, plus highlight titles and covers. No login or cookies needed.",
    "version": "1.0",
    "x-build-id": "CQS5OqVTguxDO7DMe"
  },
  "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"
            }
          },
          "includeActiveStories": {
            "title": "Include active 24-hour stories",
            "type": "boolean",
            "description": "When true, each username is also checked for stories posted in the last 24 hours, and one row per current story is saved with recordType \"active_story\" (media URLs, posted and expiry time, mentions, link stickers). Each saved story is billed like a story item. Usernames with no current stories, or private profiles, return no rows and no story charge. Once the Pricing tab lists an \"active-story-lookup\" event, each profile that is checked also bills that small lookup fee. Off by default.",
            "default": false
          },
          "includeStatusRows": {
            "title": "Add a status row per input",
            "type": "boolean",
            "description": "When true, the dataset also gets one free row per username or highlight (recordType \"target_status\") saying what happened: ok, not_found, private, no_highlights, no_active_stories, failed or not_processed, with counts. These rows are never charged and are not counted in maxTotalItems. Off by default so existing pipelines see no new rows; the same information is always available in the run's OUTPUT record.",
            "default": false
          },
          "includeHighlights": {
            "title": "Include highlights",
            "type": "boolean",
            "description": "When true (default), the saved highlights of each username are scraped. Turn off together with \"Include active 24-hour stories\" on to get only current stories. Direct highlight IDs are always scraped.",
            "default": true
          },
          "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
          },
          "maxActiveStoriesPerUser": {
            "title": "Max active stories per user",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Upper bound on current 24-hour stories saved per username when active stories are on. Accepts 1-200; defaults to 100.",
            "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 (the prefilled 100 is a small first test). Use it as a spend guard together with the per-row price. NOT a per-target limit. Free Apify plan runs return up to 250 results per run.",
            "default": 5000
          },
          "includeRawData": {
            "title": "Include raw response 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
          },
          "allowCostlyFallback": {
            "title": "Allow slower, costlier live-stories backup route",
            "type": "boolean",
            "description": "Only applies when active 24-hour stories are on. If the main live-stories route does not answer, the profile is skipped, marked route_unavailable in the status and not charged. Turn this on to try a backup route instead: it usually works but is slower and does not change what you are billed. Off by default. NOT needed for highlights.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}