New Instagram API - How do you request tagged media?

允我心安 提交于 2019-12-17 19:44:30

问题


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.

Goal

I want to request media for a specific tag.

The Documentation

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.

My API Request

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

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"
    }
}

The Issue

As you can see from the request I am not specifying either of the deprecated parameters; next_max_id or min_id.

I have tried these alternate requests with the same result:

  • https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN
  • https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&max_tag_id=123
  • https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&min_tag_id=123
  • https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&min_id=123
  • https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&max_id=123
  • https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&next_max_id=123
  • https://api.instagram.com/v1/tags/cats/media/recent?access_token=TOKEN&next_min_id=123

Things I Have Looked At

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.

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

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.

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.

Related Quesions

  • Instagram new API, get items by tag
  • Instagram API: I want to get recent images based on tag, but I only recieve my own

回答1:


Reread the sandbox documentation and caught this sentence.

But instead of returning media from any public Instagram user, it will return only media that belongs to your sandbox users, restricted to the last 20 for each user.

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




回答2:


Nothing is broken they are sending the message for all API calls, you can see the same result in apigee.com



来源:https://stackoverflow.com/questions/34190332/new-instagram-api-how-do-you-request-tagged-media

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!