# Instagram Posts & Reels

Extract Instagram posts and reels — captions, engagement, media, music, and authors — by profile (posts / reels / tagged tabs), post URL, hashtag, or keyword search

**Pricing:** $2 / 1k posts

**Endpoint:** `POST /api/v1/agents/instagram/posts/run`

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

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `handles` | array | No | Instagram usernames (e.g. natgeo) or profile URLs. One per line. |
| `tab` | string | No | Which profile tab to pull: the posts grid (photos + videos), the Reels tab, or posts the profile is tagged in. |
| `postUrls` | array | No | Instagram post or reel URLs, one per line — returns the full record for each. |
| `hashtags` | array | No | Hashtags to pull recent posts from, one per line, without the # (e.g. travel). |
| `query` | string | No | Search keyword — returns matching Reels from Instagram search. |
| `maxPages` | integer | No | Keyword-search result pages to fetch (~10–12 reels per page, capped at 8). |
| `maxResults` | integer | No | Number of posts per profile or hashtag. |
| `onlyPostsNewerThan` | date | No | Only get posts newer than this date (YYYY-MM-DD). Pinned posts may appear even if older. |

## Example

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

```python
import requests

resp = requests.post(
    "https://api.mindcase.co/api/v1/agents/instagram/posts/run",
    headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
    json={"params": {}},
)
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/api/v1/jobs/JOB_ID \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"

# 2) when status == completed, fetch the rows
curl https://api.mindcase.co/api/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 |
|-------|--------------|------|
| `postUrl` | Post URL | url |
| `caption` | Caption | text |
| `type` | Type | text |
| `contentFormat` | Content Format | text |
| `posted` | Posted | text |
| `source` | Source | text |
| `authorUsername` | Author Username | text |
| `authorName` | Author Name | text |
| `authorProfileUrl` | Author Profile URL | url |
| `authorVerified` | Author Verified | boolean |
| `likes` | Likes | number |
| `likesHidden` | Likes Hidden | boolean |
| `comments` | Comments | number |
| `plays` | Plays | number |
| `views` | Views | number |
| `shares` | Shares | number |
| `image` | Image | url |
| `videoUrl` | Video URL | url |
| `carouselImages` | Carousel Images | array |
| `durationS` | Duration (s) | number |
| `hashtags` | Hashtags | array |
| `mentions` | Mentions | array |
| `firstComment` | First Comment | text |
| `captionLanguage` | Caption Language | text |
| `locationName` | Location Name | text |
| `paidPartnership` | Paid Partnership | boolean |
| `pinned` | Pinned | boolean |
| `song` | Song | text |
| `artist` | Artist | text |
| `originalAudio` | Original Audio | boolean |
| `taggedUsers` | Tagged Users | object_array |
| `coauthors` | Coauthors | object_array |
