{
  "openapi": "3.1.0",
  "info": {
    "title": "IGAPI",
    "version": "2.3.0",
    "summary": "REST API for public Instagram profiles, posts, reels, stories and highlights.",
    "description": "Public Instagram data over HTTPS and JSON. Send your key in the `X-API-Key` header; get one in the\n[customer portal](https://igapi.online/portal/). Prose guide (plans, limits, every error with what to do):\n[igapi.online/docs](https://igapi.online/docs).\n\n**Keys.** Whether a request without a valid key is served depends on the server's keyless policy: `open` (served, a\nper-IP limit may apply), `capped` (the trial plan's caps per IP) or `required` (`401`). An unknown or revoked key is\ntreated like no key, and the answer carries `X-API-Key-Status: invalid`.\n\n**Counting.** Each data request with a valid key is counted against its plan (or charged one credit). Failures on our\nside (`503 no_sessions`, `503 session_unavailable`, `429 rate_limited`, `502 upstream_failed`, a `500` of a network\nfailure) are given back. Input-check `400`s, your own `429`/`402` and `/api/health` are never counted.\n\n**Errors** are JSON: `{ \"error\": \"<code>\", \"message\": \"<text>\", … }` (the `Error` schema).\n",
    "contact": {
      "name": "IGAPI support",
      "url": "https://igapi.online/docs"
    }
  },
  "servers": [
    {
      "url": "https://igapi.online",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Profiles",
      "description": "Profile information and posts of a public account."
    },
    {
      "name": "Media",
      "description": "One post or reel by link, shortcode or id."
    },
    {
      "name": "Stories",
      "description": "Active stories, the highlight tray and the items of one highlight."
    },
    {
      "name": "Service",
      "description": "Health of the service; checking a key without spending a request."
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {}
  ],
  "paths": {
    "/api/userinfo/{username}": {
      "get": {
        "tags": [
          "Profiles"
        ],
        "operationId": "getUserInfo",
        "summary": "Profile information",
        "description": "Full public profile (snake_case fields). A private profile answers `200` with `is_private: true`.\n`posts_viewable` / `stories_viewable` say whether `/api/feed` and `/api/stories` / `/api/highlights` will serve it.\nA repeat lookup within the visit cache (default 3 minutes) is answered from the server's cache and counted the same.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Username"
          }
        ],
        "responses": {
          "200": {
            "description": "The profile.",
            "headers": {
              "X-API-Key-Status": {
                "$ref": "#/components/headers/X-API-Key-Status"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInfo"
                },
                "examples": {
                  "instagram": {
                    "$ref": "#/components/examples/UserInfo"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/feed/{username}": {
      "get": {
        "tags": [
          "Profiles"
        ],
        "operationId": "getFeed",
        "summary": "Posts of a profile (paginated)",
        "description": "About 12 posts a page. Pass `pagination.nextMaxId` of the previous page as `max_id`; `hasMore: false` is the last\npage. Each page is one counted request. A private profile always answers `403 private_account`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Username"
          },
          {
            "name": "max_id",
            "in": "query",
            "required": false,
            "description": "Pagination cursor — `pagination.nextMaxId` of the previous page, passed unchanged.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_=%.:-]{1,256}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of posts.",
            "headers": {
              "X-API-Key-Status": {
                "$ref": "#/components/headers/X-API-Key-Status"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedPage"
                },
                "examples": {
                  "nasa": {
                    "$ref": "#/components/examples/FeedPage"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/media": {
      "get": {
        "tags": [
          "Media"
        ],
        "operationId": "getMedia",
        "summary": "One post or reel",
        "description": "Give one of `url`, `shortcode` or `id` (checked before anything is counted: `400 invalid_input`). The answer has\nthe fields of a feed post plus `kind`, `mediaId`, `repostCount`, `audio` and the author in `user`.\n",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "description": "Post / reel link (`/p/`, `/reel/`, `/tv/`), URL-encoded.",
            "schema": {
              "type": "string"
            },
            "example": "https://www.instagram.com/reel/DBw2HiJkLmN/"
          },
          {
            "name": "shortcode",
            "in": "query",
            "description": "The post shortcode.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "description": "The numeric media id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The post.",
            "headers": {
              "X-API-Key-Status": {
                "$ref": "#/components/headers/X-API-Key-Status"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Media"
                },
                "examples": {
                  "reel": {
                    "$ref": "#/components/examples/Media"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/stories/{username}": {
      "get": {
        "tags": [
          "Stories"
        ],
        "operationId": "getStories",
        "summary": "Active stories",
        "description": "The stories live right now (`items: []` = none). A private profile is served only when the server's account\nthat looked it up follows it (and strict privacy is off); otherwise `403 private_account`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Username"
          }
        ],
        "responses": {
          "200": {
            "description": "The stories.",
            "headers": {
              "X-API-Key-Status": {
                "$ref": "#/components/headers/X-API-Key-Status"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Stories"
                },
                "examples": {
                  "nasa": {
                    "$ref": "#/components/examples/Stories"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamFailed"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/highlights/{username}": {
      "get": {
        "tags": [
          "Stories"
        ],
        "operationId": "getHighlights",
        "summary": "Highlight tray of a profile",
        "description": "Open one highlight with `/api/highlight/{id}`, passing the same `username`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Username"
          }
        ],
        "responses": {
          "200": {
            "description": "The highlight tray.",
            "headers": {
              "X-API-Key-Status": {
                "$ref": "#/components/headers/X-API-Key-Status"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Highlights"
                },
                "examples": {
                  "nasa": {
                    "$ref": "#/components/examples/Highlights"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/highlight/{id}": {
      "get": {
        "tags": [
          "Stories"
        ],
        "operationId": "getHighlight",
        "summary": "Items of one highlight",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Highlight id (5–25 digits), with or without the `highlight:` prefix.",
            "schema": {
              "type": "string",
              "pattern": "^(highlight:)?[0-9]{5,25}$"
            },
            "example": "17890000000000001"
          },
          {
            "name": "username",
            "in": "query",
            "required": false,
            "description": "The owner's username (recommended — the request continues on the account that just opened that profile).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The highlight with its items.",
            "headers": {
              "X-API-Key-Status": {
                "$ref": "#/components/headers/X-API-Key-Status"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Highlight"
                },
                "examples": {
                  "moon": {
                    "$ref": "#/components/examples/Highlight"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "tags": [
          "Service"
        ],
        "operationId": "getHealth",
        "summary": "Service health (and a free key check)",
        "description": "No key needed, never counted. With an `X-API-Key` header the answer also carries `apiKey` (`ok` | `invalid`) and\nthe `X-API-Key-Status` header — a way to test a key without spending a request. The HTTP status is `200` also\nwhen `status` is `no_sessions`.\n",
        "security": [
          {},
          {
            "ApiKeyHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "The service state.",
            "headers": {
              "X-API-Key-Status": {
                "$ref": "#/components/headers/X-API-Key-Status"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                },
                "examples": {
                  "operational": {
                    "$ref": "#/components/examples/Health"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Your key, `igapi_<32 hex>`. Query-string keys are not read."
      }
    },
    "parameters": {
      "Username": {
        "name": "username",
        "in": "path",
        "required": true,
        "description": "Instagram username without the `@` (letters, digits, `.` and `_`; no leading / trailing dot, no `..`).",
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._]{1,30}$"
        },
        "example": "nasa"
      }
    },
    "headers": {
      "X-API-Key-Status": {
        "description": "Sent when the request carried `X-API-Key` — `ok` (valid, active key) or `invalid` (unknown or revoked; served like a request without a key).",
        "schema": {
          "type": "string",
          "enum": [
            "ok",
            "invalid"
          ]
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying. Not sent with `plan_limit_exceeded` of `window: \"total\"` (a lifetime cap never resets).",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "X-Request-Id": {
        "description": "An id of this request, to quote to support. Present on every answer.",
        "schema": {
          "type": "string"
        }
      },
      "WWW-Authenticate": {
        "description": "`ApiKey realm=\"IGAPI\"` on a `401`.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Input check failed (refused before anything is counted): `invalid_username` (the username is not a plain\nInstagram name), `invalid_input` (a bad `max_id`, highlight id or media link — or Instagram rejected the input).\n",
        "headers": {
          "X-API-Key-Status": {
            "$ref": "#/components/headers/X-API-Key-Status"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "invalid_username",
              "message": "Invalid username. Please enter a plain Instagram username (e.g. instagram), not a URL or link."
            }
          }
        }
      },
      "Unauthorized": {
        "description": "The server's keyless policy is `required` and no valid key was sent — `api_key_required` (no key) or `api_key_invalid` (unknown or revoked key).",
        "headers": {
          "WWW-Authenticate": {
            "$ref": "#/components/headers/WWW-Authenticate"
          },
          "X-API-Key-Status": {
            "$ref": "#/components/headers/X-API-Key-Status"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiKeyError"
            },
            "example": {
              "error": "api_key_required",
              "message": "This API needs a key: send it in the X-API-Key header. How to get one: https://igapi.online/pricing",
              "apiKeyStatus": "missing",
              "docs": "https://igapi.online/docs#auth"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "`no_credits` — a credits key whose account has no credits left (`topup_url`, `balance: 0`); `plan_expired` — the\nkey's plan period ended (`plan_id`, `ended_at`, `buy_url`). Nothing is counted; no `Retry-After`.\n",
        "headers": {
          "X-API-Key-Status": {
            "$ref": "#/components/headers/X-API-Key-Status"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "no_credits",
              "message": "This API key runs on credits and the account has none left. Add credits at https://igapi.online/portal/credits to keep going.",
              "topup_url": "https://igapi.online/portal/credits",
              "balance": 0
            }
          }
        }
      },
      "Forbidden": {
        "description": "`private_account` — the profile is private and this endpoint does not serve it (`isPrivate: true`, `user`);\n`customer_disabled` — the account this key belongs to is disabled.\n",
        "headers": {
          "X-API-Key-Status": {
            "$ref": "#/components/headers/X-API-Key-Status"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "private_account",
              "message": "This account is private.",
              "isPrivate": true,
              "user": {
                "pk": "123",
                "username": "someone",
                "fullName": "",
                "isPrivate": true,
                "profilePic": null
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "`not_found` — the user, post or highlight does not exist (a renamed account answers 404 under its old name).",
        "headers": {
          "X-API-Key-Status": {
            "$ref": "#/components/headers/X-API-Key-Status"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "not_found",
              "message": "User not found: nosuchuser"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "`plan_limit_exceeded` — your key's plan cap for `window` (minute / day / month / total) is full;\n`rate_limit_exceeded` — the per-IP limit for requests without a valid key (`apiKeyStatus: \"invalid\"` when a bad key\nwas sent); `rate_limited` — Instagram is rate-limiting the serving account (our side: not counted).\n",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "X-API-Key-Status": {
            "$ref": "#/components/headers/X-API-Key-Status"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/RateLimitError"
            },
            "example": {
              "error": "plan_limit_exceeded",
              "plan": "pro",
              "window": "minute",
              "limit": 50,
              "current": 50,
              "retryAfterMs": 12000,
              "resetAt": "2026-11-04T12:01:00.000Z",
              "message": "…"
            }
          }
        }
      },
      "ServerError": {
        "description": "`server_error` — the request failed on the server; retry with backoff. Not counted when the cause was a network failure.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "server_error",
              "message": "The request failed on the server — please retry."
            }
          }
        }
      },
      "UpstreamFailed": {
        "description": "`upstream_failed` — the story request inside the profile visit failed (not counted); retry.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "upstream_failed",
              "message": "Stories unavailable right now, retry"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "`no_sessions` — no Instagram account of the service is usable right now; `session_unavailable` — the serving\naccount is busy or out of service (`reason`, `retryAfterMs`); `maintenance` — maintenance mode (`Retry-After: 300`);\n`site_busy` — the site's own lookup tools are busy. None of them is counted.\n",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "X-API-Key-Status": {
            "$ref": "#/components/headers/X-API-Key-Status"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "no_sessions",
              "message": "No active sessions available"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Every JSON error. Some codes add fields (see the response descriptions); clients must ignore fields they do not know.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Machine-readable code.",
            "examples": [
              "invalid_username",
              "invalid_input",
              "api_key_required",
              "api_key_invalid",
              "no_credits",
              "plan_expired",
              "customer_disabled",
              "private_account",
              "not_found",
              "plan_limit_exceeded",
              "rate_limit_exceeded",
              "rate_limited",
              "server_error",
              "upstream_failed",
              "no_sessions",
              "session_unavailable",
              "maintenance",
              "site_busy"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human-readable text (English)."
          },
          "retryAfterMs": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Milliseconds to wait (the `Retry-After` header in ms); `null` when waiting does not help."
          },
          "reason": {
            "type": "string",
            "description": "`session_unavailable` only: accounts_busy, account_busy, challenge_required, session_expired, session_limited, ip_blocked."
          },
          "isPrivate": {
            "type": "boolean",
            "description": "`private_account` only."
          },
          "user": {
            "description": "`private_account` only: what is known about the profile, or null.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": true
              }
            ]
          },
          "topup_url": {
            "type": "string",
            "format": "uri"
          },
          "balance": {
            "type": "number"
          },
          "plan_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "ended_at": {
            "type": "string",
            "format": "date-time"
          },
          "buy_url": {
            "type": "string",
            "format": "uri"
          },
          "apiKeyStatus": {
            "type": "string",
            "enum": [
              "missing",
              "invalid"
            ]
          }
        },
        "additionalProperties": true
      },
      "ApiKeyError": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Error"
          },
          {
            "type": "object",
            "required": [
              "error",
              "message",
              "apiKeyStatus",
              "docs"
            ],
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "api_key_required",
                  "api_key_invalid"
                ]
              },
              "apiKeyStatus": {
                "type": "string",
                "enum": [
                  "missing",
                  "invalid"
                ]
              },
              "docs": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        ]
      },
      "RateLimitError": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Error"
          },
          {
            "type": "object",
            "required": [
              "error",
              "message"
            ],
            "properties": {
              "error": {
                "type": "string",
                "enum": [
                  "plan_limit_exceeded",
                  "rate_limit_exceeded",
                  "rate_limited"
                ]
              },
              "plan": {
                "type": "string",
                "description": "The key's plan id (`plan_limit_exceeded`), or `trial` for the capped keyless policy."
              },
              "window": {
                "type": "string",
                "enum": [
                  "minute",
                  "day",
                  "month",
                  "total"
                ]
              },
              "limit": {
                "type": "integer"
              },
              "current": {
                "type": "integer"
              },
              "resetAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the window resets (UTC); `null` for `total`."
              }
            }
          }
        ]
      },
      "UserInfo": {
        "type": "object",
        "required": [
          "pk",
          "username",
          "is_private",
          "posts_viewable",
          "stories_viewable"
        ],
        "properties": {
          "pk": {
            "type": [
              "string",
              "integer"
            ],
            "description": "Instagram user id (Instagram's own type is passed through)."
          },
          "username": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "biography": {
            "type": "string"
          },
          "follower_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "following_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "posts": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Number of posts."
          },
          "reels": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Number of reels."
          },
          "is_verified": {
            "type": "boolean"
          },
          "is_private": {
            "type": "boolean"
          },
          "is_business": {
            "type": "boolean"
          },
          "category": {
            "type": "string"
          },
          "external_url": {
            "type": "string"
          },
          "public_email": {
            "type": "string"
          },
          "public_phone": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "profile_pic": {
            "type": "string",
            "description": "Profile picture URL (Instagram CDN, signed — it expires)."
          },
          "hd_profile_pic": {
            "type": "string"
          },
          "has_stories": {
            "type": "boolean"
          },
          "has_highlights": {
            "type": "boolean"
          },
          "is_threads_active": {
            "type": "boolean"
          },
          "is_whatsapp_linked": {
            "type": "boolean"
          },
          "posts_viewable": {
            "type": "boolean",
            "description": "`/api/feed` serves this profile (false for every private one)."
          },
          "stories_viewable": {
            "type": "boolean",
            "description": "`/api/stories` and `/api/highlights` serve this profile."
          }
        },
        "additionalProperties": true
      },
      "ImageVersion": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "VideoVersion": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "type": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Instagram's rendition type."
          }
        },
        "additionalProperties": true
      },
      "CarouselItem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "unknown"
            ]
          },
          "mediaUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "thumbnailUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImageVersion"
            }
          },
          "videos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VideoVersion"
            }
          }
        },
        "additionalProperties": true
      },
      "Post": {
        "type": "object",
        "required": [
          "pk",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "`<pk>_<owner pk>`."
          },
          "pk": {
            "type": "string"
          },
          "shortcode": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "carousel",
              "unknown"
            ]
          },
          "timestamp": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix seconds."
          },
          "caption": {
            "type": [
              "string",
              "null"
            ]
          },
          "likeCount": {
            "type": [
              "integer",
              "null"
            ]
          },
          "commentCount": {
            "type": [
              "integer",
              "null"
            ]
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "mediaUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "The best image, or for a video the best video file; for a carousel the first item's image."
          },
          "thumbnailUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "images": {
            "type": "array",
            "description": "Every image rendition, largest first.",
            "items": {
              "$ref": "#/components/schemas/ImageVersion"
            }
          },
          "videos": {
            "type": "array",
            "description": "Videos only.",
            "items": {
              "$ref": "#/components/schemas/VideoVersion"
            }
          },
          "viewCount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Videos only."
          },
          "videoDuration": {
            "type": [
              "number",
              "null"
            ],
            "description": "Videos only, seconds."
          },
          "hasAudio": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Videos only."
          },
          "carouselItems": {
            "type": "array",
            "description": "Carousels only.",
            "items": {
              "$ref": "#/components/schemas/CarouselItem"
            }
          }
        },
        "additionalProperties": true
      },
      "FeedUser": {
        "type": "object",
        "properties": {
          "pk": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "profilePic": {
            "type": [
              "string",
              "null"
            ]
          },
          "hdProfilePic": {
            "type": [
              "string",
              "null"
            ]
          },
          "isPrivate": {
            "type": "boolean"
          },
          "isVerified": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "FeedPage": {
        "type": "object",
        "required": [
          "user",
          "posts",
          "pagination"
        ],
        "properties": {
          "user": {
            "$ref": "#/components/schemas/FeedUser"
          },
          "posts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Post"
            }
          },
          "pagination": {
            "type": "object",
            "required": [
              "hasMore",
              "nextMaxId"
            ],
            "properties": {
              "hasMore": {
                "type": "boolean"
              },
              "nextMaxId": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Pass as `max_id` for the next page."
              },
              "count": {
                "type": "integer"
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "Audio": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "music",
              "original",
              "dash"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "artist": {
            "type": [
              "string",
              "null"
            ]
          },
          "durationSec": {
            "type": [
              "number",
              "null"
            ]
          },
          "coverUrl": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "Media": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Post"
          },
          {
            "type": "object",
            "required": [
              "mediaId",
              "kind"
            ],
            "properties": {
              "mediaId": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "image",
                  "video",
                  "reel",
                  "carousel",
                  "unknown"
                ],
                "description": "A reel is a video with `kind: \"reel\"`."
              },
              "repostCount": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "audio": {
                "description": "Videos only; `null` otherwise.",
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/Audio"
                  }
                ]
              },
              "user": {
                "description": "The author.",
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "pk": {
                        "type": "string"
                      },
                      "username": {
                        "type": "string"
                      },
                      "fullName": {
                        "type": "string"
                      },
                      "isVerified": {
                        "type": "boolean"
                      },
                      "isPrivate": {
                        "type": "boolean"
                      },
                      "profilePicUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": true
                  }
                ]
              }
            }
          }
        ]
      },
      "StoryUser": {
        "type": "object",
        "required": [
          "pk",
          "username"
        ],
        "properties": {
          "pk": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "isPrivate": {
            "type": "boolean"
          },
          "profilePic": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "StoryItem": {
        "type": "object",
        "required": [
          "id",
          "type",
          "mediaUrl"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ]
          },
          "timestamp": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix seconds."
          },
          "expiresAt": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix seconds; `null` for highlight items."
          },
          "mediaUrl": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "duration": {
            "type": [
              "number",
              "null"
            ],
            "description": "Videos only, seconds."
          }
        },
        "additionalProperties": true
      },
      "Stories": {
        "type": "object",
        "required": [
          "user",
          "items"
        ],
        "properties": {
          "user": {
            "$ref": "#/components/schemas/StoryUser"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoryItem"
            }
          }
        }
      },
      "HighlightTrayItem": {
        "type": "object",
        "required": [
          "id",
          "title"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Pass to `/api/highlight/{id}`."
          },
          "title": {
            "type": "string"
          },
          "coverUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "mediaCount": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "Highlights": {
        "type": "object",
        "required": [
          "user",
          "items"
        ],
        "properties": {
          "user": {
            "$ref": "#/components/schemas/StoryUser"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HighlightTrayItem"
            }
          }
        }
      },
      "Highlight": {
        "type": "object",
        "required": [
          "id",
          "title",
          "items"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "user": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "pk": {
                    "type": "string"
                  },
                  "username": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoryItem"
            }
          }
        }
      },
      "Incident": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "minutes": {
            "type": "integer"
          },
          "ongoing": {
            "type": "boolean"
          },
          "cause": {
            "type": "string",
            "enum": [
              "offline",
              "errors",
              "mixed"
            ]
          },
          "summary": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "Health": {
        "type": "object",
        "required": [
          "status",
          "uptime",
          "version"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "no_sessions"
            ],
            "description": "`ok` while at least one Instagram account of the service is active."
          },
          "uptime": {
            "type": "integer",
            "description": "Seconds since the server process started."
          },
          "version": {
            "type": "string"
          },
          "maintenance": {
            "type": "boolean",
            "const": true,
            "description": "Only while maintenance mode is on."
          },
          "state": {
            "type": "string",
            "enum": [
              "operational",
              "degraded",
              "down"
            ]
          },
          "uptime30d": {
            "type": [
              "number",
              "null"
            ],
            "description": "Share (%) of good minutes in the last 30 days."
          },
          "uptimeSince": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "avgLatencyMs": {
            "type": [
              "number",
              "null"
            ],
            "description": "Mean time of a successful data request over 24 h."
          },
          "lastIncident": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Incident"
              }
            ]
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "description": "The data backend and whether its services answered the last probe.",
            "properties": {
              "backend": {
                "type": "string",
                "enum": [
                  "json",
                  "pg"
                ]
              },
              "pg": {
                "type": "string",
                "enum": [
                  "ok",
                  "down",
                  "off"
                ]
              },
              "redis": {
                "type": "string",
                "enum": [
                  "ok",
                  "down",
                  "off"
                ]
              },
              "dualWrite": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "apiKey": {
            "type": "string",
            "enum": [
              "ok",
              "invalid"
            ],
            "description": "Only when `X-API-Key` was sent."
          }
        },
        "additionalProperties": true
      }
    },
    "examples": {
      "UserInfo": {
        "value": {
          "pk": "25025320",
          "username": "instagram",
          "full_name": "Instagram",
          "biography": "Discover what's new on Instagram",
          "follower_count": 672000000,
          "following_count": 160,
          "posts": 694,
          "reels": 310,
          "is_verified": true,
          "is_private": false,
          "is_business": true,
          "category": "Product/service",
          "external_url": "https://about.instagram.com",
          "public_email": "",
          "public_phone": "",
          "city": "",
          "profile_pic": "https://scontent.cdninstagram.com/v/t51.2885-19/instagram_s150.jpg",
          "hd_profile_pic": "https://scontent.cdninstagram.com/v/t51.2885-19/instagram_hd.jpg",
          "has_stories": true,
          "has_highlights": true,
          "is_threads_active": true,
          "is_whatsapp_linked": false,
          "posts_viewable": true,
          "stories_viewable": true
        }
      },
      "FeedPage": {
        "value": {
          "user": {
            "pk": "528817151",
            "username": "nasa",
            "fullName": "NASA",
            "profilePic": "https://scontent.cdninstagram.com/v/t51.2885-19/nasa_s150.jpg",
            "hdProfilePic": "https://scontent.cdninstagram.com/v/t51.2885-19/nasa_hd.jpg",
            "isPrivate": false,
            "isVerified": true
          },
          "posts": [
            {
              "id": "3480000000000000001_528817151",
              "pk": "3480000000000000001",
              "shortcode": "DBx1AbCdEfG",
              "type": "image",
              "timestamp": 1730000000,
              "caption": "Saturn's rings, up close.",
              "likeCount": 120044,
              "commentCount": 812,
              "width": 1080,
              "height": 1350,
              "mediaUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/post_1080.jpg",
              "thumbnailUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/post_1080.jpg",
              "images": [
                {
                  "url": "https://scontent.cdninstagram.com/v/t51.2885-15/post_1080.jpg",
                  "width": 1080,
                  "height": 1350
                }
              ]
            },
            {
              "id": "3479000000000000002_528817151",
              "pk": "3479000000000000002",
              "shortcode": "DBw2HiJkLmN",
              "type": "video",
              "timestamp": 1729900000,
              "caption": "Launch day.",
              "likeCount": 98000,
              "commentCount": 640,
              "width": 720,
              "height": 1280,
              "mediaUrl": "https://scontent.cdninstagram.com/o1/v/t16/clip_720.mp4",
              "thumbnailUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/clip_cover.jpg",
              "images": [
                {
                  "url": "https://scontent.cdninstagram.com/v/t51.2885-15/clip_cover.jpg",
                  "width": 720,
                  "height": 1280
                }
              ],
              "videos": [
                {
                  "url": "https://scontent.cdninstagram.com/o1/v/t16/clip_720.mp4",
                  "width": 720,
                  "height": 1280,
                  "type": 101
                }
              ],
              "viewCount": 2500000,
              "videoDuration": 31.4,
              "hasAudio": true
            }
          ],
          "pagination": {
            "hasMore": true,
            "nextMaxId": "3479000000000000002_528817151",
            "count": 12
          }
        }
      },
      "Media": {
        "value": {
          "id": "3479000000000000002_528817151",
          "pk": "3479000000000000002",
          "shortcode": "DBw2HiJkLmN",
          "type": "video",
          "kind": "reel",
          "mediaId": "3479000000000000002",
          "timestamp": 1729900000,
          "caption": "Launch day.",
          "likeCount": 98000,
          "commentCount": 640,
          "viewCount": 2500000,
          "repostCount": 120,
          "width": 720,
          "height": 1280,
          "videoDuration": 31.4,
          "hasAudio": true,
          "mediaUrl": "https://scontent.cdninstagram.com/o1/v/t16/clip_720.mp4",
          "thumbnailUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/clip_cover.jpg",
          "images": [
            {
              "url": "https://scontent.cdninstagram.com/v/t51.2885-15/clip_cover.jpg",
              "width": 720,
              "height": 1280
            }
          ],
          "videos": [
            {
              "url": "https://scontent.cdninstagram.com/o1/v/t16/clip_720.mp4",
              "width": 720,
              "height": 1280,
              "type": 101
            }
          ],
          "audio": {
            "url": "https://scontent.cdninstagram.com/o1/v/t2/audio.m4a",
            "source": "original",
            "title": "Original audio",
            "artist": "nasa",
            "durationSec": 31,
            "coverUrl": null
          },
          "user": {
            "pk": "528817151",
            "username": "nasa",
            "fullName": "NASA",
            "isVerified": true,
            "isPrivate": false,
            "profilePicUrl": "https://scontent.cdninstagram.com/v/t51.2885-19/nasa_s150.jpg"
          }
        }
      },
      "Stories": {
        "value": {
          "user": {
            "pk": "528817151",
            "username": "nasa",
            "fullName": "NASA",
            "isPrivate": false,
            "profilePic": "https://scontent.cdninstagram.com/v/t51.2885-19/nasa_s150.jpg"
          },
          "items": [
            {
              "id": "3480500000000000101",
              "type": "image",
              "timestamp": 1730000000,
              "expiresAt": 1730086400,
              "mediaUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/story_1.jpg",
              "thumbnailUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/story_1.jpg",
              "width": 1080,
              "height": 1920,
              "duration": null
            },
            {
              "id": "3480500000000000102",
              "type": "video",
              "timestamp": 1730003600,
              "expiresAt": 1730090000,
              "mediaUrl": "https://scontent.cdninstagram.com/o1/v/t16/story_2.mp4",
              "thumbnailUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/story_2.jpg",
              "width": 720,
              "height": 1280,
              "duration": 15
            }
          ]
        }
      },
      "Highlights": {
        "value": {
          "user": {
            "pk": "528817151",
            "username": "nasa",
            "fullName": "NASA",
            "isPrivate": false,
            "profilePic": "https://scontent.cdninstagram.com/v/t51.2885-19/nasa_s150.jpg"
          },
          "items": [
            {
              "id": "17890000000000001",
              "title": "Moon",
              "coverUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/moon_cover.jpg",
              "mediaCount": 12
            }
          ]
        }
      },
      "Highlight": {
        "value": {
          "id": "17890000000000001",
          "title": "Moon",
          "user": {
            "pk": "528817151",
            "username": "nasa"
          },
          "items": [
            {
              "id": "3100000000000000201",
              "type": "image",
              "timestamp": 1690000000,
              "expiresAt": null,
              "mediaUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/moon_1.jpg",
              "thumbnailUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/moon_1.jpg",
              "width": 1080,
              "height": 1920,
              "duration": null
            }
          ]
        }
      },
      "Health": {
        "value": {
          "status": "ok",
          "uptime": 86400,
          "version": "2.3.0",
          "state": "operational",
          "uptime30d": 99.95,
          "uptimeSince": "2026-10-04T10:42:00.000Z",
          "avgLatencyMs": 812,
          "lastIncident": {
            "date": "2026-11-02T14:05:00.000Z",
            "end": "2026-11-02T14:08:00.000Z",
            "minutes": 3,
            "ongoing": false,
            "cause": "offline",
            "summary": "The API did not answer for 3 minutes."
          },
          "updatedAt": "2026-11-03T10:42:00.000Z",
          "data": {
            "backend": "pg",
            "pg": "ok",
            "redis": "ok",
            "dualWrite": false
          }
        }
      }
    }
  }
}