{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Highlights Scraper",
    "description": "Scrapes Instagram Story Highlights from any public profile, capturing highlight titles, cover images, story media, timestamps, and URLs. Ideal for content research, brand analysis, influencer insights, and automated extraction of long-term Instagram story archives",
    "version": "0.1",
    "x-build-id": "Y0heCpaRGUYQCbqDl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapio~instagram-highlights-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapio-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/scrapio~instagram-highlights-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapio-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/scrapio~instagram-highlights-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapio-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",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "📥 Instagram Profiles (URL or username)",
            "type": "array",
            "description": "One target per line. Accepts a full profile URL (https://www.instagram.com/nasa), a username (nasa) or an @handle (@nasa). Each is resolved to the profile and all its public story highlights are scraped. Example: https://www.instagram.com/nasa/",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "🔢 Max Highlights per Profile",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the number of highlights (parent rows) scraped per profile. Stories fetched inside a highlight do NOT count against this. 0 = unlimited. Example: 5 → at most 5 highlights per profile.",
            "default": 0
          },
          "keywords": {
            "title": "🔍 Title Keywords (include)",
            "type": "array",
            "description": "Only keep highlights whose title contains at least one of these words (case-insensitive). Leave empty to keep all. Example: [\"travel\", \"food\"].",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "🚫 Title Keywords (exclude)",
            "type": "array",
            "description": "Drop highlights whose title contains any of these words (case-insensitive). Example: [\"ad\", \"sponsored\"].",
            "items": {
              "type": "string"
            }
          },
          "minMediaCount": {
            "title": "📊 Minimum Media Count",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep highlights that contain at least this many stories. 0 = no minimum. Example: 5 → skip highlights with fewer than 5 stories.",
            "default": 0
          },
          "includeStories": {
            "title": "📺 Include Story Items",
            "type": "boolean",
            "description": "Fetch the actual stories inside each highlight: media type, image/video URL, taken-at timestamp, duration, dimensions and accessibility caption. Each story is emitted as a child row (type=story, isChild=true, parentId=highlight id) and also mirrored to a per-run 'stories-<runId>' dataset. Default: false.",
            "default": false
          },
          "maxStoriesPerHighlight": {
            "title": "📥 Max Stories per Highlight",
            "minimum": 0,
            "type": "integer",
            "description": "When 'Include Story Items' is on, cap how many stories to fetch per highlight. 0 = all stories in the highlight. Example: 10.",
            "default": 0
          },
          "downloadMedia": {
            "title": "🖼️ Download Media to Key-Value Store",
            "type": "boolean",
            "description": "Download each highlight cover image (and, when story items are enabled, each story's media) into this run's key-value store and add a 'downloadedMediaUrl' field. Default: false.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy Configuration",
            "type": "object",
            "description": "Choose which proxies to use. On an Instagram block the actor fails fast and escalates: datacenter, then residential (up to 3 retries with a fresh IP each time; once residential is used it stays sticky for the rest of the run)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}