Sand AISand AI MAGI-2MAGI-2 hiện đã có trên SandBase: video 1080p với âm thanh gốcDùng thử ngay

Instagram User Posts (V3)

Tài liệu 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.

Giá
$0.008USD / lượt gọi
Phương thức
POST
Phản hồi
JSON
Tham số
1 bắt buộc · 5 tùy chọn

Phòng thử nghiệm

Đầu vào
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) Phạm vi: 1 đến 50.
Posts per page for backward pagination, use with `before`
Đầu raVí dụ
Phản hồioutputs · 12.2 KB · 160 dòng
[
  {
    "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"
    }
  }
]

Ví dụ

Chọn một ví dụ để nạp đầu vào và kết quả của nó vào playground.

README API

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.

Khám phá thêm

APIs liên quan

Tất cả APIs
APIGiáPhản hồi
Instagram$0.008 mỗi lần gọiJSON
Instagram$0.008 mỗi lần gọiJSON
Instagram$0.008 mỗi lần gọiJSON
Instagram$0.008 mỗi lần gọiJSON
Instagram$0.002 mỗi lần gọiJSON
Instagram$0.008 mỗi lần gọiJSON

Hướng dẫn:Instagram API cost: official limits and per-call pricesBest Instagram API in 2026: Pricing Compared

Câu hỏi

FAQ

Làm thế nào để dùng API Instagram User Posts (V3)?

Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/instagram/v3/user-posts với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.

API Instagram User Posts (V3) có giá bao nhiêu?

$0.008 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.

API Instagram User Posts (V3) chấp nhận những tham số nào?

Bắt buộc: username (string). Tùy chọn: after (string), before (string), count (integer), first (integer) và last (integer). Bảng Parameters và Playground trên trang này liệt kê mọi trường.

API Instagram User Posts (V3) trả về gì?

Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ). README trên trang này có ví dụ phản hồi.

Tôi có cần tài khoản nhà phát triển hoặc API key của Instagram không?

Không. Instagram User Posts (V3) chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Instagram.