> Documentation index: https://docs.scrapier.io/llms.txt
> Auth: header `X-API-Key: <key>` · Base: https://api.scrapier.io/api/v2 · Synchronous; paginate with `cursor` ← `data.next_cursor`.

# Instagram Post

Fetch one Instagram post by URL or shortcode, with caption, owner, like and comment counts and its latest comments.

`GET|POST https://api.scrapier.io/api/v2/instagram-post-scraper/` · 1 credit per successful call · Single lookup

## Overview

Send a post, reel or tv URL, or a bare shortcode, in `urls`. You get back one `post` object with its ID, type, shortcode, caption, URL, like and comment counts and the owner's username.

`detail_level` (on by default) returns full detail including comments, and `comments_per_post` sets how many of the latest comments are kept. One record, no pagination.

## Use cases

- Enrich a list of post links with engagement numbers.
- Archive a post's caption and latest comments.

## Request

```bash
curl -G "https://api.scrapier.io/api/v2/instagram-post-scraper/" \
  -H "X-API-Key: YOUR_API_KEY" \
  --data-urlencode "urls=https://www.instagram.com/p/DXHKcyvEWfr/" \
  --max-time 210
```

```python
import requests

resp = requests.get(
    "https://api.scrapier.io/api/v2/instagram-post-scraper/",
    headers={"X-API-Key": "YOUR_API_KEY"},
    params={"urls": "https://www.instagram.com/p/DXHKcyvEWfr/"},
    timeout=210,
)
body = resp.json()
if not resp.ok:
    raise RuntimeError(body.get("error") or body.get("detail"))

print(body["data"]["post"])
```

POST with a JSON body works too (same parameters; the body is merged over the query string).

## Parameters

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `X-API-Key` (header) | string | yes | — | Your API key. |
| `urls` | string | yes | e.g. `https://www.instagram.com/p/DXHKcyvEWfr/` | Instagram post/reel/tv URL or bare shortcode. One record, no pagination. |
| `cursor` | string | no | — | Pagination cursor returned in the previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When `next_cursor` is null, you have reached the last page. |
| `detail_level` | boolean | no | `true` | Full detail incl. comments. Locked in cursor. |
| `comments_per_post` | integer | no | `10` | Latest comments kept. Locked in cursor. |
| `use_proxy` | boolean | no | `true` | Route the request through Scrapier's residential proxy pool. Default: `true`. Leave as is unless support tells you otherwise. |
| `raw_data` | boolean | no | `false` | When true, the response carries the full raw upstream payload(s) the scraper received (GraphQL / JSON API bodies, HTML, embedded JSON-LD -- exactly as the platform returned them) under `raw_responses`, in place of the formatted items. When false (default) you get the formatted output. Pagination (`cursor` / `next_cursor`) works the same in both modes. |

## Response

HTTP 200. Results are in `data.post`. Sample from the live catalog, arrays trimmed to 3 items.

```json
{
  "success": true,
  "data": {
    "urls": "https://www.instagram.com/p/DXHKcyvEWfr/",
    "post": {
      "inputUrl": "https://www.instagram.com/p/DXHKcyvEWfr/",
      "id": "3875111963462821867",
      "type": "Video",
      "shortCode": "DXHKcyvEWfr",
      "caption": "One trip to Italy is never enough. #TucciinItaly",
      "url": "https://www.instagram.com/p/DXHKcyvEWfr/",
      "commentsCount": 1637,
      "likesCount": 117980,
      "ownerUsername": "natgeo"
    },
    "next_cursor": null
  }
}
```

## Response fields

| Field | Type | Example | Description |
|---|---|---|---|
| `urls` | string | `https://www.instagram.com/p/DXHKcyvEWfr/` |  |
| `post` | object | `{…}` | The results. |
| `next_cursor` | null | `null` | Pass back as `cursor` for the next page. `null` on the last page. |
| `post.inputUrl` | string | `https://www.instagram.com/p/DXHKcyvEWfr/` |  |
| `post.id` | string | `3875111963462821867` |  |
| `post.type` | string | `Video` |  |
| `post.shortCode` | string | `DXHKcyvEWfr` |  |
| `post.caption` | string | `One trip to Italy is never enough. #TucciinItaly` |  |
| `post.url` | string | `https://www.instagram.com/p/DXHKcyvEWfr/` |  |
| `post.commentsCount` | integer | `1637` |  |
| `post.likesCount` | integer | `117980` |  |
| `post.ownerUsername` | string | `natgeo` |  |

## Pagination

Single lookup: everything comes back in one call and `next_cursor` is always `null`.

## Errors

Failed calls are free. Branch on HTTP status; the message is in `error` (or `detail`). See https://docs.scrapier.io/errors.md

- **400** Bad input. The exact message varies by endpoint. `{"success":false,"error":"…"}`
- **402** Balance below the endpoint's price. `{"error":"Insufficient credits. Buy more to scrape more.","balance":1,"required":2}`
- **403** Invalid or unknown API key. `{"detail":"Authentication service unavailable or invalid API key."}`
- **429** Throttled — wait for Retry-After. `{"detail":"Request was throttled. Expected available in N seconds."}`
- **404** unknown slug · **503** busy (retry after `Retry-After`) · **5xx** upstream failure or timeout (retry with backoff).

## Notes

- For reels you also want the view count, use `instagram-reel-scraper`.

## Related

- [Instagram Reel](https://docs.scrapier.io/api-reference/instagram/instagram-reel-scraper.md): Fetch one Instagram reel by URL or shortcode, with caption, owner, view, like and comment counts and its latest comments.
- [Instagram Comments](https://docs.scrapier.io/api-reference/instagram/instagram-comments.md): List the comments on a public Instagram post, with author, text and like count, from the post URL.
- [Instagram Transcript](https://docs.scrapier.io/api-reference/instagram/instagram-transcript.md): Transcribe the speech in an Instagram reel or video post from its URL, with detected language and the post's like and comment counts.
