您如何请求标记的媒体

您如何请求标记的媒体

本文介绍了新的 Instagram API - 您如何请求标记的媒体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题看起来像是围绕这个问题的所有以前的问题的重复,特别是这个问题PHP Instagram API - 如何获取 MIN_TAG_ID 和 MAX_TAG_ID.但是随着新 API 的变化,以前的答案不再有效.

This question is going to seem like a duplicate of all the previous ones around this issue, specifically this question PHP Instagram API - How to get MIN_TAG_ID and MAX_TAG_ID. But with the new API changes the previous answers no longer work.

我想为特定标签请求媒体.

I want to request media for a specific tag.

关于 获取标记媒体的 Instagram 文档指定您需要拥有public_content 范围,并且有 4 个可用参数;ACCESS_TOKENCOUNTMIN_TAG_IDMAX_TAG_ID.

Instagrams documentation on getting tagged media specifies you need to have the public_content scope and that there are 4 available parameters; ACCESS_TOKEN, COUNT, MIN_TAG_ID, and MAX_TAG_ID.

https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&max_tag_id=123

这给了我这个 API 响应.

Which gives me this API response.

{
    "data": [],
    "meta": {
        "code": 200
    },
    "pagination": {
        "deprecation_warning": "next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead"
    }
}

问题

正如您从请求中看到的,我没有指定任何一个已弃用的参数;next_max_idmin_id.

我尝试了这些替代请求,结果相同:

I have tried these alternate requests with the same result:

我的应用程序批准:我有一个沙盒应用程序,我使用同一个帐户进行身份验证.如果我正确理解文档,我应该可以通过我的设置访问所有 API.

My app approval: I have a sandboxed app which I'm using the same account for authenticating with. If I understand the documentation properly I should have access to all the APIs with my setup.

可用媒体:我正在使用cat"标签进行测试,它应该有大量媒体可以请求.

Available media: I'm using the "cat" tag to test, which should have plenty of media to request.

我的 access_token:我认为这不是问题,因为我使用相同的访问令牌向 端点成功.

My access_token: I don't think this is an issue because I'm using the same access token to make authenticated public_content scope requests to the /users/user-id/media/recent endpoint successfully.

官方 python-instagram 存储库:我无法完全解析他们是如何制作的请求,但最后一次提交是在 7 月,所以我什至不确定它是否适用于最新的 API.

The official python-instagram repo: I couldn't quite parse how they were making the requests but it's last commit was in July so I'm not even sure it works with the latest API.

推荐答案

重读 沙盒文档 并抓住了这句话.

Reread the sandbox documentation and caught this sentence.

但它不会返回来自任何公开 Instagram 用户的媒体,而是仅返回属于您的沙盒用户的媒体,限制为每个用户的最后 20 个.

我需要使用我之前发布的标签.将问题留给处理该问题的其他人.

I needed to use a tag that I had posted before. Leaving the question for anyone else dealing with the issue.

这篇关于新的 Instagram API - 您如何请求标记的媒体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 21:06