# Instagram Highlights API

> List a public Instagram account's story highlights (title, cover, item count) and get every story inside a highlight as JSON. 1 credit per call.

**List the story highlights of a public Instagram account** (title, cover image, number of stories) and **get the stories inside each highlight** with their image or video URLs.

```
GET https://api.klupt.io/v1/users/{user}/highlights
GET https://api.klupt.io/v1/highlights/{highlight}
```

- `GET /v1/users/{user}/highlights`: Highlights of an account
- `GET /v1/highlights/{highlight}`: The stories inside one highlight

**Cost:** 1 credit per successful call (0.5 from cache). Failed calls and private accounts are free.

## Parameters

| Parameter | In | Description |
|---|---|---|
| `user` | path | Username (`natgeo`) or numeric user id. Private accounts answer `403 private_account` (free). |
| `highlight` | path | Numeric highlight id (from the highlights list). |
| `fresh` | query | `true` skips the cache (full price). |

## Response

```json
{{SAMPLE_user_highlights}}
```

## Examples

```bash
curl "https://api.klupt.io/v1/users/natgeo/highlights" -H "X-Api-Key: $KLUPT_API_KEY"
```

```python
import os, requests
r = requests.get("https://api.klupt.io/v1/users/natgeo/highlights",
                 headers={"X-Api-Key": os.environ["KLUPT_API_KEY"]}, timeout=30)
r.raise_for_status()
for hl in r.json()["data"]:
    print(hl["id"], hl["title"], hl["item_count"])
```

```javascript
const res = await fetch("https://api.klupt.io/v1/users/natgeo/highlights", {
  headers: { "X-Api-Key": process.env.KLUPT_API_KEY },
});
const { data: highlights } = await res.json();
```

## FAQ

### How do I download Instagram highlights with an API?
Call `GET /v1/users/{username}/highlights` for the list, then `GET /v1/highlights/{id}` for each highlight: every story has a `video_url` or `thumbnail_url`.
