如何使用Instagram Graph API在专辑中获取所有图像的媒体_URL?

发布于 2025-02-09 15:58:02 字数 894 浏览 3 评论 0原文

我正在尝试从Instagram上的专辑帖子(Carousel Post)获取所有媒体URL/源URL。我只能从专辑中获得第一张图片。

以下URL及其ID列出了来自特定线程的消息列表。

messages_list = f"https://graph.facebook.com/{GRAPH_API_VERSION}/{thread_id}?fields=messages&platform=instagram&access_token={access_token}"

这获取了特定消息ID的详细信息。

message_details = f"https://graph.facebook.com/{GRAPH_API_VERSION}/{message_id}?fields={fields}&platform=instagram&access_token={access_token}"

我从message_details获取专辑帖子请求的响应显示在下面的屏幕截图中。如您所见,它仅显示指向专辑中存在的第一个图像的链接,并在上面及其下方显示Next上一个 endpoints的链接。

image

在访问上一个结果的下一个下一个结果之后,这就是我得到的。

image

I'm trying to get all the media urls/source urls from an album post (carousel post) on Instagram. I'm able to get only the first image from the album.

The below url fetches the list of messages from the particular thread along with their ids.

messages_list = f"https://graph.facebook.com/{GRAPH_API_VERSION}/{thread_id}?fields=messages&platform=instagram&access_token={access_token}"

This fetches the details of a particular message id.

message_details = f"https://graph.facebook.com/{GRAPH_API_VERSION}/{message_id}?fields={fields}&platform=instagram&access_token={access_token}"

The response I get from the message_details GET request for an album post is shown in the screenshot attached below. As you can see it shows only the link to the first image that is present in the album at the top and below it shows the link to next and previous endpoints.

Image

After accessing the next endpoint from the previous result, this is what I got.

Image

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

望笑 2025-02-16 15:58:02

要查看提要文章中的所有图像,您可以使用

{api_version}/{post_id}?fields=media_url,children{media_url}
  • Media_url是第一个图像儿童{Media_url}的链接
  • 是帖子上所有图像的链接

To see all the images in a feed post you can use

{api_version}/{post_id}?fields=media_url,children{media_url}
  • media_url is the link to the first image
  • children{media_url} are the links for all the images on the post
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文