{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Stories & Highlights Scraper — Links, Mentions, Music",
    "description": "Scrape Instagram stories and highlights from any public account: every live story with link stickers, @mentions, hashtags, music and expiry time, plus highlights with their items. Batch hundreds of usernames per run; every account gets a status row (ok, no story, private, not found).",
    "version": "0.0",
    "x-build-id": "LxyYmHXJ8h2qGYube"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/afanasenko~instagram-stories-highlights-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-afanasenko-instagram-stories-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/afanasenko~instagram-stories-highlights-scraper/runs": {
      "post": {
        "operationId": "runs-sync-afanasenko-instagram-stories-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/afanasenko~instagram-stories-highlights-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-afanasenko-instagram-stories-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": {
          "operationMode": {
            "title": "1. Choose Operation Mode",
            "enum": [
              "storiesByUsername",
              "highlightsByUsername",
              "byUrl"
            ],
            "type": "string",
            "description": "Select what the run should collect. The fields you need to fill in below depend on this choice."
          },
          "usernames": {
            "title": "Accounts",
            "type": "array",
            "description": "Instagram usernames or profile links, one per line — for example natgeo, or https://www.instagram.com/natgeo/. Used by Mode 1 and Mode 2. Leave it empty and the run does a small capped demo on three well-known accounts so you can see the output shape first; it costs under $0.10 and says in the results that it was a demo. A private account, a deleted account, and a misspelled name cannot be read; each one comes back as its own free row naming the account and the reason.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxAccounts": {
            "title": "Max accounts to read (cost control)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard ceiling on how many accounts this run reads, across Mode 1 and Mode 2 — each account that is successfully read is one paid event ($0.01), and that one charge covers every live story the account has, whether it is one or twenty. An account that was read and had nothing live is still a read, so it is charged. Accounts that turn out to be private, missing or unreadable are not charged. Free plan ceiling: 8 accounts regardless of this value. 0 = unlimited. Default 100.",
            "default": 100
          },
          "includeHighlightItems": {
            "title": "Open each highlight",
            "type": "boolean",
            "description": "When on, every highlight is opened and its items are returned. When off, you get the highlight list only — cover, title, creation date and item count — which is enough to see what an account keeps, and costs nothing beyond the account charge.",
            "default": true
          },
          "maxHighlightsPerAccount": {
            "title": "Max highlights per account (cost control)",
            "minimum": 0,
            "type": "integer",
            "description": "How many highlights to open per account, newest first. Each opened highlight is one paid event ($0.0125), and one commonly holds twenty to thirty items. Accounts often keep more than ten; anything past this ceiling comes back as a row naming what was left unopened, so nothing disappears silently. Applies only when \"Open each highlight\" is on. On the free plan at most 2 highlights per account are opened, whatever you set. 0 = unlimited. Default 10.",
            "default": 10
          },
          "storyUrls": {
            "title": "Story or Highlight Links",
            "type": "array",
            "description": "Links to a story, a highlight, or a shared story, one per line. Accepts the three forms Instagram hands out: a story link, a highlight link, and the short share link that starts with /s/. Each link is resolved to the account behind it and that account is then read, so a link to one story returns everything that account has live.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "analyzeFrames": {
            "title": "Read the text and the subject off each picture",
            "type": "boolean",
            "description": "Instagram publishes a story's stickers and music as data, but not the words the author typed over the photo — on 32 of 66 measured frames Instagram returned no text at all while the picture carried a whole paragraph. With this on, each frame is read by an image model and four columns are filled in: the text on the picture, what the picture shows, the brands visible in it, and the language of the text. Each frame that comes back readable is one paid event ($0.0115 on a paid plan, $0.0125 on the free one, dropping to $0.010 at higher volume), on top of the account charge. Frames skipped by a cap or that come back unreadable are delivered without those columns and are not charged. A default run of 100 accounts with 3 frames each costs $4.00 to $4.45 with this on, against $1.00 with it off.",
            "default": true
          },
          "maxAnalyzedPerAccount": {
            "title": "Max frames analyzed per account (cost control)",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "How many frames per account are read by the model, newest first. This is what keeps the bill predictable on accounts that post a lot: at 32 stories an uncapped account would cost $0.40 by itself. Frames past this ceiling are still delivered, with the reason named in the analysis columns. Free plan: at most 3 frames per run in total, regardless of this value. 0 = unlimited. Default 3.",
            "default": 3
          },
          "skipPrivate": {
            "title": "Skip private accounts",
            "type": "boolean",
            "description": "Private accounts publish nothing that can be read without following them. Leaving this on skips them before any work is done, so they are never charged. Turning it off makes the run read a private account like any other, which means it is charged for the read even though it comes back empty.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}