instagram-api

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Instagram API

Instagram API

Instagram data on demand: profile lookup by @handle, posts, reels, stories, tagged posts, followers and followings, hashtag and location feeds, audio/music feeds, and post comments — one plain HTTP GET per call, paid as you go. No login, no session cookies, no headless browser, no Graph API business verification.
Base URL:
https://instagram.fetcher.sh
按需获取Instagram数据:通过@handle查询个人资料、帖子、Reels、快拍、标记帖子、粉丝与关注列表、话题标签和地点动态、音频/音乐动态,以及帖子评论——每次调用只需一个简单的HTTP GET请求,按需付费。无需登录、无需会话Cookie、无需无头浏览器、无需Graph API企业验证。
基础URL:
https://instagram.fetcher.sh

Quick reference

快速参考

Base URL
https://instagram.fetcher.sh
Auth
Authorization: Bearer bby_live_...
or x402 (USDC)
Price$0.004/call (flat)
Endpoints16, all
GET
MCP
https://instagram.fetcher.sh/mcp
Machine-readable
/openapi.json
·
/llms.txt
·
/skill.md
基础URL
https://instagram.fetcher.sh
认证方式
Authorization: Bearer bby_live_...
或 x402(USDC)
价格每次调用0.004美元(统一费率)
端点数量16个,均为
GET
请求
MCP地址
https://instagram.fetcher.sh/mcp
机器可读资源
/openapi.json
·
/llms.txt
·
/skill.md

Which endpoint do I need?

如何选择合适的端点?

I want to...Call
Look up a profile by @handle
GET /api/user/handle/{handle}
Search accounts by name
GET /api/user/search
Get a user's posts, reels, or stories
GET /api/user/{id}/posts
/
/reels
/
/stories
Get a user's followers or followings
GET /api/user/{id}/followers
/
/followings
Look up a post by its share-URL shortcode
GET /api/post/code/{code}
Get a post's comments
GET /api/post/{id}/comments
Find posts under a hashtag
GET /api/hashtag/{name}/posts
Find posts tagged at a location
GET /api/location/{id}/posts
Full param details for every row:
references/endpoints.md
.
我想要...调用方式
通过@handle查询个人资料
GET /api/user/handle/{handle}
按名称搜索账号
GET /api/user/search
获取用户的帖子、Reels或快拍
GET /api/user/{id}/posts
/
/reels
/
/stories
获取用户的粉丝或关注列表
GET /api/user/{id}/followers
/
/followings
通过分享URL的短代码查询帖子
GET /api/post/code/{code}
获取帖子的评论
GET /api/post/{id}/comments
查找话题标签下的帖子
GET /api/hashtag/{name}/posts
查找标记了指定地点的帖子
GET /api/location/{id}/posts
每一行的完整参数详情:
references/endpoints.md

Authentication

认证方式

Two ways to pay, same data — full mechanics in the
fetcher
skill
:
bash
undefined
两种付费方式,获取的数据一致——完整机制见
fetcher
技能
bash
undefined

1. Prepaid credits (recommended — get a key at https://fetcher.sh/topup

1. 预付费额度(推荐——在https://fetcher.sh/topup获取密钥

or via POST /api/credits/topup, see the fetcher skill)

或通过POST /api/credits/topup,详见fetcher技能)

export FETCHER_API_KEY="bby_live_xxxxxxxxxxxx" curl -H "Authorization: Bearer $FETCHER_API_KEY"
"https://instagram.fetcher.sh/api/user/handle/nasa"
export FETCHER_API_KEY="bby_live_xxxxxxxxxxxx" curl -H "Authorization: Bearer $FETCHER_API_KEY"
"https://instagram.fetcher.sh/api/user/handle/nasa"

2. x402 pay-per-call — omit the header; a GET with no payment returns 402

2. x402按调用付费——省略请求头;未付费的GET请求会返回402状态码

with machine-readable payment requirements (USDC on Base, Polygon,

并附带机器可读的支付要求(在Base、Polygon、Arbitrum、Monad或Solana链上使用USDC)。@x402/fetch会自动签名并重试请求。

Arbitrum, Monad, or Solana). @x402/fetch signs and retries automatically.


Every response is `{ "status": number, "message": string, "data": ... }`; the
HTTP status mirrors `status`.

每个响应格式均为`{ "status": number, "message": string, "data": ... }`;HTTP状态码与`status`字段值一致。

Endpoints (16 — all GET, $0.004/call)

端点(16个——均为GET请求,每次调用0.004美元)

EndpointWhat it returns
/api/user/handle/{handle}
Full profile by @handle — follower counts, bio, numeric ID
/api/user/search
Profiles matching a keyword query
/api/userid/{handle}
Just the numeric user ID for a @handle
/api/user/{id}
Profile by numeric ID
/api/user/{id}/posts
A user's posts
/api/user/{id}/posts/tagged
Posts the user is tagged in
/api/user/{id}/reels
A user's reels
/api/user/{id}/stories
A user's active stories
/api/user/{id}/followers
A user's followers
/api/user/{id}/followings
Accounts a user follows
/api/post/code/{code}
A single post by its shortcode (from the post URL)
/api/post/{id}/comments
A post's comments
/api/hashtag/{name}/posts
Posts under a hashtag
/api/hashtag/{name}/reels
Reels under a hashtag
/api/location/{id}/posts
Posts tagged at a location
/api/audio/{id}/posts
Posts using a specific audio/music track
{id}
/
{handle}
/
{name}
/
{code}
are path parameters. Optional
cursor
/
page
paginate;
query
(user search) is required where it appears.
端点返回内容
/api/user/handle/{handle}
通过@handle获取完整个人资料——粉丝数、简介、数字ID
/api/user/search
匹配关键词查询的个人资料
/api/userid/{handle}
仅返回@handle对应的用户数字ID
/api/user/{id}
通过数字ID获取个人资料
/api/user/{id}/posts
用户的帖子
/api/user/{id}/posts/tagged
用户被标记的帖子
/api/user/{id}/reels
用户的Reels
/api/user/{id}/stories
用户的当前快拍
/api/user/{id}/followers
用户的粉丝
/api/user/{id}/followings
用户关注的账号
/api/post/code/{code}
通过短代码获取单个帖子(来自帖子URL)
/api/post/{id}/comments
帖子的评论
/api/hashtag/{name}/posts
话题标签下的帖子
/api/hashtag/{name}/reels
话题标签下的Reels
/api/location/{id}/posts
标记了指定地点的帖子
/api/audio/{id}/posts
使用特定音频/音乐曲目的帖子
{id}
/
{handle}
/
{name}
/
{code}
为路径参数。可选参数
cursor
/
page
用于分页;
query
(用户搜索)在对应场景下为必填参数。

Scenarios

使用场景

Resolve a profile by handle — the endpoint most callers want first:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/handle/nasa"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/handle/natgeo"
Search for profiles by keyword, or resolve just the numeric ID for a handle:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "query=fitness influencer" -G \
  "https://instagram.fetcher.sh/api/user/search"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/userid/nasa"
A profile's posts, reels, stories, and tagged posts (by numeric ID from the handle lookup above):
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/reels"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/stories"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/posts/tagged"
Followers and followings:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/followers"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/followings"
A single post by shortcode (the part of the URL after
/p/
), and its comments:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/post/code/C0JD3tntcmy"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/post/3245142029192513970/comments"
Posts and reels under a hashtag, posts from a location, and posts using an audio track:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/hashtag/travel/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/hashtag/travel/reels"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/location/213131048/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/audio/271328201351336/posts"
通过handle解析个人资料——大多数调用者首先需要的端点:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/handle/nasa"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/handle/natgeo"
按关键词搜索个人资料,或仅解析handle对应的数字ID:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "query=fitness influencer" -G \
  "https://instagram.fetcher.sh/api/user/search"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/userid/nasa"
个人资料的帖子、Reels、快拍和标记帖子(使用上述handle查询得到的数字ID):
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/reels"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/stories"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/posts/tagged"
粉丝与关注列表:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/followers"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/user/528817151/followings"
通过短代码获取单个帖子(URL中
/p/
后的部分)及其评论:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/post/code/C0JD3tntcmy"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/post/3245142029192513970/comments"
话题标签下的帖子和Reels、指定地点的帖子、使用特定音频曲目的帖子:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/hashtag/travel/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/hashtag/travel/reels"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/location/213131048/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://instagram.fetcher.sh/api/audio/271328201351336/posts"

MCP

MCP

json
{
  "mcpServers": {
    "instagram": {
      "url": "https://instagram.fetcher.sh/mcp",
      "headers": { "Authorization": "Bearer bby_live_..." }
    }
  }
}
Free:
search_endpoints
,
describe_endpoint
,
check_balance
. Paid:
fetch_data
(any endpoint above),
topup_credits
, plus the named shortcut
instagram_user_handle
. Drop the
headers
block to pay per call with x402 instead — see the
fetcher
skill
for the full flow.
json
{
  "mcpServers": {
    "instagram": {
      "url": "https://instagram.fetcher.sh/mcp",
      "headers": { "Authorization": "Bearer bby_live_..." }
    }
  }
}
免费功能:
search_endpoints
,
describe_endpoint
,
check_balance
。付费功能:
fetch_data
(上述任意端点)、
topup_credits
,以及命名快捷方式
instagram_user_handle
。移除
headers
块即可改用x402按调用付费——完整流程见
fetcher
技能

Errors

错误说明

  • 400
    — missing/invalid parameter (message names it)
  • 401
    — unknown or rotated key
  • 402
    — payment required (x402 challenge) or
    topup_required
    (credits exhausted)
  • 404
    — not a priced path
  • No rate limits; no refunds on upstream failures (settlement precedes delivery)
  • 400
    —— 参数缺失/无效(消息会指明具体参数)
  • 401
    —— 密钥未知或已过期
  • 402
    —— 需要支付(x402验证)或
    topup_required
    (额度耗尽)
  • 404
    —— 路径未定价
  • 无速率限制;上游故障不退款(结算优先于交付)

Reference

参考资源