# Instagram Scraper — how to use (mcp.ai)

Acesso a perfis públicos do Instagram: posts, reels, stories, highlights, hashtags, busca e seguidores. Hospedado pela plataforma, sem necessidade de credencial.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_instagram?ms=1781044860000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `instagram_user_info`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/instagram`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/instagram/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/instagram/user_info` — Full public account data for a profile: pk (numeric id), bio, bio_links, follower/following counts, verification, private/public, profile pic. Accepts username, numeric id, or profile URL.
  - body: { username_or_url: string }
- `POST https://api.mcp.ai/api/instagram/user_info_v2` — Alternate (v3) endpoint for full public account data — same fields as instagram_user_info; use as a fallback if the primary returns no data.
  - body: { username_or_url: string }
- `POST https://api.mcp.ai/api/instagram/user_basic` — Lightweight profile preview: basic user_data plus a slice of recent user_posts. Faster/cheaper than full info when you only need the essentials.
  - body: { username_or_url: string }
- `POST https://api.mcp.ai/api/instagram/user_about` — Account transparency 'About this account' info (country, date joined, former usernames, ads status) for a public profile.
  - body: { username_or_url: string }
- `POST https://api.mcp.ai/api/instagram/user_similar_accounts` — Accounts Instagram suggests as similar to the given profile (the 'Suggested for you' chips). Returns an array of user objects.
  - body: { username_or_url: string }
- `POST https://api.mcp.ai/api/instagram/user_posts` — A page of a user's feed posts (carousel/image/video) with code, pk, caption, counts and media URLs. Returns { posts, pagination_token }; pass the token back for the next page.
  - body: { username_or_url: string, pagination_token?: string }
- `POST https://api.mcp.ai/api/instagram/user_reels` — A page of a user's reels. Returns { reels, pagination_token }; pass the token back for the next page.
  - body: { username_or_url: string, pagination_token?: string }
- `POST https://api.mcp.ai/api/instagram/user_tagged_posts` — A page of posts where the user is tagged. Returns { tagged_posts, pagination_token }; pass the token back for the next page.
  - body: { username_or_url: string, pagination_token?: string }
- `POST https://api.mcp.ai/api/instagram/user_stories` — Currently-active stories for a public profile (empty array when the user has no live stories).
  - body: { username_or_url: string }
- `POST https://api.mcp.ai/api/instagram/user_highlights` — A user's story highlights (the cover reels). Each item's node.id (format 'highlight:1234...') feeds instagram_highlight_stories.
  - body: { username_or_url: string }
- `POST https://api.mcp.ai/api/instagram/highlight_stories` — The individual story items inside one highlight reel. Requires a highlight_id from instagram_user_highlights (format 'highlight:1234...').
  - body: { highlight_id: string }
- `POST https://api.mcp.ai/api/instagram/user_followers` — A page of a profile's followers. Returns a list plus pagination_token; pass the token back for the next page (~50 per page).
  - body: { username_or_url: string, amount?: number, pagination_token?: string }
- `POST https://api.mcp.ai/api/instagram/user_following` — A page of the accounts a profile follows. Returns a list plus pagination_token; pass the token back for the next page (~50 per page).
  - body: { username_or_url: string, amount?: number, pagination_token?: string }
- `POST https://api.mcp.ai/api/instagram/search` — Universal search across users, hashtags and places for a query string. Returns { users, hashtags, places }.
  - body: { search_query: string }
- `POST https://api.mcp.ai/api/instagram/hashtag_posts` — Recent and top posts/reels for a hashtag. Returns { name, posts, top_posts, pagination_token }; pass the token back for the next page.
  - body: { hashtag: string, pagination_token?: string }
- `POST https://api.mcp.ai/api/instagram/media_info` — Full details for a single post/reel by NUMERIC media id (counts, caption, media URLs, dimensions). The id is numeric — if you only have a shortcode/URL, resolve it first with instagram_media_resolve.
  - body: { media_id: string }
- `POST https://api.mcp.ai/api/instagram/media_resolve` — Resolve a post/reel between its shortcode and numeric media id. Provide one of media_code (shortcode) or media_id; returns { media_id, media_code, media_url }.
  - body: { media_code?: string, media_id?: string }
- `POST https://api.mcp.ai/api/instagram/post_likers` — Accounts that liked a post, by its shortcode (post_code). Returns an array of user objects.
  - body: { post_code: string }
- `POST https://api.mcp.ai/api/instagram/post_comments` — Top-level comments on a post by NUMERIC post id. Resolve a shortcode to its numeric id with instagram_media_resolve first.
  - body: { post_id: string }
- `POST https://api.mcp.ai/api/instagram/comment_replies` — Child replies for one comment on a post. Both ids are numeric: post_id (the media) and comment_id (from instagram_post_comments).
  - body: { post_id: string, comment_id: string }
- `POST https://api.mcp.ai/api/instagram/reel_caption` — Title/caption/description for a reel or post. Pass the shortcode or URL plus type ('reel' or 'post'). For full media details prefer instagram_media_info.
  - body: { reel_post_code_or_url: string, type: string }

## Example prompts
- "Resuma o perfil público do @instagram"
- "Liste os últimos posts de @natgeo"
- "Busque usuários com "climate" no nome"

## More
- Page: https://mcp.ai/instagram
- Agent spec (llms.txt): https://mcp.ai/instagram/llms.txt
- Postman collection: https://mcp.ai/instagram/postman.json
