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

# Instagram

> Scrape public Instagram profiles, posts and reels as structured data, for 1 credit per page.

Instagram pages are read with a purpose-built **site rule** instead of a browser. You don't turn anything on: send an Instagram URL as usual and the rule is used automatically. A page costs 1 credit, and pages that can't be delivered are free.

Spidra reads Instagram the way a visitor who isn't signed in sees it. It never signs in, and it doesn't use cookies you pass for Instagram pages.

The rule steps aside when a request needs something only a browser can do: a screenshot, browser `actions`, `forEach` or an AI `instruction`. Those URLs use the normal browser flow.

## Page types

| Page type | Example | What you get |
| - | - | - |
| Profile | `instagram.com/nasa/` | The profile and its 12 latest posts |
| Post | `instagram.com/p/DeewiSPpCrm/` | The post with its counts, media and first comments |
| Reel or IGTV video | `instagram.com/reel/DeewiSPpCrm/`, `instagram.com/tv/...` | The same as a post |

Links work as you copy them, including share links with `?igsh=` and post links that have the username in front (`instagram.com/nasa/p/...`).

## Fields you get

Every field is optional on Instagram's side, so a missing value comes back as `null` or an empty list, never a guess.

| Page | Fields |
| - | - |
| Profile | `id`, `username`, `fullName`, `biography`, `isVerified`, `isPrivate`, `followers`, `following`, `posts`, `pronouns`, `bioLinks`, `profilePicture`, `hasReels`, `recentPosts` (each with `code`, `type`, `caption`, `image`, `description`, `url`) |
| Post, reel or video | `code`, `id`, `mediaType`, `caption`, `hashtags`, `mentions`, `likes`, `comments`, `takenAt`, `owner`, `location`, `image`, `video`, `width`, `height`, `carousel`, `taggedUsers`, `coauthors`, `music`, `description`, `topComments` |

A few notes on coverage:

* `recentPosts` holds the 12 posts Instagram shows on the profile. Instagram shows older posts only to signed-in members, so to read a specific older post, send its link.
* `topComments` holds the comments Instagram includes with the post, usually about 10. The full comment thread needs a signed-in member.
* `music` appears on reels that use a track. `carousel` lists each image or video of a multi-image post.
* Instagram doesn't show business email addresses, phone numbers or categories to visitors who aren't signed in, so profiles don't include them.

## What comes back

* **`output: "json"` with no `prompt` or `schema`:** the structured data as is. No AI is used, so the cost is the base credit only.
* **`output: "markdown"`:** the whole page as markdown, followed by the structured data.
* **With a `prompt` or `schema`:** the AI reads a compact copy of the structured data instead of the whole page. A profile with a four-field schema cost 3 credits in testing.

## Limits you should know about

* **Signed-in pages are refused.** Followers and following lists, stories, search, explore and messages need a signed-in member. Those requests fail straight away with a message and are not charged.
* **Private accounts** keep their posts for followers, so `recentPosts` comes back empty for them.
* **A profile Instagram won't show** fails with a message and is not charged. Instagram answers a missing account and a restricted one the same way, so the message can't say which it was.
* **A deleted post** fails with a message and is not charged.

<Note>
  Check Instagram's terms and the data protection laws that apply to you before you scrape it. Profiles contain personal data, which laws such as GDPR protect even when it is public. You are responsible for how you use the data you collect. Spidra is not affiliated with Instagram or Meta.
</Note>


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