Read Instagram profiles, post and reel feeds, tagged posts, active stories, single-post detail, comments and replies, follower and following lists, and search users and hashtags. 12 endpoints, 2-10 credits each.
---
name: scavio-instagram
description: Read Instagram profiles, post and reel feeds, tagged posts, active stories, single-post detail, comments and replies, follower and following lists, and search users and hashtags. 12 endpoints, 2-10 credits each.
version: 1.0.0
tags: instagram, social-media, creator-data, influencer-research, profiles, reels, stories, comments, followers, hashtags, competitor-research, agents, langchain, crewai, autogen, structured-data, json, ai-agents, rag, research
metadata:
openclaw:
requires:
env:
- SCAVIO_API_KEY
primaryEnv: SCAVIO_API_KEY
timeout: 120
throttle: 1
emoji: "\U0001F4F8"
homepage: https://scavio.dev/docs/instagram-api
---
# Instagram via Scavio
Read public Instagram data as JSON: profiles, timeline posts, reels, tagged posts, active stories, single-post detail, comment threads, follower and following lists, and user/hashtag search.
## When to trigger
Use this skill when the user asks to:
- Look up an Instagram profile: follower count, bio, verified status, account type
- Pull a creator's recent posts, reels, or the posts they were tagged in
- Read a specific post: caption, media URLs, like and comment counts
- Mine the comments on a post, or the replies under one comment
- List who follows an account, or who it follows
- Find accounts or hashtags by keyword
- Do influencer vetting, competitor tracking, or creator-discovery research on Instagram
For TikTok creators use `scavio-tiktok`. For TikTok Shop products use `scavio-tiktok-shop`.
## Three things to read before you call anything
**1. Instagram is the most expensive family in the API. Budget before you loop.** Costs are per-endpoint and range 2 to 10 credits, unlike Google or Reddit where everything is 1. A profile lookup is **10 credits** — ten times a Google search. On the free plan's 50 one-time credits that is five calls. The full table is below; read it before writing any loop. The cheap endpoint is `/user/posts` at **2 credits** — prefer it, and reach for the 10-credit endpoints only when you genuinely need what they carry.
**2. There is no single post identifier that works everywhere.** The three post endpoints take three different, non-overlapping identity sets:
| Endpoint | Accepts | Does NOT accept |
|---|---|---|
| `/post` | `url`, `media_id`, or `shortcode` | -- |
| `/post/comments` | `shortcode` or `url` | `media_id` |
| `/post/comments/replies` | `media_id` + `comment_id` | `shortcode`, `url` |
So you cannot chain `/post/comments` straight into `/post/comments/replies` — comments are addressed by shortcode, replies by `media_id`. To get replies, call `/instagram/post` first to resolve the `media_id`, then pass it with the `comment_id` from the comments call. That chain costs 8 + 10 + 8 = 26 credits; make sure the user actually wants it.
**3. The response is a raw upstream passthrough, not a normalized Scavio shape.** Unlike Reddit, YouTube or LinkedIn, Instagram responses are handed back exactly as the provider returned them. Two consequences:
- **Field names are Instagram's, not friendly ones.** On a post, the video URL is at `video_versions[].url` — there is **no** `video_url`. The cover image is at `image_versions2.candidates[]` — there is **no** `thumbnail_url`. `media_type` is the integer `1` (image), `2` (video), or `8` (carousel).
- **The top-level keys inside `data` can vary between calls on the same endpoint**, because two upstream versions are raced and either may win. Always probe defensively: check for `items` and for `data`, take whichever is present, and never assume a key exists.
Do not invent friendlier field names when reporting results, and do not claim a field is missing until you have checked the raw keys actually returned.
## Setup
Get a free API key at [scavio.dev](https://scavio.dev/?utm_source=clawhub&utm_medium=skill&utm_campaign=scavio-instagram) (50 one-time credits to get started, no card required):
```bash
export SCAVIO_API_KEY=sk_live_your_key
```
Every request is a `POST` with a JSON body and:
```
Authorization: Bearer $SCAVIO_API_KEY
```
## Endpoints
Base URL: `https://api.scavio.dev`. All paths are under `/api/v1/instagram`.
| Endpoint | Credits | Description |
|---|---|---|
| `POST /api/v1/instagram/user/posts` | **2** | Timeline posts for a user. The cheap one -- start here |
| `POST /api/v1/instagram/post` | **8** | Full detail for one post |
| `POST /api/v1/instagram/post/comments/replies` | **8** | Replies under one comment |
| `POST /api/v1/instagram/profile` | **10** | Profile: bio, counts, verified, account type |
| `POST /api/v1/instagram/user/reels` | **10** | A user's reels |
| `POST /api/v1/instagram/user/tagged` | **10** | Posts a user was tagged in |
| `POST /api/v1/instagram/user/stories` | **10** | Currently active stories |
| `POST /api/v1/instagram/post/comments` | **10** | Top-level comments on a post |
| `POST /api/v1/instagram/user/followers` | **10** | Who follows this account |
| `POST /api/v1/instagram/user/followings` | **10** | Who this account follows |
| `POST /api/v1/instagram/search/users` | **10** | Find accounts by keyword |
| `POST /api/v1/instagram/search/hashtags` | **10** | Find hashtags by keyword |
The 8-vs-10 split is not arbitrary: the 10-credit endpoints race two upstream providers for reliability and are billed for both legs; the 8-credit ones have only a single provider. Nothing here is 1 credit.
## Workflow
1. **Start from a username.** Every user endpoint accepts `username` (without the `@`). You do not need to resolve an id first, unlike TikTok.
2. **Prefer `user_id` once you have it.** Every response that includes a profile carries `pk` / `id` — that is the `user_id`. When both are sent, `user_id` wins and is more stable than a username, which can be changed by its owner.
3. **Cheapest useful path:** `/user/posts` (2 credits) already carries captions, media, like and comment counts for recent posts. For "what is this creator posting about", that single call is often the whole answer.
4. **Add `/profile` (10) only when you need follower counts**, bio text, verified status, or account type. Do not call it reflexively before a feed call.
5. **Paginate with `cursor`.** Pass the continuation token from the previous response back as `cursor`. Names of the continuation field vary by endpoint and by which upstream leg won -- look for `next_max_id`, `pagination_token`, `next_min_id`, or `rank_token` and pass whichever is present. Stop when none is present or `has_more` / `more_available` is false.
6. **Raise `count` instead of making more calls.** Each call costs the same regardless of page size, so a single `count: 50` is five times cheaper than five `count: 10` calls.
## Parameters
### Identity: `username` vs `user_id`
Nine endpoints take a user identity. Both fields are optional individually but **at least one is required**; omitting both is a 400. `user_id` takes precedence when both are sent. `user_id` is a **string**, even though it looks like a number.
### Profile (`/profile`), Stories (`/user/stories`)
| Parameter | Type | Default | Description |
|---|---|---|---|
| `username` | string | -- | Instagram handle without `@` |
| `user_id` | string | -- | Numeric id as a string. Wins over `username` |
No `count`, no `cursor`. Stories are not paginated -- you get whatever is currently live, and an account with no active stories returns an empty set, which is a normal result and not an error.
`/profile` returns the profile object **inlined at the root of `data`** -- there is no `data.user` wrapper. Read `data.follower_count`, not `data.user.follower_count`.
### User posts (`/user/posts`), reels (`/user/reels`), tagged (`/user/tagged`)
| Parameter | Type | Default | Description |
|---|---|---|---|
| `username` | string | -- | Handle without `@` |
| `user_id` | string | -- | Wins over `username` |
| `count` | number | `12` | Items per page, 1-50 |
| `cursor` | string | -- | Continuation token from the previous response |
Note on `/user/posts`: `count` is honored only when the newer upstream leg answers, and the older leg is the primary one here. Treat `count` as a request, not a guarantee, and read how many items you actually got rather than assuming.
Also on `/user/posts`: when you pass **only** `user_id`, the items may arrive **double-nested at `data.data`** rather than `data.items`. Probe both.
### Followers (`/user/followers`), followings (`/user/followings`)
| Parameter | Type | Default | Description |
|---|---|---|---|
| `username` | string | -- | Handle without `@` |
| `user_id` | string | -- | Wins over `username` |
| `count` | number | `12` | Users per page, 1-**100** (the highest cap in the family) |
| `cursor` | string | -- | Continuation token |
The path is `followings`, plural. Follower lists on large accounts are effectively bottomless -- Instagram will not hand over millions of rows, and each page is 10 credits. Set an explicit page budget with the user before starting, and stop when the continuation token stops coming back.
### Post detail (`/post`)
| Parameter | Type | Default | Description |
|---|---|---|---|
| `url` | string | -- | Full post URL, e.g. `https://www.instagram.com/p/DUajw4YkorV/` |
| `media_id` | string | -- | Numeric media id as a string. **Highest precedence** |
| `shortcode` | string | -- | The code from the URL, e.g. `DUajw4YkorV` |
One of the three is required. `media_id` wins over everything; `shortcode` is expanded into a URL internally.
The post is at `data.items[0]`. Within it: `media_type` `1`/`2`/`8`, video at `video_versions[].url`, cover at `image_versions2.candidates[]`. For a carousel (`media_type: 8`) the children are nested inside the item -- walk them rather than expecting one media URL.
### Post comments (`/post/comments`)
| Parameter | Type | Default | Description |
|---|---|---|---|
| `shortcode` | string | -- | The code from the post URL |
| `url` | string | -- | Full post URL |
| `cursor` | string | -- | Continuation token |
| `sort_order` | string | `popular` | `popular` or `newest` |
One of `shortcode` / `url` is required. **`media_id` is not accepted here** even though the sibling endpoints take it.
Two cautions. First, `sort_order` is honored only when the newer upstream leg answers; if the older leg wins, your sort is silently ignored. Do not present comment ordering to the user as guaranteed. Second, **pass a canonical post URL or a bare shortcode only.** A `/share/` link, a profile URL, or any URL that is not of the form `instagram.com/p/<code>`, `/reel/<code>`, `/reels/<code>` or `/tv/<code>` currently fails as a **500**, not a clean 400. Extract the shortcode yourself and send that instead.
### Comment replies (`/post/comments/replies`)
| Parameter | Type | Default | Description |
|---|---|---|---|
| `media_id` | string | required | The post's numeric media id, as a string |
| `comment_id` | string | required | From a comment in the `/post/comments` response |
| `cursor` | string | -- | Continuation token |
Both ids are required. `/post/comments` does not return `media_id`, so resolve it with `/instagram/post` first. See caution 2 at the top.
### Search users (`/search/users`), search hashtags (`/search/hashtags`)
| Parameter | Type | Default | Description |
|---|---|---|---|
| `keyword` | string | required | Search term, 1-500 chars |
| `cursor` | string | -- | Rank token from a previous response |
The field is `keyword`, not `query` or `search`. There is **no `count`** -- page size is not controllable. Pagination is best-effort: if the older upstream leg answers, the cursor is ignored and you get page 1 again. Detect this by comparing the returned ids to what you already have rather than assuming forward progress.
## Errors
| Status | Meaning | What to do |
|---|---|---|
| 400 | Invalid body. The `details` array names the offending field | Fix and resend. Usually a missing identity field |
| 401 | Bad or missing API key | Check `SCAVIO_API_KEY` |
| 402 | Out of credits | Stop. Tell the user, do not retry |
| 429 | Too many requests in flight at once | Wait for one to finish, then retry. Not a cooldown |
| 500 | Unparseable post URL on `/post/comments` | Send a bare shortcode instead |
| 502 | Upstream Instagram data temporarily unavailable | Retry once after a short delay, then give up |
A 402 or 429 means stop, not retry harder. Report the condition to the user rather than burning the remaining balance.
## Credits and spend discipline
Every successful response carries `credits_used` and `credits_remaining` next to `data`. Read `credits_remaining` as you go. To check the balance without spending anything, call `GET /api/v1/usage` (0 credits, no body).
Concurrency is capped per plan -- 1 simultaneous request on free and pay-as-you-go, up to 50 on Growth. Exceeding it returns 429 immediately. Do not fan out parallel Instagram calls unless you know the plan allows it.
Before any multi-call workflow, state the credit cost to the user. "Scanning this account's 500 followers is 10 credits per page of up to 100, so about 50 credits" is the kind of thing to say **before** starting, not after.
## Example
```bash
# 1. Recent posts for a creator -- 2 credits, usually enough on its own
curl -X POST 'https://api.scavio.dev/api/v1/instagram/user/posts' \
-H "Authorization: Bearer $SCAVIO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"username": "instagram", "count": 24}'
# 2. Follower count and bio -- 10 credits, only when actually needed
curl -X POST 'https://api.scavio.dev/api/v1/instagram/profile' \
-H "Authorization: Bearer $SCAVIO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"username": "instagram"}'
# 3. One post in full -- 8 credits
curl -X POST 'https://api.scavio.dev/api/v1/instagram/post' \
-H "Authorization: Bearer $SCAVIO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"shortcode": "DUajw4YkorV"}'
```
## Related skills
- `scavio-tiktok` -- TikTok creator profiles, videos, comments, hashtags
- `scavio-tiktok-shop` -- TikTok Shop products, prices, reviews
- `scavio-x` -- X (Twitter) posts, users, timelines, trends
- `scavio-linkedin` -- LinkedIn people, companies, jobs, posts
- `scavio-youtube` -- YouTube search, videos, channels, transcripts
don't have the plugin yet? install it then click "run inline in claude" again.
restructured into implexa's six components, made pagination and error handling explicit, documented all three post identifier quirks in decision points, added edge cases (timeouts, auth expiry, rate limits, empty results), preserved raw field naming requirements, and kept credit cost discipline throughout.
Query public Instagram data as JSON: profiles, timeline posts, reels, tagged posts, active stories, single-post detail, comment threads, follower and following lists, and user/hashtag search. Use this skill when the user needs creator research, influencer vetting, competitor tracking, or discovery work on Instagram. Each endpoint costs 2 to 10 credits per call. Start with /user/posts (2 credits) for feed data; add profile, stories, comments, or follower endpoints only when you need what they carry. Do not call reflexively. For TikTok use scavio-tiktok; for TikTok Shop use scavio-tiktok-shop.
Required environment variable:
SCAVIO_API_KEY (string): Bearer token from scavio.dev. Free plan grants 50 one-time credits, no card required. Set via export SCAVIO_API_KEY=sk_live_your_key.External connection:
https://api.scavio.dev/api/v1/instagram (all endpoints POST). Requires Bearer auth header and JSON body.Rate limits and concurrency:
/api/v1/usage (GET, 0 credits) to check remaining balance without spending.Credit costs (per successful call):
/user/posts/post, /post/comments/replies/profile, /user/reels, /user/tagged, /user/stories, /post/comments, /user/followers, /user/followings, /search/users, /search/hashtagsKnown edge cases:
/post/comments not in form instagram.com/p/<code>, /reel/<code>, /reels/<code>, or /tv/<code>: returns 500. Send bare shortcode instead.Critical field naming gotcha:
Instagram responses are raw upstream passthroughs, not normalized. Field names are Instagram's, not friendly ones. Video URL is at video_versions[].url (no video_url key). Cover image is at image_versions2.candidates[] (no thumbnail_url). media_type is integer 1 (image), 2 (video), or 8 (carousel). Top-level keys inside data can vary by call, even on the same endpoint. Always probe defensively: check for both items and data, take whichever is present, never assume a key exists. Do not invent friendly field names in results.
Post identifier quirk: Three post endpoints accept three non-overlapping identity sets. See decision points below.
Determine the user's intent. Ask: Do they need profile stats (followers, verification, bio)? Feed data (recent posts, reels, tagged)? Story status? Comment threads? Follower/following lists? Search? Write down the credit cost before proceeding.
Resolve identity. Accept username (without @) or user_id (numeric string). Username is always acceptable; user_id is more stable if you already have it from a prior call. If the user gives you a profile URL, extract the handle. If they give you a shortcode or post URL, extract that separately; do not confuse post identity with user identity.
Choose the cheapest endpoint that answers the question. /user/posts (2 credits) includes captions, media, like and comment counts for recent posts. For "what is this creator posting about", that single call often closes the loop. Call /profile (10 credits) only if you need follower counts, bio text, verified status, or account type.
Construct the request body. Required fields depend on endpoint (see decision points). Always include Authorization: Bearer $SCAVIO_API_KEY header and Content-Type: application/json.
Execute the POST request. If successful (2xx), the response body contains data (endpoint-specific), credits_used, and credits_remaining. If not, see error handling below.
Parse the response defensively. For user feeds, check data.items first, then data.data (only /user/posts with user_id returns double-nested). For profile, read keys directly at data (no wrapper). For comments and replies, walk the array. For stories, expect an empty array if no active stories (normal, not an error).
Handle pagination. If the response includes a continuation token field (next_max_id, pagination_token, next_min_id, or rank_token), save it. On the next call, pass it as cursor. Stop when no token is present or has_more / more_available is false. For /search/users and /search/hashtags, pagination is best-effort; the older upstream leg may ignore the cursor and return page 1 again. Detect re-fetching by comparing returned ids.
Check remaining credits before looping. Read credits_remaining from each response. If it is zero or near your page budget, stop early. Do not burn the balance on low-confidence calls.
Report results to the user. Show the raw data structure (do not rename fields). State the credit cost incurred and the remaining balance. If the user wants more data, confirm the per-page cost before continuing.
On error, map the status code and take action. See decision points and error handling below.
If the user asks for recent posts/reels/tagged content and you have no other context:
Call /user/posts (2 credits) first. If they then ask "is this account verified?" or "how many followers?", call /profile (10 credits). Do not call /profile reflexively.
If the user asks for story status:
Call /user/stories (10 credits). If the response is an empty array, the account has no active stories right now. This is a normal result, not an error.
If the user asks for follower or following lists:
Call /user/followers or /user/followings (10 credits each). On large accounts, pagination is endless. Before looping, ask the user: "How many pages do you want? Each page is 10 credits and up to 100 users per page." Do not exceed the user's budget without asking.
If the user wants post detail (full caption, media URLs, counts):
You have three ways to identify the post. Accept url (full post URL), media_id (numeric string), or shortcode (code from URL). Call /post (8 credits). If the response is media_type: 8 (carousel), walk the nested children array for all media, not just the first item.
If the user wants comments on a post:
Use /post/comments (10 credits) with shortcode or url. Do not pass media_id; it is rejected here. If the user gives you a /share/ link or a non-standard URL, extract the shortcode and send that. On a 500, resend with bare shortcode. After getting comments, if the user then asks "what do people reply to this comment?", you must call /post/comments/replies (8 credits) with media_id and comment_id. To get media_id, call /post (8 credits) first. The full chain is /post (8) + /post/comments (10) + /post/comments/replies (8) = 26 credits. Warn the user before starting.
If the user wants to find accounts or hashtags by keyword:
Call /search/users or /search/hashtags (10 credits each) with keyword. Pagination is best-effort; you may get page 1 again if the older upstream leg wins. Detect by comparing ids, not by trusting the cursor.
If the response includes data.data (double-nesting):
This happens only on /user/posts when you pass user_id without username. Treat it the same as data.items. Your code should check for both.
If sort_order is passed to /post/comments:
The newer upstream leg honors it; the older leg ignores it. Do not present comment ordering to the user as guaranteed.
If pagination token names vary:
Instagram response fields are upstream passthroughs and may vary. After each call, check the response for next_max_id, pagination_token, next_min_id, or rank_token. Pass whichever is present back as cursor on the next call.
If the request returns 400 (invalid body):
The details array names the offending field. Usually a missing required field like username or user_id. Fix and resend.
If the request returns 401 (auth failed):
Check that SCAVIO_API_KEY is set and correct. It should start with sk_live_. Ask the user to get a fresh key from scavio.dev.
If the request returns 402 (out of credits): Stop immediately. Do not retry. Tell the user: "Out of credits. You have $X remaining." Do not attempt more calls in this session.
If the request returns 429 (concurrency): You have exceeded the plan's simultaneous request cap. Wait for one in-flight request to finish, then retry. This is not a cooldown; it is an immediate block on too many parallel calls.
If the request returns 500 on /post/comments:
The post URL is not in standard form. Extract the shortcode and resend the request with shortcode instead of url.
If the request returns 502 (upstream temporary failure): Instagram's data is temporarily unavailable. Retry once after a short delay (2-5 seconds). If it returns 502 again, give up and tell the user: "Instagram is not responding right now. Try again in a few minutes."
If the request times out (no response after 120 seconds): Retry once. If it times out again, assume the endpoint is slow or upstream is down. Stop and report to the user.
Successful response (2xx):
{ "data": <endpoint-specific>, "credits_used": <integer>, "credits_remaining": <integer> }data structure varies by endpoint; see below.credits_remaining is a non-negative integer. Zero means no more calls are possible.Profile (/profile):
data is a single profile object (not wrapped in items or data). Keys include username, follower_count, following_count, biography, is_verified, account_type, profile_pic_url, pk (the user_id), and others.User posts/reels/tagged (/user/posts, /user/reels, /user/tagged):
data.items is an array of post objects. If response is double-nested (data.data), walk that instead.id, media_type (1/2/8), caption, like_count, comment_count, timestamp, user (object with username, pk), and media arrays.video_versions[].url. Cover: image_versions2.candidates[].url. Carousel: walk nested carousel_media[] array.next_max_id or similar; pass as cursor on next call.Stories (/user/stories):
data is typically an empty array if no active stories (normal result). If present, contains story objects with id, media_type, video_versions, image_versions2, timestamp, etc.Post detail (/post):
data.items[0] is the post object (same structure as /user/posts). Walk carousel children if media_type: 8.Post comments (/post/comments):
data.comments or data.items (varies by upstream leg): array of comment objects. Each has id, text, user (object with username, pk), created_at_utc, comment_like_count, and others.next_max_id, next_min_id, or pagination_token; pass as cursor.Comment replies (/post/comments/replies):
data is typically an empty array if the comment has no replies (normal). If present, array of reply objects (same structure as top-level comments).next_max_id or similar; pass as cursor.Followers/followings (/user/followers, /user/followings):
data.users or data.items: array of user objects. Each has username, full_name, pk (user_id), profile_pic_url, is_verified, and others.next_max_id or similar; pass as cursor.Search users/hashtags (/search/users, /search/hashtags):
/search/users: data.users is an array of user objects (same as followers list)./search/hashtags: data.hashtags is an array of hashtag objects with name, id, search_result_subtitle, etc.rank_token; pass as cursor. Best-effort only.Error responses (4xx/5xx):
error field identify the problem (e.g., { "error": "invalid_api_key", "details": [...] }).credits_remaining may be omitted on auth failures (401/402).User knows the skill worked when:
Profile lookup: You return follower count, bio text, verification status, and account type in a clear format. Example: "instagram has 636M followers, verified business account, bio: 'Bringing you closer to the people and things you love.'"
Feed pull: You return a numbered list of recent posts/reels with caption, media type (image/video/carousel), like and comment counts, and timestamp. Example: "[1] (video) 2.5M likes, 45K comments, posted 2 hours ago: 'Check out this feature...'"
Post detail: You return the full post with caption text, media URLs (direct links to video_versions or image_versions2), engagement counts, and comments section link if requested.
Comment thread: You return top-level comments sorted by your requested order, with usernames, comment text, like counts, and timestamps. If the user asks for replies to one comment, you return those nested.
Follower/following list: You return a paginated list with usernames, full names, verification status, and user id. You state the page size and total available.
Search results: You return matching accounts or hashtags with metadata (follower counts for accounts, follower counts for hashtags).
Stories: You return "no active stories" or a list of story ids with media type and timestamp.
Credit disclosure: Every response includes the cost incurred and remaining balance. Example: "used 10 credits, 40 remaining."
No data fabrication: You report raw field names and structures as returned by the API. You do not rename video_versions to video_url or claim a field is missing until you have checked the raw keys.
Error clarity: On 401, 402, 429, 500, or 502, you report the specific status and do not retry beyond policy. On 400, you report the field that failed validation.