最后更新
更新日志/profiles/{username}/recent-posts5 credits per call最新帖子
公开主页的最新帖子(未登录时 Instagram 最多只显示最新 6 条):id、shortcode、url、类型、文案、话题标签、提及、点赞数、评论数、视频播放量、发布时间、封面图、视频文件及时长、尺寸、位置、发布者及其粉丝数,以及轮播帖中的每张图片/每个视频。同时返回该主页的帖子总数。账号不存在时报 not found 错误。
Authorization: Bearer <key> on every request.Parameters
Instagram username, with or without @
only posts of this kind: image, video or carousel (any kind when omitted)
order of the posts: recent (newest first), likes or comments (most first)
Response fields
usernamee.g."natgeo"posts_counte.g.32218counte.g.6posts
ide.g."4039253819871911016"shortcodee.g."DgOT_LDGtxo"urle.g."https://www.instagram.com/p/DgOT_LDGtxo/"typee.g."carousel"product_typecaptione.g."Eel reproduction was first photographed in the wild by National Geographic photographer @tonywu98, and he and his team have continued to document this secretive event by spending hundreds of hours submerged in the waters of Kagoshima. National Geographic’s Pictures of the Year 2026 includes these moray eels in the act of ejecting their gametes, a process that occurs in less than two seconds.\n\nNational Geographic photographers ventured to places far and wide to capture the year’s most fascinating images. Out of millions of photos, just 25 were selected as our Pictures of the Year. See them all at the link in bio."hashtagsmentionslike_counte.g.84983comment_counte.g.275view_counttaken_ate.g."2026-11-26T23:43:19.000Z"display_urle.g."https://scontent.cdninstagram.com/v/t51.82787-15/930382505_18723120067019133_7440139847351550069_n.jpg?stp=dst-jpg_e35_p1080x1080_sh2.08_tt6&_nc_cat=1&ig_cache_key=NDAzOTI1MjQ4NjY1MTkxOTQ4Mw%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjA0OC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=VogRwE_nH_4Q7kNvwEePunG&_nc_oc=Adp4QIYDL-KB5Jn5_rbWN0Ct0RhHqEmBHD_sZi88genX1GK9-jDUqGETvWiSm-ouPZw&_nc_zt=23&_nc_ht=scontent.cdninstagram.com&_nc_gid=Fdw29QrZDQfRLbdDQBmEPA&_nc_ss=79789&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQWqzC7PmJ5Fb9s2sKGvVw05nv5H01HQb-zRwwcj1_8DTA&oe=6B0F421D"video_urlvideo_durationwidthe.g.1080heighte.g.1350accessibility_captionis_paid_partnershipe.g.falselocationowner
ide.g."787132"usernamee.g."natgeo"is_verifiede.g.trueprofile_pic_urle.g."https://scontent.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwGpGgyW&_nc_oc=AdoSMy3X79OMsDhxuGaGueLvYRgHskmAnnMjOhIp964NrFIS5KIhjVsiNvzJcx_on5M&_nc_zt=24&_nc_ht=scontent.cdninstagram.com&_nc_gid=Fdw29QrZDQfRLbdDQBmEPA&_nc_ss=79789&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQWjvhxastkp47DrsN6I5eZUvvrxnymxJhyvmUrshCO-HQ&oe=6B0F1CEB"followers_counte.g.267196027media
ide.g."4039252486651919483"shortcodee.g."DgOTrxZADx7"typee.g."image"display_urle.g."https://scontent.cdninstagram.com/v/t51.82787-15/930382505_18723120067019133_7440139847351550069_n.jpg?stp=dst-jpg_e35_p1080x1080_sh2.08_tt6&_nc_cat=1&ig_cache_key=NDAzOTI1MjQ4NjY1MTkxOTQ4Mw%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjA0OC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=VogRwE_nH_4Q7kNvwEePunG&_nc_oc=Adp4QIYDL-KB5Jn5_rbWN0Ct0RhHqEmBHD_sZi88genX1GK9-jDUqGETvWiSm-ouPZw&_nc_zt=23&_nc_ht=scontent.cdninstagram.com&_nc_gid=Fdw29QrZDQfRLbdDQBmEPA&_nc_ss=79789&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQWqzC7PmJ5Fb9s2sKGvVw05nv5H01HQb-zRwwcj1_8DTA&oe=6B0F421D"video_urlwidthe.g.1080heighte.g.1350accessibility_captionpagination
counte.g.6has_moree.g.falsenext_cursorfetched_ate.g."2026-11-27T10:16:52.010Z"agee.g.0curl "https://api.maviapi.com/v1/sites/instagram/profiles/natgeo/recent-posts?sort=recent" \-H "Authorization: Bearer $MAVI_KEY"
{
"username": "natgeo",
"posts_count": 32218,
"count": 6,
"posts": [
{
"id": "4039253819871911016",
"shortcode": "DgOT_LDGtxo",
"url": "https://www.instagram.com/p/DgOT_LDGtxo/",
"type": "carousel",
"product_type": null,
"caption": "Eel reproduction was first photographed in the wild by National Geographic photographer @tonywu98, and he and his team have continued to document this secretive event by spending hundreds of hours submerged in the waters of Kagoshima. National Geographic’s Pictures of the Year 2026 includes these moray eels in the act of ejecting their gametes, a process that occurs in less than two seconds.\n\nNational Geographic photographers ventured to places far and wide to capture the year’s most fascinating images. Out of millions of photos, just 25 were selected as our Pictures of the Year. See them all at the link in bio.",
"hashtags": [
null
],
"mentions": [
"tonywu98"
],
"like_count": 84983,
"comment_count": 275,
"view_count": null,
"taken_at": "2026-11-26T23:43:19.000Z",
"display_url": "https://scontent.cdninstagram.com/v/t51.82787-15/930382505_18723120067019133_7440139847351550069_n.jpg?stp=dst-jpg_e35_p1080x1080_sh2.08_tt6&_nc_cat=1&ig_cache_key=NDAzOTI1MjQ4NjY1MTkxOTQ4Mw%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjA0OC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=VogRwE_nH_4Q7kNvwEePunG&_nc_oc=Adp4QIYDL-KB5Jn5_rbWN0Ct0RhHqEmBHD_sZi88genX1GK9-jDUqGETvWiSm-ouPZw&_nc_zt=23&_nc_ht=scontent.cdninstagram.com&_nc_gid=Fdw29QrZDQfRLbdDQBmEPA&_nc_ss=79789&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQWqzC7PmJ5Fb9s2sKGvVw05nv5H01HQb-zRwwcj1_8DTA&oe=6B0F421D",
"video_url": null,
"video_duration": null,
"width": 1080,
"height": 1350,
"accessibility_caption": null,
"is_paid_partnership": false,
"location": null,
"owner": {
"id": "787132",
"username": "natgeo",
"is_verified": true,
"profile_pic_url": "https://scontent.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwGpGgyW&_nc_oc=AdoSMy3X79OMsDhxuGaGueLvYRgHskmAnnMjOhIp964NrFIS5KIhjVsiNvzJcx_on5M&_nc_zt=24&_nc_ht=scontent.cdninstagram.com&_nc_gid=Fdw29QrZDQfRLbdDQBmEPA&_nc_ss=79789&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQWjvhxastkp47DrsN6I5eZUvvrxnymxJhyvmUrshCO-HQ&oe=6B0F1CEB",
"followers_count": 267196027
},
"media": [
{
"id": "4039252486651919483",
"shortcode": "DgOTrxZADx7",
"type": "image",
"display_url": "https://scontent.cdninstagram.com/v/t51.82787-15/930382505_18723120067019133_7440139847351550069_n.jpg?stp=dst-jpg_e35_p1080x1080_sh2.08_tt6&_nc_cat=1&ig_cache_key=NDAzOTI1MjQ4NjY1MTkxOTQ4Mw%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjA0OC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=VogRwE_nH_4Q7kNvwEePunG&_nc_oc=Adp4QIYDL-KB5Jn5_rbWN0Ct0RhHqEmBHD_sZi88genX1GK9-jDUqGETvWiSm-ouPZw&_nc_zt=23&_nc_ht=scontent.cdninstagram.com&_nc_gid=Fdw29QrZDQfRLbdDQBmEPA&_nc_ss=79789&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQWqzC7PmJ5Fb9s2sKGvVw05nv5H01HQb-zRwwcj1_8DTA&oe=6B0F421D",
"video_url": null,
"width": 1080,
"height": 1350,
"accessibility_caption": null
}
]
}
],
"pagination": {
"count": 6,
"has_more": false,
"next_cursor": null
},
"fetched_at": "2026-11-27T10:16:52.010Z",
"age": 0
}Get all the data, no code
Collect every page of GET /profiles/natgeo/recent-posts into a dataset, for one request or for a whole list of them, then download it as CSV or JSON. A page costs the same as one call of the endpoint; the download is free.
Use Instagram API from Claude, ChatGPT and your coding tools
Add this URL as a custom connector and sign in to maviapi. Nothing to install.
https://mcp.maviapi.com/mcpOr run it locally, with each endpoint of Instagram API as its own tool:
claude mcp add maviapi -e MAVIAPI_TOOLS=instagram -- npx -y '@maviapi/mcp'Import Instagram API into Postman and other tools
How to importPaste a link into Postman, Insomnia, an agent framework or a no-code tool to get every endpoint with its parameters and response fields. The link always serves the current endpoints, so importing it again picks up new ones.
- OpenAPI 3.1
https://api.maviapi.com/v1/apis/instagram/openapi.json - Postman
https://api.maviapi.com/v1/apis/instagram/postman.json
The Postman collection sends the shared demo key until you put your own key in its maviapi_key variable.
使用 Instagram API 进行开发
选择一个端点开始
- 最新帖子
GET /profiles/{username}/recent-posts公开主页的最新帖子(未登录时 Instagram 最多只显示最新 6 条):id、shortcode、url、类型、文案、话题标签、提及、点赞数、评论数、视频播放量、发布时间、封面图、视频文件及时长、尺寸、位置、发布者及其粉丝数,以及轮播帖中的每张图片/每个视频。同时返回该主页的帖子总数。账号不存在时报 not found 错误。
GET /profiles/{username}/recent-posts 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 username string / path 是 Instagram username, with or without @ type string / query 否 only posts of this kind: image, video or carousel (any kind when omitted) sort string / query 否 order of the posts: recent (newest first), likes or comments (most first) 可选值: recent, likes, comments. 响应字段 字段 类型 说明 username string posts_count integer count integer posts object[] posts[].id string posts[].shortcode string posts[].url string posts[].type string posts[].product_type null posts[].caption string posts[].hashtags string[] posts[].mentions string[] posts[].like_count integer posts[].comment_count integer posts[].view_count null posts[].taken_at string posts[].display_url string posts[].video_url null posts[].video_duration null posts[].width integer posts[].height integer posts[].accessibility_caption null posts[].is_paid_partnership boolean posts[].location null posts[].owner object posts[].owner.id string posts[].owner.username string posts[].owner.is_verified boolean posts[].owner.profile_pic_url string posts[].owner.followers_count integer posts[].media object[] posts[].media[].id string posts[].media[].shortcode string posts[].media[].type string posts[].media[].display_url string posts[].media[].video_url null posts[].media[].width integer posts[].media[].height integer posts[].media[].accessibility_caption null pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer - 动态
GET /feed将最多 5 个公开主页的最新帖子(每个最多 6 条)合并为一个动态,每条帖子包含文案、话题标签、提及、点赞数、评论数、视频播放量、时间、图片/视频及作者的粉丝数;另外每个主页对应一行概要(名称、粉丝数、认证状态、在动态中的帖子数)。找不到的主页会标记错误 "not_found"(私密或无法加载时为 "unavailable"),不会导致整个动态失败。
GET /feed 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 usernames string / query 否 comma-separated Instagram usernames, 1 to 5 (e.g. natgeo,nasa) sort string / query 否 order of the posts: recent (newest first), likes or comments (most first) 可选值: recent, likes, comments. type string / query 否 only posts of this kind: image, video or carousel (any kind when omitted) 响应字段 字段 类型 说明 sort string type null profiles object[] profiles[].username string profiles[].full_name string profiles[].followers_count integer profiles[].is_verified boolean profiles[].posts integer profiles[].error null count integer posts object[] posts[].id string posts[].shortcode string posts[].url string posts[].type string posts[].product_type null posts[].caption string posts[].hashtags string[] posts[].mentions string[] posts[].like_count integer posts[].comment_count integer posts[].view_count null posts[].taken_at string posts[].display_url string posts[].video_url null posts[].video_duration null posts[].width integer posts[].height integer posts[].accessibility_caption null posts[].is_paid_partnership boolean posts[].location null posts[].owner object posts[].owner.id string posts[].owner.username string posts[].owner.is_verified boolean posts[].owner.profile_pic_url string posts[].owner.followers_count integer posts[].media object[] posts[].media[].id string posts[].media[].shortcode string posts[].media[].type string posts[].media[].display_url string posts[].media[].video_url null posts[].media[].width integer posts[].media[].height integer posts[].media[].accessibility_caption null fetched_at string age integer - 主页
GET /profiles/{username}公开的 Instagram 主页:id、名称、认证状态、粉丝数和帖子数、头像、是否有正在进行的快拍、人称代词,以及最新 6 条帖子(类型、点赞数、评论数、时间、封面图)。账号不存在时报 not found 错误。
GET /profiles/{username} 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 username string / path 是 Instagram username, with or without @ (a profile URL works too) 响应字段 字段 类型 说明 id string username string full_name string is_verified boolean profile_pic_url string followers_count integer posts_count integer has_public_story boolean pronouns string[] url string recent_posts object[] recent_posts[].shortcode string recent_posts[].url string recent_posts[].type string recent_posts[].like_count integer recent_posts[].comment_count integer recent_posts[].taken_at string recent_posts[].display_url string pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer - 帖子
GET /posts/{shortcode}单条公开帖子或 Reel:id、类型、Reel 标记、文案、话题标签、提及、点赞数、评论数、视频播放量、上传时间、封面图、视频文件及时长、尺寸、位置、作者及其粉丝数(单图帖子上为取整值,例如 267000000),以及轮播帖中的每张图片/每个视频。帖子不存在或非公开时报 not found 错误。
GET /posts/{shortcode} 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 shortcode string / path 是 post shortcode, the id in instagram.com/p/<shortcode>/ (a full post or reel URL works too) 响应字段 字段 类型 说明 id string shortcode string url string type string product_type null caption string hashtags string[] mentions string[] like_count integer comment_count integer view_count null taken_at string display_url string video_url null video_duration null width integer height integer accessibility_caption string is_paid_partnership null location null owner object owner.id string owner.username string owner.is_verified boolean owner.profile_pic_url string owner.followers_count integer media object[] media[].id string media[].shortcode string media[].type string media[].display_url string media[].video_url null media[].width integer media[].height integer pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer
将 Instagram 数据导出为 CSV
下面的每个列表都可以下载为 CSV 文件,每条记录一行。用上方控制台下面的 "Get all the data, no code" 卡片把列表收集到数据集中。数据集会逐页读取列表,之后可下载为 CSV、JSON 或 JSONL。
| 列表 | CSV 列 |
|---|---|
最新帖子GET /profiles/{username}/recent-posts | id, shortcode, url, type, product_type, caption, hashtags, mentions, like_count, comment_count, view_count, taken_at, display_url, video_url, video_duration, width, height, accessibility_caption, is_paid_partnership, location, owner, media |
主页GET /profiles/{username} | shortcode, url, type, like_count, comment_count, taken_at, display_url |
帖子GET /posts/{shortcode} | id, shortcode, type, display_url, video_url, width, height |
嵌套的值(列表或对象)以 JSON 写入同一个单元格。 数据集和导出如何工作
Instagram API 常见问题
能获取什么数据、费用多少、如何调用。
Instagram 有官方 API 吗?
有,Instagram 提供自己的 API:Instagram Platform(核实日期:2026-11-25)。本页的 Instagram API 与它无关,是非官方 API:它是 maviapi 针对 instagram.com 上的公开数据提供的独立托管 API,并非由 Instagram 开发、认可或支持。
Instagram API 可以获取哪些数据?
Instagram API 有 4 个端点。每个端点都返回 JSON,参数和字段见上方的文档:
- GET
/profiles/{username}/recent-posts: 公开主页的最新帖子(未登录时 Instagram 最多只显示最新 6 条):id、shortcode、url、类型、文案、话题标签、提及、点赞数、评论数、视频播放量、发布时间、封面图、视频文件及时长、尺寸、位置、发布者及其粉丝数,以及轮播帖中的每张图片/每个视频。 - GET
/feed: 将最多 5 个公开主页的最新帖子(每个最多 6 条)合并为一个动态,每条帖子包含文案、话题标签、提及、点赞数、评论数、视频播放量、时间、图片/视频及作者的粉丝数;另外每个主页对应一行概要(名称、粉丝数、认证状态、在动态中的帖子数)。 - GET
/profiles/{username}: 公开的 Instagram 主页:id、名称、认证状态、粉丝数和帖子数、头像、是否有正在进行的快拍、人称代词,以及最新 6 条帖子(类型、点赞数、评论数、时间、封面图)。 - GET
/posts/{shortcode}: 单条公开帖子或 Reel:id、类型、Reel 标记、文案、话题标签、提及、点赞数、评论数、视频播放量、上传时间、封面图、视频文件及时长、尺寸、位置、作者及其粉丝数(单图帖子上为取整值,例如 267000000),以及轮播帖中的每张图片/每个视频。
Instagram API 的价格是多少?
调用用您 maviapi 套餐中的积分支付,只有成功的调用才会计费。此 API 的每个端点每次调用消耗 5 个积分。在 Hobby 套餐下(每月 $49,含 250,000 个积分),1,000 次调用约 $0.98。失败的调用不收费。Free 套餐每月提供 1,000 个积分,无需信用卡。超出部分请查看套餐和积分价格。
如何调用 Instagram API?
向端点发送 HTTPS 请求,并在 Authorization 请求头中带上您的 API 密钥。例如 GET /profiles/{username}/recent-posts:
curl 'https://api.maviapi.com/v1/sites/instagram/profiles/natgeo/recent-posts' \
-H "Authorization: Bearer $MAVI_KEY"在您的 API 密钥页面创建密钥,或者先在上方的控制台中用免费测试密钥试用任意端点。
以 JSON 获取 Instagram 数据有哪些方式?
以 JSON 获取 Instagram 数据的每种方式适合不同的需求:
- Instagram Platform: 需要写入权限、账号数据或与 Instagram 签订协议时更合适。
- 自己写爬虫: 完全由自己掌控,不依赖任何服务商,但解析、被拦截的请求以及 instagram.com 每次改版后的修复都要自己负责。更适合从很少变化的页面一次性获取数据。
- Apify: 一个 Actor 市场,Actor 由您自己运行,输入、输出和价格由各个 Actor 决定。当已有 Actor 能返回您需要的数据,或者您想托管自己的代码时更合适。参见maviapi 与 Apify 的对比。
- RapidAPI: 一个汇集了众多提供方 API 的平台,用一个 RapidAPI 密钥调用,每个 API 单独定价。当您已经在使用该平台,并且其中某个 API 能满足需求时更合适。来源:RapidAPI docs。
- maviapi: 本页的 Instagram API:4 个带文档的端点、公开的响应结构,以及一个可用于整个目录的密钥。当这些数据是您产品的一部分,而您不想维护爬虫时更合适。
instagram.com 改版后会怎样?
更新会破坏我的 Instagram API 集成吗?
不会。您正在使用的端点,其结构永远不会改变:新的字段、可选参数和端点只会加在旁边,会破坏调用的变更则作为新端点发布。请忽略您不认识的响应字段,新内容请关注更新日志。
相关 API
- YouTube API
以 JSON 形式提供 YouTube 数据:搜索视频、Shorts、频道和播放列表,获取视频详情和评论、频道主页和上传内容、播放列表内容,以及搜索建议。
- Tripadvisor API
来自 Tripadvisor 的行程规划数据:支持地点搜索,并可按地点(geo_id)获取景点、餐厅和酒店,包含评分、评论、价格和坐标。先用 /search 解析地名,再通过…
- Google Maps API
来自 maps.google.com 的结构化数据。