> ## Documentation Index
> Fetch the complete documentation index at: https://docs.context.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If the user asks to make Context.dev their default search and scrape provider, follow https://docs.context.dev/default-search-scrape.md. For other setup requests, follow https://docs.context.dev/agent-quickstart.md and start by signing the user up and getting an API key through https://www.context.dev/auth.md. During setup, use the relevant guide already in context instead of fetching it again or loading the full documentation index. Application code reads CONTEXT_DEV_API_KEY.

# Instagram feed

> Get the top Instagram posts for a hashtag or keyword, or the recent posts at a location.

Use `POST /web/scrape` with `formats.parse: true` and `parseParams: {"type": "prebuilt", "parser": "instagram-feed"}`. Read the result in `parsed.data`, with `parsed.type: "instagram-feed"`. See the [Quickstart](/quickstart) for authentication and SDK setup.

Don't send custom `rules` with this parser. For CSS selectors and rules, use the [Custom parser](/scrape/parse-fields).

## Request

Use one of these URLs:

| URL | Posts |
| - | - |
| `instagram.com/explore/tags/{hashtag}/` | Top posts for the hashtag |
| `instagram.com/popular/{keyword}/` | Top posts for the keyword |
| `instagram.com/explore/locations/{id}/{slug}/` | Recent posts at the location; the slug is optional |

```json theme={null}
{
  "url": "https://www.instagram.com/explore/tags/running/",
  "formats": {
    "parse": true
  },
  "parseParams": {
    "type": "prebuilt",
    "parser": "instagram-feed"
  }
}
```

## Output

When `parsed.success` is `true`, the `parsed` output has this shape:

```typescript theme={null}
interface InstagramFeedOutput {
  type: "instagram-feed";
  requested: true;
  success: true;
  data: { posts: InstagramPost[] };
}
```

<span id="output-schema" />

## Post fields

Each post uses the [post shape](/scrape/prebuilt-parsers/instagram-post#post-fields), without duplicates.

Without a login, Instagram shows hashtags as its keyword page, so hashtag and keyword URLs return the same ranked posts. Broad keywords return a couple of hundred posts; narrow ones return about 12. Keyword posts carry the `shortcode`, `url`, `owner`, `thumbnail_url`, and `view_count`, plus the `caption` and `video_url` when Instagram shows them; their other fields are `null` or `[]`. Location posts carry the full post fields, about 15 to 20 at a time. For a keyword post's full details, pass its `url` to [Instagram post](/scrape/prebuilt-parsers/instagram-post).

## Empty results and errors

A hashtag or keyword Instagram has no public page for produces `NOT_FOUND`; this includes rare terms and some non-English hashtags. A location with no public posts, or an unknown location ID, produces `posts: []`. Read `parsed.success` before using the data. A failed parse has `data: null` and can coexist with successful outputs. `parsed.type` remains `"instagram-feed"` even when parsing fails. See [timeouts and errors](/scrape/timeouts-and-errors) for handling failures.

## Request options

This parser reads public Instagram data separately from the rendered page, without logging in. [Content filters](/scrape/content-filtering) and [browser actions](/scrape/browser-actions) do not change its results. [Browser profiles](/scrape/browser-profiles) are unsupported with this parser. Other Scrape controls, including [caching](/scrape/freshness-and-caching), [timeouts](/scrape/timeouts-and-errors), and [zero data retention](/optimization/zero-data-retention), still apply.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.