Instagram 用户内容 API
某个账号发过的帖子,按 username 一次取回,带 text、media_type、like_count 和 comment_count;异步返回 job_id,每千次 $0.56。
- 一次最多 200 条
- 返回
job_id再取结果 - 失败和空结果不收费
接口健康状态
- 24h 健康值
- 79%
- 24h 平均耗时
- 41.29 s
- 健康 / 正常
- 可用
- 少量可用
- 基本不可用
24 小时趋势
30 天趋势
1请求
POST /api/v1/social { "platform": "instagram", "action": "user_posts", "params": { "username": "nasa" } }2JSON 响应
{ "results": [ { "author_id": "", "post_id": "De2t82PPyx9", "text": "We are not slowing down. 🚀\n\nOur #Artemis III mission will send four astronauts to low Earth orbit next year to test critical systems needed for future lunar landings and we’re accelerating efforts to ensure the success of Artemis IV, the first Artemis mission on the lunar surface…", "media_type": "image" }, … ], "count": 30 }3表格行
author_id post_id text media_type De2t82PPyx9 We are not slowing down. 🚀 Our #Artemis III mission will send four astronauts to low Earth orbit next year to test critical systems needed for future lunar landings and we’re accelerating efforts to ensure the success of Artemis IV, the first Artemis mission on the lunar surface… image De1wbZ6l2Vy This disc is 50,000 light-years wide! It's the Sombrero Galaxy — seen here by our orbiting @••• telescope. Its unique appearance could be the result of a long-ago merger with other galaxies. #NASA #Space #Galaxy image 4CSV
instagram-user_posts-sample.csv post_id,url,text,media_type,like_count,comment_count,view_count,author_username,author_name,posted_at,location,id,image_url,video_url,author_id,width,height,is_comments_disabled,author_follower_count,hashtags,top_comments
username 和可选的 limit,先回 202 和 job_id;轮询 jobs 接口取回帖子行,再变成表格行和 CSV。能拿到什么数据
表里是一次真实调用的结果:目标 nasa,2026年10月25日 02:28(UTC)采集,返回 30 条;灰条是隐去的个人信息(CSV 里是 •••)。你自己调用时,先拿到 job_id,任务完成后按字段表取回这些字段。
| post_id | url | text | media_type | like_count | comment_count | view_count | author_username | author_name | posted_at | location | id | image_url | video_url | author_id | width | height | is_comments_disabled | author_follower_count | hashtags | top_comments |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| De2t82PPyx9 | https://www.instagram.com/p/De2t82PPyx9/ | We are not slowing down. 🚀 Our #Artemis III mission will send four astronauts to low Earth orbit next year to test critical systems needed for future lunar landings and we’re accelerating efforts to ensure the success of Artemis IV, the first Artemis mission on the lunar surface… | image | 46089 | 364 | null | nasa | NASA | 2026-10-23T23:20:57+00:00 | null | 4014598211346836605_528817151 | https://instagram.fuba2-1.fna.fbcdn.net/v/t51.82787-15/859070372_18661402093049152_3071139610491516778_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=1&ig_cache_key=NDAxNDU5ODIxMTM0NjgzNjYwNTE4NjYxNDAyMDg3MDQ5MTUy.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjcyMC5… | https://instagram.fuba2-1.fna.fbcdn.net/o1/v/t2/f2/m86/AQNTkECBw2suz97dudN4wjd5tp7fZgWYJZB6PwTVUGMQU9r4E08_w4KcBLpaInhz4kASzQbv8D4AqHGg8nn8IWBidZ5OR5QfmdqpvN0.mp4?_nc_cat=102&_nc_oc=Adq5bLzGCWm2kVZWdS8bGQwb60nMRQoz0Yl-AbZ3EdrSsTV4Mt8qEBWTMMUiwkNKBeQ&_nc_sid=5e9851&_nc_ht=instagra… | 1080 | 1920 | null | null | null | null | |
| De1wbZ6l2Vy | https://www.instagram.com/p/De1wbZ6l2Vy/ | This disc is 50,000 light-years wide! It's the Sombrero Galaxy — seen here by our orbiting @••• telescope. Its unique appearance could be the result of a long-ago merger with other galaxies. #NASA #Space #Galaxy | image | 693209 | 2199 | null | nasa | NASA | 2026-10-23T14:19:41+00:00 | null | 4014327632355616114_528817151 | https://instagram.fuba2-1.fna.fbcdn.net/v/t51.82787-15/862320651_18661289491049152_6188246238745863140_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=1&ig_cache_key=NDAxNDMyNzU3MzgyODI5NTU0MQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTQ0MC5zZHI… | null | 1440 | 1440 | null | null | null | null |
用途
内容节奏分析
取一个账号最近的帖子,用
posted_at和media_type看发布频率与形式。互动对比
用
like_count和comment_count比较同一账号不同帖子的表现。话题归类
统计
hashtags数组里出现的话题标签,看账号常用哪些主题。竞品动态
定期取竞品账号的帖子,读
text和location,看它们新发了什么。
Instagram Graph API 与 EveryInfra 对比
下面从能读哪些账号、条数和访问条件三方面比 Instagram 官方 Graph API 和 EveryInfra user_posts。
| 对比项 | Instagram Graph API | EveryInfra |
|---|---|---|
| 能读哪些账号 | Business Discovery:"Since you can make nested requests by specifying an edge via the fields parameter, you can request the targeted professional account’s media edge to get all of its published media objects." | username 填不带 @ 的账号 handle,或完整主页链接。 |
| 条数 | "Returns a maximum of 10K of the most recently created media." | limit 取 1 到 200,默认 30,不保证返回账号的全部历史。 |
| 访问条件 | "Note that a permission only allows access to data created by the app user who granted the permission." | 一把 EveryInfra API Key 放在 Authorization: Bearer 请求头里,不用登录 Instagram,也不用 Instagram 访问令牌。 |
引文出自 Meta 开发者文档,2026-11-09 核对。 官方出处: Business Discovery (更新于 2026-08-12) · IG User Media (更新于 2026-09-28) · Instagram Platform overview (更新于 2026-10-29)
限制和注意事项
- 调用默认异步:返回 202 和
job_id,再用GET https://api.everyinfra.com/api/v1/jobs/<job_id>轮询,任务完成后取到帖子行。 limit是 1 到 200 的整数,默认 30;超出范围返回 422,不扣费。- 没有翻页参数,一次调用最多 200 条,可能少于
limit,也不保证返回账号的全部历史。 - 私密 Stories 和内部触达数据不在返回里。
hashtags、top_comments没有内容时整个字段不出现;like_count、view_count为null表示不公开,不等于 0。
价格
每次调用 $0.000556,按次不按条,一次最多读 200 条;异步任务也一样,失败和空结果不收费。
| 调用次数 | 费用 |
|---|---|
| 10,000 | $5.56 |
| 100,000 | $55.56 |
| 1,000,000 | $555.56 |
合计按每次调用的标价算。
代码示例
#curl -X POST 'https://api.everyinfra.com/api/v1/social' \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"platform": "instagram",
"action": "user_posts",
"params": {
"username": "nasa"
}
}'OpenAPI 定义 (JSON)示例从环境变量 EVERYINFRA_API_KEY 读取 Key,复制出去的代码不含你的 Key。
API 参考
下面是 user_posts 的参数、响应字段、错误和计费,可以复制整页,或用 Markdown 打开给 AI 助手。
AI 提示词
#请帮我用 EveryInfra 的「Instagram 用户内容」接口(instagram/user_posts)写一个数据采集脚本。
接口约定:
- 请求:POST https://api.everyinfra.com/api/v1/social,请求头 Authorization: Bearer <API Key>;Key 从环境变量 EVERYINFRA_API_KEY 读取,不要写进代码。
- 请求体里 platform 填 instagram,action 填 user_posts,参数放在 params 里。
- 必填参数:
- username:Instagram 账号 handle,建议不带 @ 或完整主页 URL。profile/persona/user_posts/reels 查询账号数据。
- 可选参数:
- limit:这次调用最多返回的条数,整数,1–200;不传按默认值,实际返回可能少于这个数。超过上限会在扣费前返回 422。(默认 30)
- 返回一组记录,每条记录的主要字段:post_id(帖子 ID)、url、text、media_type(媒体类型(图/视频/轮播))、like_count、comment_count、view_count、author_username、author_name、posted_at、location、id;一共 21 个字段,完整列表见 https://api.everyinfra.com/api/v1/social/catalog?platform=instagram。
- 示例请求体:
{
"platform": "instagram",
"action": "user_posts",
"params": {
"username": "nasa"
}
}
- 计费:$0.56 / 千次;失败和空结果不扣费。
- 这个接口默认异步:先返回 202 和 job_id,再轮询 GET https://api.everyinfra.com/api/v1/jobs/{job_id},直到 status 为 succeeded 或 failed。
- 返回 422 时,按错误信息里的候选参数和允许值修正;返回 429 或 503 时,按 Retry-After 等待后重试。
写代码前,先问清楚我要采哪些对象、一共多少个、需要哪些字段、结果存成什么格式,再把方案和大概花费讲给我确认。请求参数
#| 参数名 | 位置 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|---|
Authorization | header | string | 是 | - | Bearer 加你的 API Key。在控制台创建;不要放进网址或代码仓库。 |
platform | body | string | 是 | instagram | 平台标识,固定值。 |
action | body | string | 是 | user_posts | 能力标识,固定值。 |
username | body.params | string | 是 | - | Instagram 账号 handle,建议不带 @ 或完整主页 URL。profile/persona/user_posts/reels 查询账号数据;followers 只查粉丝数量,followers_list/following_list 才查粉丝/关注账号列表。 |
limit | body.params | integer (1–200) | 否 | 30 | 这次调用最多返回的条数,整数,1–200;不传按默认值,实际返回可能少于这个数。超过上限会在扣费前返回 422。 |
响应示例
#{ "id": "req_…", "platform": "instagram", "action": "user_posts", "results": [ { "post_id": "De2t82PPyx9", "url": "https://www.instagram.com/p/De2t82PPyx9/", "text": "We are not slowing down. 🚀\n\nOur #Artemis III mission will send four astronauts to low Earth orbit next year to test critical systems needed for future lunar landings and we’re accelerating efforts to ensure the success of Artemis IV, the first Artemis mission on the lunar surface…", "media_type": "image", "like_count": 46089, "comment_count": 364, "author_username": "nasa", "author_name": "NASA", "posted_at": "2026-10-23T23:20:57+00:00", "id": "4014598211346836605_528817151", "image_url": "https://instagram.fuba2-1.fna.fbcdn.net/v/t51.82787-15/859070372_18661402093049152_3071139610491516778_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=1&ig_cache_key=NDAxNDU5ODIxMTM0NjgzNjYwNTE4NjYxNDAyMDg3MDQ5MTUy.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjcyMC5…", "video_url": "https://instagram.fuba2-1.fna.fbcdn.net/o1/v/t2/f2/m86/AQNTkECBw2suz97dudN4wjd5tp7fZgWYJZB6PwTVUGMQU9r4E08_w4KcBLpaInhz4kASzQbv8D4AqHGg8nn8IWBidZ5OR5QfmdqpvN0.mp4?_nc_cat=102&_nc_oc=Adq5bLzGCWm2kVZWdS8bGQwb60nMRQoz0Yl-AbZ3EdrSsTV4Mt8qEBWTMMUiwkNKBeQ&_nc_sid=5e9851&_nc_ht=instagra…", "author_id": "•••", "width": 1080, "height": 1920 }, { "post_id": "De1wbZ6l2Vy", "url": "https://www.instagram.com/p/De1wbZ6l2Vy/", "text": "This disc is 50,000 light-years wide!\n\nIt's the Sombrero Galaxy — seen here by our orbiting @••• telescope. Its unique appearance could be the result of a long-ago merger with other galaxies.\n\n#NASA #Space #Galaxy", "media_type": "image", "like_count": 693209, "comment_count": 2199, "author_username": "nasa", "author_name": "NASA", "posted_at": "2026-10-23T14:19:41+00:00", "id": "4014327632355616114_528817151", "image_url": "https://instagram.fuba2-1.fna.fbcdn.net/v/t51.82787-15/862320651_18661289491049152_6188246238745863140_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=1&ig_cache_key=NDAxNDMyNzU3MzgyODI5NTU0MQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTQ0MC5zZHI…", "author_id": "•••", "width": 1440, "height": 1440 } ], "count": 30, "billing": { "charged": …, "charged_usd": …, "balance_after_usd": …, … }, "quota": { … }}
返回字段
#业务数据在 results 里;下表是每条记录可能包含的字段,平台没有提供的值不会被编造。
| 字段 | 含义 |
|---|---|
post_id | 帖子 ID。 |
url | 该记录在原平台上的可访问链接。 |
text | 正文内容,已去除 HTML 标签,全文返回、不截断(个别平台的列表结果本身只有摘要,以该平台的字段说明为准)。 |
media_type | 媒体类型(图/视频/轮播)。 |
like_count | 点赞数。null 表示该平台或该接口不公开此数据,不等于 0。 |
comment_count | 评论数。null 表示不公开,不等于 0。 |
view_count | 浏览/播放数。null 表示不公开,不等于 0。 |
author_username | 作者用户名(@handle),通常可用于拼 URL。 |
author_name | 作者昵称(显示名)。 |
posted_at | 发布时间,ISO 8601 格式、UTC 时区(如 2026-08-07T12:34:56+00:00)。平台只给非标准字符串时原样透传,解析前建议做容错。null 表示平台未公开。 |
location | 地理位置描述,原文透传,格式随平台而异。 |
id | 该记录在原平台上的唯一标识。仅在同一平台内唯一,跨平台可能重复。 |
image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
video_url | 保留平台原语义 |
author_id | 作者在原平台的唯一 ID。 |
width | 保留平台原语义 |
height | 保留平台原语义 |
is_comments_disabled | 帖子是否关闭评论。 |
author_follower_count | 作者粉丝数。null 表示不公开。 |
hashtags | 正文里的话题标签数组,按出现顺序;没有时不出现这个字段。 |
top_comments | 帖子下展示的几条评论,每项含正文(text)和评论人(author_username);没有时不出现这个字段。 |
错误与计费
#- 401
- 缺少 Key 或 Key 无效。
- 402
- 余额不足,先充值。
- 422
- 参数名或取值不对,按错误信息给的候选改;不扣费。
- 429
- 超过每分钟请求上限,按 Retry-After 等待后再试。
- 503
- 暂时无法完成,预扣的费用退回;结果未知时先核对,不要直接重发。
- 200 空结果
- 没有数据,不扣费。
常见问题
Instagram 用户帖子 API 返回什么?
返回账号的帖子:post_id、url、text、media_type、like_count、comment_count,有就带 hashtags。调用先回 202 和 job_id,再轮询 jobs 接口取结果。
一次最多取多少条,怎么翻页?
limit 取 1 到 200,默认 30,一次最多 200 条,也可能更少,不保证返回账号的全部历史。没有翻页参数。
取帖子要花多少钱?
每千次调用 $0.56,每次 $0.000556,按次不按条,异步任务也一样。失败和空结果不收费。
取账号的帖子要登录 Instagram 吗?
不用。请求头里放一把 EveryInfra API Key(Authorization: Bearer),不需要 Instagram 登录,也不需要 Instagram 访问令牌。
user_posts 和 reels 有什么区别?
用户内容(user_posts)取账号的帖子,是异步任务;Reels 短视频(reels)只取该账号的 Reels,带 play_count 和 duration_sec,同步返回。
相关的 Instagram 能力
同一把 Key 还能调 Instagram 的其他能力,比如这个账号的 Reels 或被标记的帖子。
- 单条内容
post每千次 $0.56单条内容:返回列表,默认 11 条、单次最多 11 条;主要字段 post_id、url、text、media_type、like_count、comment_count。 - 主页或对象详情
profile每千次 $0.56主页或对象详情:返回单个对象;主要字段 username、display_name、bio、follower_count、following_count、post_count。 - 账号画像
persona每千次 $0.56账号画像:返回单个对象;主要字段 username、display_name、bio、follower_count、following_count、post_count。 - 内容发现
discover每千次 $0.56内容发现:返回列表,默认 30 条、单次最多 200 条;主要字段 post_id、url、text、media_type、like_count、comment_count。 - 评论
comments每千次 $0.79评论:返回列表,默认 50 条、单次最多 100 条;主要字段 id、text、url、like_count、reply_count、author_username。 - Reels 短视频
reels每千次 $1.19Reels 短视频:返回列表,默认 30 条、单次最多 100 条;主要字段 post_id、url、text、media_type、like_count、comment_count。 - 话题内容
hashtag每千次 $0.56话题内容:返回列表,默认 30 条、单次最多 100 条;主要字段 post_id、url、text、media_type、like_count、comment_count。 - 粉丝数量
followers每千次 $0.56粉丝数量:返回单个对象;主要字段 id、username、url、name、avatar_url、follower_count。 - 粉丝列表
followers_list每千次 $0.56粉丝列表:返回列表,默认 50 条、单次最多 500 条;主要字段 id、username、url、name、avatar_url、is_private。 - 关注列表
following_list每千次 $0.56关注列表:返回列表,默认 50 条、单次最多 500 条;主要字段 id、username、url、name、avatar_url、is_private。 - 账号搜索
user_search每千次 $4.81账号搜索:返回列表,默认 20 条、单次最多 30 条;主要字段 rank、username、user_id、display_name、is_verified、is_private。 - Reels 关键词搜索
reels_search每千次 $7.19Reels 关键词搜索:返回列表,默认 20 条、单次最多 200 条;主要字段 post_id、id、url、text、play_count、like_count。 - 相似账号
similar_profiles每千次 $8.81相似账号:返回列表,默认 20 条、单次最多 30 条;主要字段 rank、username、user_id、display_name、is_verified、is_private。 - 被标记的帖子
tagged_posts每千次 $7.44被标记的帖子:返回列表,默认 20 条、单次最多 200 条;主要字段 post_id、url、tagged_username、author_username、author_id、text。 - Stories 内容
stories每千次 $1.5Stories 内容:返回列表,默认 100 条、单次最多 100 条(传更大的数按 100 条返回);主要字段 id、url、media_url、media_type、duration_seconds、duration_sec。 - 精选合集
highlights每千次 $1.6精选合集:返回列表,默认 100 条、单次最多 100 条(传更大的数按 100 条返回);主要字段 id、url、title、media_count、cover_url、created_at。 - 评论回复
comment_replies每千次 $0.88评论回复:返回列表,每次一页、每页最多 10 条,条数不固定(短页不代表到底),要更多就把响应顶层的 next_page_token 作为 page_token 再调,没有 next_page_token 才是到底;limit 照收但不起作用;主要字段 id、text、like_count、posted_at、author_username、author_id。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。