Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
573 views
in Technique[技术] by (71.8m points)

Pathetic state of Instagram API

Related questions with answers which are no more valid:

As I am exploring the Instagram API and my app is in sandbox mode, I am surprised by API at every step. This should not be condition of public API ( who cares !).

The Api end point I am trying to is:

https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN

Well the required parameters are:

  • access_token [A valid access token.]
  • max_tag_id [Return media after this max_tag_id.]
  • min_tag_id [Return media before this min_tag_id.]
  • count [Count of tagged media to return.]

Since I dont know how to get or generate max_tag_id and min_tag_id, I skipped and tried this : https://api.instagram.com/v1/tags/jokes/media/recent?access_token=x.y.x&count=10

The response I get is:

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

May be I need max_tag_id and min_tag_id and lets trying putting rang values 1 to 10 ( I dont know how to generate these values )

https://api.instagram.com/v1/tags/jokes/media/recent?access_token=x.y.x&count=10&min_tag_id=1&max_tag_id=10

The response I get is:

{"meta": {"code": 400, "error_type": "APIInvalidParametersError", "error_message": "max_id must not be a media id."}}

Now the error is misleading, I never provided parameter max_id as you can see.

Please help to reduce this insanity

For those who are not getting the question:

  • What is the valid value for max_tag_id and min_tag_id
  • What is the meaning of max_id must not be a media id. when there is no such parameter passed etc ..
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Looks like you are in Sandbox mode, so you will not get any public data, you will only get data from you or your sandbox users. Try search for an hashtag that you have posted a photo for, then you will just see that photo in API response. Once you get approved with public_content permission, and go live, you will see all data.

max_tag_id and min_tag_id are encrypted now, you cannot just generate, you first make a API call without the max_id or min_id, you will get the response with 20 results with max_tag_id in the pagination section of API response, which you can use this max_tag_id to make next API call, for next set of 20 results. (and btw you will have pagination in API response only if you are approved by Instagram and are out of Sandbox, so go figure, good luck)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...