Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

Instagram User Posts (V3)

API 文档
https://api.sandbase.ai/v1/api/instagram/v3/user-posts

Returns a list of posts from a specific Instagram account. Supports bidirectional cursor pagination using the account username.

价格
$0.008美元 / 次调用
方法
POST
响应
JSON
参数
1 个必填 · 5 个可选

Playground

输入
Username string (e.g. `99brasil`), **NOT numeric user_id**
Forward pagination cursor, from previous response `page_info.end_cursor`
Backward pagination cursor, from previous response `page_info.start_cursor`
Number of posts for first request (default 12)
150
Posts per page for forward pagination (default 12, max 50) 范围:1 到 50。
Posts per page for backward pagination, use with `before`
输出示例
响应outputs · 12.2 KB · 160 行
[
  {
    "data": {
      "_rid": "386c72493fb91",
      "count": 12,
      "data": {
        "user": {
          "edge_owner_to_timeline_media": {
            "count": 12,
            "edges": [
              {
                "node": {
                  "caption_text": "Presented by @Rolex. Welcome to Africa 🌍 Africa Earth’s Wild Home takes you deep into the heart of our wildest continent, bringing you closer to its animals, landscapes, and the people watching over it than ever before.\n\nThrough its partnership with the National Geographic Society and as part of its Perpetual Planet Initiative, #Rolex supports expeditions exploring and protecting remarkable places around the world, a selection of which are featured in Africa Earth’s Wild Home. #PerpetualPlanet\n\nAfrica Earth’s Wild Home, narrated by @wunmimosaku, premieres Friday, October 2 at 8/7c on National…",
                  "code": "DdG4RIxIPyf",
                  "comment_count": 523,
                  "id": "3983118388705688735_787132",
                  "is_video": true,
                  "like_count": 78681,
                  "media_type": 2,
                  "owner": {
                    "full_name": "National Geographic",
                    "is_verified": true,
                    "pk": "787132",
                    "username": "natgeo"
                  },
                  "pk": "3983118388705688735",
                  "shortcode": "DdG4RIxIPyf",
                  "taken_at": null,
                  "thumbnail_url": "https://scontent-phl2-1.cdninstagram.com/v/t51.82787-15/802503979_18695767555019133_6909214034622416488_n.jpg?stp=dst-jpg_e15_p480x480_tt6&_nc_cat=101&ig_cache_key=Mzk4MzExODM4ODcwNTY4ODczNTE4Njk1NzY3NTUyMDE5MTMz.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjEwODAuc2RyLnZpZGVvX3VzZXJfdXBsb2FkZWRfdGh1bWJuYWlsLkMzIn0%3D&_nc_ohc=7yfEJ19w2-cQ7kNvwFMMD2r&_nc_oc=AdoYgqjwCaQGxOM0-0e57iimrBKSJa7qJdVjXOelUrMle_7wuHRCnNVLIWF5ZD-Dmxk&_nc_ad=z-m&_nc_cid=0&_nc_zt=23&_nc_ht=scontent-phl2-1.cdninstagram.com&_nc_gid=jiBkkWdEyIgbXVBf_BWjkg&_nc_ss=7a3ba&oh=00_AQNnU93xodhzK6KK1D-h0rhA…",
                  "video_url": "https://scontent-phl2-1.cdninstagram.com/o1/v/t2/f2/m86/AQPDJtVww4K_686Ed9TbciE3dp0nrA4iUd5M8OJJIZKcU-RmkzTGwtpi3CsZY9Pgqj7h7kSpk9qe7k5S4JdWZ-Z2s7pzWC2DxuqU8rc.mp4?_nc_cat=108&_nc_sid=5e9851&_nc_ht=scontent-phl2-1.cdninstagram.com&_nc_ohc=l7RUjCk4zFkQ7kNvwF7fr9m&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTQxOTE1NjM1Njk0NTg4MywiYXNzZXRfYWdlX2RheXMiOjIzLCJ2aV91c2VjYXNlX2lkIjoxMDA5OSwiZHVyYXRpb25fcyI6NzIsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=64e569b880f6d99e&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRf…",
                  "view_count": 0
                }
              },
              {
                "node": {
                  "caption_text": "Describe Pompeii: Out of Time in 3 words? It's Now Streaming.\n\n#PompeiiOutOfTime with @twhiddleston is now streaming on @DisneyPlus and @hulu.",
                  "code": "DbIdlf0j6uA",
                  "comment_count": 317,
                  "id": "3947535193527528320_787132",
                  "is_video": true,
                  "like_count": 28079,
                  "media_type": 2,
                  "owner": {
                    "full_name": "National Geographic",
                    "is_verified": true,
                    "pk": "787132",
                    "username": "natgeo"
                  },
                  "pk": "3947535193527528320",
                  "shortcode": "DbIdlf0j6uA",
                  "taken_at": null,
                  "thumbnail_url": "https://scontent-phl2-1.cdninstagram.com/v/t51.82787-15/752808040_18678898645019133_4153257147870540953_n.jpg?stp=dst-jpg_e15_p480x480_tt6&_nc_cat=106&ig_cache_key=Mzk0NzUzNTE5MzUyNzUyODMyMDE4Njc4ODk4NjM5MDE5MTMz.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjEwODAuc2RyLnZpZGVvX2RlZmF1bHRfY292ZXJfZnJhbWUuQzMifQ%3D%3D&_nc_ohc=ukwysq6aRZ8Q7kNvwE_J76S&_nc_oc=AdrpW3dEulsb2o4WLs3SGYa9hk-SL313WqRZ2iCU88rUygYo23x-hifiON89xeJYmuU&_nc_ad=z-m&_nc_cid=0&_nc_zt=23&_nc_ht=scontent-phl2-1.cdninstagram.com&_nc_gid=jiBkkWdEyIgbXVBf_BWjkg&_nc_ss=7a3ba&oh=00_AQMNgFFWspjV3kK_sQpBrHE81m…",
                  "video_url": "https://scontent-phl2-1.cdninstagram.com/o1/v/t2/f2/m86/AQOvM90zPTwW0N4CDD39RzvglWYHp-iJeLZwN99oLQCPSXXSvMBvmrxrAPpyQT3kP8bZd5Bg55bReyqubnmyVfuNRMqla8GLx8vvGKw.mp4?_nc_cat=103&_nc_sid=5e9851&_nc_ht=scontent-phl2-1.cdninstagram.com&_nc_ohc=yOksBit1ZWYQ7kNvwHExNVP&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTg2Nzg4NjIzNjAwMTkxMzMsImFzc2V0X2FnZV9kYXlzIjo3MiwidmlfdXNlY2FzZV9pZCI6MTAwOTksImR1cmF0aW9uX3MiOjM2LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=82e791fe4237a3da&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3…",
                  "view_count": 0
                }
              },
              {
                "node": {
                  "caption_text": "Presented by @Rolex. When the millionaire who owned the world's largest rhino herd ran out of money, the conservationists who took over responsibility for the herd in 2023 had an audacious idea: split 2,000 southern white rhinos into smaller groups and seed them across Africa. The goal is to protect them from poachers and ensure the species has the best chance of survival. While the plan is working, their mission is far from over. \n\nThrough its partnership with the National Geographic Society and as part of its Perpetual Planet Initiative, #Rolex supports expeditions exploring and protecting r…",
                  "code": "DeBJRyaDIyP",
                  "comment_count": 49,
                  "id": "3999518748855536783_787132",
                  "is_video": false,
                  "like_count": 26634,
                  "media_type": 8,
                  "owner": {
                    "full_name": "National Geographic",
                    "is_verified": true,
                    "pk": "787132",
                    "username": "natgeo"
                  },
                  "pk": "3999518748855536783",
                  "shortcode": "DeBJRyaDIyP",
                  "taken_at": null,
                  "thumbnail_url": null,
                  "video_url": null,
                  "view_count": 0
                }
              },
              "… 9 more items in the full response"
            ],
            "page_info": {
              "end_cursor": "3998390297839372818_787132",
              "has_next_page": true,
              "has_previous_page": false,
              "start_cursor": null
            }
          }
        }
      },
      "items": [
        {
          "caption_text": "Presented by @Rolex. Welcome to Africa 🌍 Africa Earth’s Wild Home takes you deep into the heart of our wildest continent, bringing you closer to its animals, landscapes, and the people watching over it than ever before.\n\nThrough its partnership with the National Geographic Society and as part of its Perpetual Planet Initiative, #Rolex supports expeditions exploring and protecting remarkable places around the world, a selection of which are featured in Africa Earth’s Wild Home. #PerpetualPlanet\n\nAfrica Earth’s Wild Home, narrated by @wunmimosaku, premieres Friday, October 2 at 8/7c on National…",
          "code": "DdG4RIxIPyf",
          "comment_count": 523,
          "id": "3983118388705688735_787132",
          "is_video": true,
          "like_count": 78681,
          "media_type": 2,
          "owner": {
            "full_name": "National Geographic",
            "is_verified": true,
            "pk": "787132",
            "username": "natgeo"
          },
          "pk": "3983118388705688735",
          "shortcode": "DdG4RIxIPyf",
          "taken_at": null,
          "thumbnail_url": "https://scontent-phl2-1.cdninstagram.com/v/t51.82787-15/802503979_18695767555019133_6909214034622416488_n.jpg?stp=dst-jpg_e15_p480x480_tt6&_nc_cat=101&ig_cache_key=Mzk4MzExODM4ODcwNTY4ODczNTE4Njk1NzY3NTUyMDE5MTMz.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjEwODAuc2RyLnZpZGVvX3VzZXJfdXBsb2FkZWRfdGh1bWJuYWlsLkMzIn0%3D&_nc_ohc=7yfEJ19w2-cQ7kNvwFMMD2r&_nc_oc=AdoYgqjwCaQGxOM0-0e57iimrBKSJa7qJdVjXOelUrMle_7wuHRCnNVLIWF5ZD-Dmxk&_nc_ad=z-m&_nc_cid=0&_nc_zt=23&_nc_ht=scontent-phl2-1.cdninstagram.com&_nc_gid=jiBkkWdEyIgbXVBf_BWjkg&_nc_ss=7a3ba&oh=00_AQNnU93xodhzK6KK1D-h0rhA…",
          "video_url": "https://scontent-phl2-1.cdninstagram.com/o1/v/t2/f2/m86/AQPDJtVww4K_686Ed9TbciE3dp0nrA4iUd5M8OJJIZKcU-RmkzTGwtpi3CsZY9Pgqj7h7kSpk9qe7k5S4JdWZ-Z2s7pzWC2DxuqU8rc.mp4?_nc_cat=108&_nc_sid=5e9851&_nc_ht=scontent-phl2-1.cdninstagram.com&_nc_ohc=l7RUjCk4zFkQ7kNvwF7fr9m&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTQxOTE1NjM1Njk0NTg4MywiYXNzZXRfYWdlX2RheXMiOjIzLCJ2aV91c2VjYXNlX2lkIjoxMDA5OSwiZHVyYXRpb25fcyI6NzIsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=64e569b880f6d99e&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRf…",
          "view_count": 0
        },
        {
          "caption_text": "Describe Pompeii: Out of Time in 3 words? It's Now Streaming.\n\n#PompeiiOutOfTime with @twhiddleston is now streaming on @DisneyPlus and @hulu.",
          "code": "DbIdlf0j6uA",
          "comment_count": 317,
          "id": "3947535193527528320_787132",
          "is_video": true,
          "like_count": 28079,
          "media_type": 2,
          "owner": {
            "full_name": "National Geographic",
            "is_verified": true,
            "pk": "787132",
            "username": "natgeo"
          },
          "pk": "3947535193527528320",
          "shortcode": "DbIdlf0j6uA",
          "taken_at": null,
          "thumbnail_url": "https://scontent-phl2-1.cdninstagram.com/v/t51.82787-15/752808040_18678898645019133_4153257147870540953_n.jpg?stp=dst-jpg_e15_p480x480_tt6&_nc_cat=106&ig_cache_key=Mzk0NzUzNTE5MzUyNzUyODMyMDE4Njc4ODk4NjM5MDE5MTMz.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjEwODAuc2RyLnZpZGVvX2RlZmF1bHRfY292ZXJfZnJhbWUuQzMifQ%3D%3D&_nc_ohc=ukwysq6aRZ8Q7kNvwE_J76S&_nc_oc=AdrpW3dEulsb2o4WLs3SGYa9hk-SL313WqRZ2iCU88rUygYo23x-hifiON89xeJYmuU&_nc_ad=z-m&_nc_cid=0&_nc_zt=23&_nc_ht=scontent-phl2-1.cdninstagram.com&_nc_gid=jiBkkWdEyIgbXVBf_BWjkg&_nc_ss=7a3ba&oh=00_AQMNgFFWspjV3kK_sQpBrHE81m…",
          "video_url": "https://scontent-phl2-1.cdninstagram.com/o1/v/t2/f2/m86/AQOvM90zPTwW0N4CDD39RzvglWYHp-iJeLZwN99oLQCPSXXSvMBvmrxrAPpyQT3kP8bZd5Bg55bReyqubnmyVfuNRMqla8GLx8vvGKw.mp4?_nc_cat=103&_nc_sid=5e9851&_nc_ht=scontent-phl2-1.cdninstagram.com&_nc_ohc=yOksBit1ZWYQ7kNvwHExNVP&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTg2Nzg4NjIzNjAwMTkxMzMsImFzc2V0X2FnZV9kYXlzIjo3MiwidmlfdXNlY2FzZV9pZCI6MTAwOTksImR1cmF0aW9uX3MiOjM2LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=82e791fe4237a3da&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3…",
          "view_count": 0
        },
        {
          "caption_text": "Presented by @Rolex. When the millionaire who owned the world's largest rhino herd ran out of money, the conservationists who took over responsibility for the herd in 2023 had an audacious idea: split 2,000 southern white rhinos into smaller groups and seed them across Africa. The goal is to protect them from poachers and ensure the species has the best chance of survival. While the plan is working, their mission is far from over. \n\nThrough its partnership with the National Geographic Society and as part of its Perpetual Planet Initiative, #Rolex supports expeditions exploring and protecting r…",
          "code": "DeBJRyaDIyP",
          "comment_count": 49,
          "id": "3999518748855536783_787132",
          "is_video": false,
          "like_count": 26634,
          "media_type": 8,
          "owner": {
            "full_name": "National Geographic",
            "is_verified": true,
            "pk": "787132",
            "username": "natgeo"
          },
          "pk": "3999518748855536783",
          "shortcode": "DeBJRyaDIyP",
          "taken_at": null,
          "thumbnail_url": null,
          "video_url": null,
          "view_count": 0
        },
        "… 9 more items in the full response"
      ],
      "next_max_id": "3998390297839372818_787132"
    }
  }
]

示例

选择一个示例,将其输入和结果加载到 playground 中。

API README

Instagram User Posts (V3) API

Returns a page of recent posts from an Instagram account. Each post includes its caption, like and comment counts, media type, and owner. The only required input is the account username, not a numeric user ID.

Use cases

  • Pull the latest posts from a brand account to track what it publishes.
  • Compare like_count and comment_count across posts to find which content gets the most engagement.
  • Collect video_url and thumbnail_url links for video posts to review the media.
  • Page backward and forward through an account's feed with cursors to build a post archive.

Request

curl -X POST "https://api.sandbase.ai/v1/api/instagram/v3/user-posts" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "99brasil"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
usernamestringYesUsername string (e.g. 99brasil), NOT numeric user_id
afterstringNoForward pagination cursor, from previous response page_info.end_cursor
beforestringNoBackward pagination cursor, from previous response page_info.start_cursor
countintegerNoNumber of posts for first request (default 12)
firstintegerNoPosts per page for forward pagination (default 12, max 50)
lastintegerNoPosts per page for backward pagination, use with before

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "_rid": "3b0c580e2be36",
  "count": 12,
  "data": {
    "user": {
      "edge_owner_to_timeline_media": {
        "count": 12,
        "edges": [
          {
            "node": {
              "caption_text": "publi | Uma das coisas mais incriveis que a gastronomia proporciona é a de conse…",
              "code": "DfDPgRny-X3",
              "comment_count": 756,
              "id": "4018123481186821623_189966948",
              "is_video": true,
              "like_count": 63872,
              "media_type": 2,
              "owner": {
                "full_name": "Gabriela Paveloski | Masterchef 11",
                "is_verified": true,
                "pk": "189966948",
                "username": "gabipaveloski"
              }
            }
          }
        ],
        "page_info": {
          "end_cursor": "3991279117147774438_791258468",
          "has_next_page": true,
          "has_previous_page": false,
          "start_cursor": null
        }
      }
    }
  },
  "items": [
    {
      "caption_text": "publi | Uma das coisas mais incriveis que a gastronomia proporciona é a de conse…",
      "code": "DfDPgRny-X3",
      "comment_count": 756,
      "id": "4018123481186821623_189966948",
      "is_video": true,
      "like_count": 63872,
      "media_type": 2,
      "owner": {
        "full_name": "Gabriela Paveloski | Masterchef 11",
        "is_verified": true,
        "pk": "189966948",
        "username": "gabipaveloski"
      },
      "pk": "4018123481186821623",
      "shortcode": "DfDPgRny-X3",
      "taken_at": null,
      "thumbnail_url": "https://scontent-atl3-1.cdninstagram.com/v/t51.82787-15/874538980_18642463201014…"
    }
  ],
  "next_max_id": "3991279117147774438_791258468"
}

Response fields

FieldMeaning
items[]Flat list of posts on this page. It repeats the posts found under data.user.edge_owner_to_timeline_media.edges[].node.
items[].code / items[].shortcodeShort code that identifies the post. The same value appears in both fields.
items[].id / items[].pkPost identifiers. id is the media ID followed by an underscore and the owner ID. pk is the media ID alone.
items[].caption_textCaption of the post. Long captions appear cut off in the response.
items[].like_count / items[].comment_countNumber of likes and comments on the post.
items[].view_countView count for the post. It is 0 for the non-video post in the sample.
items[].media_type / items[].is_videomedia_type is a numeric type code. is_video is true for video posts. In the sample, 2 goes with video posts and 8 goes with a post where is_video is false.
items[].owner.username / items[].owner.full_name / items[].owner.is_verifiedUsername, display name and verified flag of the account that owns the post. The owner can differ from the username you requested.
items[].thumbnail_url / items[].video_urlLinks to the thumbnail image and the video file. Both can be null, as with the non-video post in the sample.
data.user.edge_owner_to_timeline_media.page_infoPagination state with end_cursor, start_cursor, has_next_page and has_previous_page.

Notes

  • Pass a username such as 99brasil. A numeric user ID does not work.
  • For the next page, send page_info.end_cursor as after, and set the page size with first (maximum 50). The top-level next_max_id holds the same cursor value.
  • For the previous page, send page_info.start_cursor as before and set the size with last. In the sample, start_cursor is null and has_previous_page is false.
  • taken_at is null in the sample, so do not rely on it for post dates.

Pricing

$0.008 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

探索更多

相关 APIs

全部 APIs
API价格响应
Instagram$0.008 每次调用JSON
Instagram$0.008 每次调用JSON
Instagram$0.008 每次调用JSON
Instagram$0.008 每次调用JSON
Instagram$0.002 每次调用JSON
Instagram$0.008 每次调用JSON

指南:Instagram API cost: official limits and per-call pricesBest Instagram API in 2026: Pricing Compared

问题

常见问题

如何使用 Instagram User Posts (V3) API?

向 https://api.sandbase.ai/v1/api/instagram/v3/user-posts 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。

Instagram User Posts (V3) API 的价格是多少?

每次调用 $0.008,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。

Instagram User Posts (V3) API 接受哪些参数?

必填:username (string)。 可选:after (string), before (string), count (integer), first (integer) 和 last (integer)。 Parameters 表和本页的 Playground 列出了每个字段。

Instagram User Posts (V3) API 返回什么?

在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。

我需要 Instagram 开发者账户或 API key 吗?

不需要。Instagram User Posts (V3) 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Instagram API 访问权限。