> **For coding agents and LLMs:** This is one page from the Social Fetch docs (markdown export). For curated orientation and workflow guidance, start with [`/llms.txt`](https://www.socialfetch.dev/llms.txt); for agent onboarding and crawl rules, use [`/agents.txt`](https://www.socialfetch.dev/agents.txt); for the full endpoint list with links to pages like this one, use [`/llms-endpoints.txt`](https://www.socialfetch.dev/llms-endpoints.txt); for one platform's parameters and curls, use [`/llms-{platform}.txt`](https://www.socialfetch.dev/llms-tiktok.txt); use [`/llms.json`](https://www.socialfetch.dev/llms.json) when you need structured JSON for tool registration.

## This page

- **On-site (HTML):** <https://www.socialfetch.dev/docs/api/v2/instagram>
- **Markdown (.mdx) URL:** <https://www.socialfetch.dev/docs/api/v2/instagram.mdx>

## API base URL and authentication

- **API origin (from OpenAPI `servers`):** `https://api.socialfetch.dev`
- **Authentication:** send `x-api-key: sfk_...` on `/v1/**` and `/v2/**` routes unless the operation is explicitly anonymous (check OpenAPI `security`, the [API reference hub](https://www.socialfetch.dev/docs/api.mdx), [`/llms.txt`](https://www.socialfetch.dev/llms.txt), or [`/llms.json`](https://www.socialfetch.dev/llms.json) for each route).
- **OpenAPI JSON:** <https://www.socialfetch.dev/openapi.json>

## Recommended docs entrypoints (this site)

- [Documentation overview](https://www.socialfetch.dev/docs.mdx) — top-level orientation (markdown).
- [Quickstart](https://www.socialfetch.dev/docs/quickstart.mdx) — authenticate with `x-api-key`, validate auth with `whoami`, and understand the JSON envelope.
- [SDK](https://www.socialfetch.dev/docs/sdk.mdx) — official TypeScript SDK guide, including `SocialFetchClient`, `Result`, and `unwrap()`.
- [Capability matrix](https://www.socialfetch.dev/docs/capability-matrix.mdx) — every operation with identifiers, pagination, outcomes, media download, credits, and its SDK method. Generated from OpenAPI, so use it for route selection instead of scanning individual pages.
- [Recipes](https://www.socialfetch.dev/docs/recipes.mdx) — copyable workflows (brand monitoring, transcripts, Ad Library, creator scoring, Reddit research) with credit callouts and SDK examples.
- [Integrations](https://www.socialfetch.dev/docs/integrations.mdx) — MCP for AI clients, n8n verified node, Apify Store Actors, Make custom app, SDK, and REST API connection paths.
- [MCP product page](https://www.socialfetch.dev/mcp) — hosted MCP overview, OAuth, Skills install.
- [MCP integration](https://www.socialfetch.dev/docs/integrations/mcp.mdx) — hosted `/mcp` server, OAuth, Cursor/VS Code/Claude install snippets, 264 endpoint tools, plus docs_search/docs_read for implementation help.
- [n8n integration](https://www.socialfetch.dev/docs/integrations/n8n.mdx) — install `n8n-nodes-socialfetch`, credentials, and workflow examples.
- [Apify integration](https://www.socialfetch.dev/docs/integrations/apify.mdx) — Store Actors under @social-fetch, PPE billing, dataset export, and quick start.
- [Make integration](https://www.socialfetch.dev/docs/integrations/make.mdx) — custom app modules for Make scenarios, API key credentials, and module catalog.
- [`/llms-endpoints.txt`](https://www.socialfetch.dev/llms-endpoints.txt) — every documented operation with a direct link to that route's agent-readable markdown page (prefer this over parsing OpenAPI).
- [`/llms-{platform}.txt`](https://www.socialfetch.dev/llms-tiktok.txt) — per-platform endpoint files generated from OpenAPI (parameters, credits, curls).
- [`/agents.txt`](https://www.socialfetch.dev/agents.txt) — agent crawl/onboarding file with capabilities, auth rules, and allowlist.
- [`/llms.json`](https://www.socialfetch.dev/llms.json) — structured machine-readable operation inventory with parameter names, pagination, outcomes, credits, and SDK mapping.
- [API reference hub](https://www.socialfetch.dev/docs/api.mdx) — human-friendly index of operations with links into generated pages.
- [Errors](https://www.socialfetch.dev/docs/errors.mdx) — shared error envelope and HTTP status guidance.
- [Credits](https://www.socialfetch.dev/docs/credits.mdx) — metering, `402`, and planning batch jobs.
- Outcome semantics such as `found`, `not_found`, and `private` are documented in [Errors](https://www.socialfetch.dev/docs/errors.mdx) and on operation pages when present in the OpenAPI contract.

## Markdown docs convention

- Every docs page has a markdown twin: append **`.mdx`** to the docs pathname (for example `/docs/quickstart` → `/docs/quickstart.mdx`).
- Agents that send `Accept: text/markdown` on `/docs/**` HTML URLs may receive markdown directly (same URL, `Vary: Accept`).
- Published blog posts use the same convention: `/blog/{slug}` → `/blog/{slug}.mdx`, or `Accept: text/markdown` on the HTML URL (`Vary: Accept`).

---
# Instagram API reference (https://www.socialfetch.dev/docs/api/v2/instagram)

Social Fetch's Instagram tag is a set of `GET /v2/instagram/...` routes. Pass a handle, profile URL, user id, shortcode, media URL, hashtag, location id or audio id and get `{ data, meta }` with `data.lookupStatus`, `meta.requestId`, `meta.creditsCharged`, and `meta.version: "v2"`. Authenticate with `x-api-key` only — no Meta app review, business account, or page token.

These pages are generated from the public OpenAPI spec. Product overview, examples, and FAQs live on the [Instagram platform hub](/platforms/instagram).

  Most Instagram routes are **1 credit** per completed lookup, and paginated calls bill **each page**, including a last page that comes back empty. Exceptions: the engagement audit is **5** for an audited profile and **1** for a private or missing one; the profile route adds **1 per `include`** (`recentMedia`, `about`) it serves; and `GET /v2/instagram/media/{media}?include=files` adds **10** (**11** in total) when the files are hosted. Trust `meta.creditsCharged`.

## Identifiers

Each v2 route takes the identifier named in its path, and a bad one is a `400` before anything is billed.

| You have                                     | Pass it as                                | Notes                                                                                                                |
| -------------------------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `instagram.com/nike`                         | `{profile}` = `nike`, `@nike`, or the URL | Handle with or without `@`, or a profile URL                                                                         |
| A user id from an earlier response           | `{profile}` = `13460080`                  | Digits alone are read as a user id                                                                                   |
| `instagram.com/p/DePzV26vLFB/`               | `{media}` = `DePzV26vLFB` or the URL      | Shortcode, post, Reel or TV URL, or the numeric media id                                                             |
| A comment `id` from the comments list        | `{commentId}` = `17858893269036513`       | Digits only; read it from `GET /v2/instagram/media/{media}/comments`                                                 |
| `instagram.com/stories/highlights/17921…/`   | `{highlightId}` = `17921…` or the URL     | Find ids with `GET /v2/instagram/profiles/{profile}/highlights`                                                      |
| `instagram.com/explore/tags/nike/`           | `{hashtag}` = `nike`, `#nike`, or the URL | Any letter case. Spaces and punctuation are a `400`. Find tags with `GET /v2/instagram/hashtags/search`              |
| `instagram.com/explore/locations/213385402/` | `{locationId}` = `213385402` or the URL   | Digits (up to 19), or a location URL. Find ids with `GET /v2/instagram/locations/search`, or `location.id` on a post |
| `instagram.com/reels/audio/1234567890/`      | `{audioId}` = `1234567890`                | Digits (up to 19). Find ids with `GET /v2/instagram/audio/search`, or `audio.id` on a Reel                           |
| `instagram.com/popular/harry-potter/`        | `{topic}` = `harry%20potter` or the URL   | A word or phrase, or the topic's Popular page link                                                                   |
| `instagram.com/share/…`                      | not accepted                              | Open the link and pass the post URL it opens                                                                         |

Post and Reel links are not profiles, and profile links are not media; the error says what to send instead. A story link (`instagram.com/stories/{handle}/…`) works as a profile. `/v2/instagram/profiles/search`, `/v2/instagram/hashtags/search`, `/v2/instagram/locations/search` and `/v2/instagram/audio/search` are search routes, so the account whose handle is `search` is reached as `/v2/instagram/profiles/@search` and the tag named `search` as `/v2/instagram/hashtags/%23search`.

## Pagination

List routes return `data.page` with `nextCursor`, `hasMore` and `returnedCount`. Pass `data.page.nextCursor` back as `cursor` while `data.page.hasMore` is `true`. Cursors are opaque and tied to the route (and the `tab`, `sort`, `query`, post or other identifier) that issued them; a cursor from somewhere else is a `400 bad_request`. A list can end on an empty page (`hasMore` was `true`, and nothing more came back): like any served page, it costs 1 credit. Query parameters are passed once: `include=recentMedia,about`, not `include=recentMedia&include=about`.

## Profiles

- [Instagram profile](/docs/api/v2/instagram/profiles/profile/get) — `GET /v2/instagram/profiles/{profile}` — one profile by handle, URL or user id; `include` adds recent media and About details.

- [Profile media](/docs/api/v2/instagram/profiles/profile/media/get) — `GET /v2/instagram/profiles/{profile}/media` — posts, Reels or tagged posts, cursor-paged.

- [Profile stories](/docs/api/v2/instagram/profiles/profile/stories/get) — `GET /v2/instagram/profiles/{profile}/stories` — live stories from the last 24 hours.

- [Profile highlights](/docs/api/v2/instagram/profiles/profile/highlights/get) — `GET /v2/instagram/profiles/{profile}/highlights` — saved highlight albums.

- [Highlight](/docs/api/v2/instagram/highlights/highlightid/get) — `GET /v2/instagram/highlights/{highlightId}` — the stories inside one highlight.

- [Following](/docs/api/v2/instagram/profiles/profile/following/get) — `GET /v2/instagram/profiles/{profile}/following` — accounts a profile follows, cursor-paged.

- [Engagement audit](/docs/api/v2/instagram/profiles/profile/engagement/get) — `GET /v2/instagram/profiles/{profile}/engagement` — engagement rate of recent posts (5 credits for an audited profile, 1 for a private or missing one).

## Media, comments and transcripts

- [Post or Reel](/docs/api/v2/instagram/media/media/get) — `GET /v2/instagram/media/{media}` — one post or Reel by shortcode, URL or media id; `include=files` hosts the original files (+10 credits, 11 in total).

- [Comments](/docs/api/v2/instagram/media/media/comments/get) — `GET /v2/instagram/media/{media}/comments` — a post or Reel's top-level comments, `top` or `newest` first, cursor-paged.

- [Comment replies](/docs/api/v2/instagram/media/media/comments/commentid/replies/get) — `GET /v2/instagram/media/{media}/comments/{commentId}/replies` — the replies in one comment thread, oldest first, cursor-paged.

- [Transcript](/docs/api/v2/instagram/media/media/transcript/get) — `GET /v2/instagram/media/{media}/transcript` — what is said in a post or Reel video, with its length in seconds.

## Hashtags

- [Hashtag](/docs/api/v2/instagram/hashtags/hashtag/get) — `GET /v2/instagram/hashtags/{hashtag}` — a hashtag's id, post count and trending flag, by name or tag link.

- [Hashtag media](/docs/api/v2/instagram/hashtags/hashtag/media/get) — `GET /v2/instagram/hashtags/{hashtag}/media` — the live `top`, `recent` or `reels` feed under a hashtag, cursor-paged.

- [Search hashtags](/docs/api/v2/instagram/hashtags/search/get) — `GET /v2/instagram/hashtags/search` — find hashtags by keyword, with their post counts.

## Locations

- [Location](/docs/api/v2/instagram/locations/locationid/get) — `GET /v2/instagram/locations/{locationId}` — a place's name, coordinates and category.

- [Location media](/docs/api/v2/instagram/locations/locationid/media/get) — `GET /v2/instagram/locations/{locationId}/media` — posts and Reels tagged at a place, top or recent, cursor-paged.

- [Search locations](/docs/api/v2/instagram/locations/search/get) — `GET /v2/instagram/locations/search` — find places by name; each result's `id` is a location id.

## Audio

- [Audio](/docs/api/v2/instagram/audio/audioid/get) — `GET /v2/instagram/audio/{audioId}` — a song or original sound: title, artist, length and exact Reel count.

- [Audio media](/docs/api/v2/instagram/audio/audioid/media/get) — `GET /v2/instagram/audio/{audioId}/media` — the Reels that use an audio, cursor-paged.

- [Search audio](/docs/api/v2/instagram/audio/search/get) — `GET /v2/instagram/audio/search` — find songs and original sounds by keyword; each result's `id` is an audio id. An id can occasionally resolve to `not_found`: then try the result's `assetId`.

## Search and discovery

The hashtag, location and audio searches are listed with their groups above. The other search routes, Popular topics and trending Reels:

- [Search Reels](/docs/api/v2/instagram/reels/search/get) — `GET /v2/instagram/reels/search` — keyword Reel discovery as media objects, cursor-paged.

- [Search profiles](/docs/api/v2/instagram/profiles/search/get) — `GET /v2/instagram/profiles/search` — find accounts by keyword, cursor-paged. The account named `search` is `@search`.

- [Topic](/docs/api/v2/instagram/topics/topic/get) — `GET /v2/instagram/topics/{topic}` — Instagram's Popular page for a topic: its details and the posts it curates, cursor-paged.

- [Trending Reels](/docs/api/v2/instagram/reels/trending/get) — `GET /v2/instagram/reels/trending` — a fresh batch of the Reels Instagram is trending right now. No parameters; call it again for another batch.

## Related

* [Instagram platform hub](/platforms/instagram) — coverage, FAQs, and credit notes
* [How to scrape Instagram data](/guides/how-to-scrape-instagram-data)
* [API reference](/docs/api) — all platforms