# Instagram Stories API

Extract a public Instagram account's currently-active Stories — media URLs, timestamps, links, music, and poster details — by username

**Pricing:** $0.01 per story

**Endpoint:** `POST /v1/data/instagram/stories/run`

**Auth:** `Authorization: Bearer mk_live_...`

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `usernames` | array | Yes | Instagram usernames (e.g. natgeo, cnn) or full profile URLs (e.g. https://www.instagram.com/natgeo/) whose active Stories you want. Accounts with no live story return no rows. |

## Example

```bash
curl -X POST https://api.mindcase.co/v1/data/instagram/stories/run \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"params":{"usernames":["..."]}}'
```

```python
import requests

resp = requests.post(
    "https://api.mindcase.co/v1/data/instagram/stories/run",
    headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
    json={"params": {
    "usernames": [
        "..."
    ]
}},
)
data = resp.json()
```

## Get the results

`run` is async and returns a `job_id`. Poll until `status` is `completed`, then read the rows:

```bash
# 1) check status
curl https://api.mindcase.co/v1/jobs/JOB_ID \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"

# 2) when status == completed, fetch the rows
curl https://api.mindcase.co/v1/jobs/JOB_ID/results \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"
```

Full API reference (auth, jobs, balance, endpoints): https://mindcase.co/skills.md

## Response columns

| Field | Display name | Type |
|-------|--------------|------|
| `storyId` | Story ID | text |
| `shortcode` | Shortcode | text |
| `username` | Username | text |
| `profileUrl` | Profile URL | url |
| `fullName` | Full Name | text |
| `isVerified` | Is Verified | boolean |
| `mediaType` | Media Type | text |
| `imageUrl` | Image URL | url |
| `videoUrl` | Video URL | url |
| `videoDuration` | Video Duration | number |
| `hasAudio` | Has Audio | boolean |
| `width` | Width | number |
| `height` | Height | number |
| `takenAt` | Taken At | text |
| `expiringAt` | Expiring At | text |
| `isPaidPartnership` | Is Paid Partnership | boolean |
| `linkUrl` | Link URL | url |
| `linkTitle` | Link Title | text |
| `musicTitle` | Music Title | text |
| `musicArtist` | Music Artist | text |
| `posterProfilePic` | Poster Profile Pic | url |
