Omer Omer - 4 months ago 161
PHP Question

Get photos by (#) hashtag from instagram API

I've been trying to get the photos by (#) hashtag from instagram API but the results response shows this:

JSON RESPONSE:

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


My API call is like this:

https://api.instagram.com/v1/tags/MY-HASHTAG/media/recent?access_token=MY-ACCESS-TOKEN


I have tried another API call:

https://api.instagram.com/v1/tags/MY-HASHTAG?access_token=MY-ACCESS-TOKEN


And the response I get is this which is correct:

JSON RESPONSE:

{
"meta": {
"code": 200
},
"data": {
"media_count": 295,
"name": "kulafoods"
}
}


What I think is there is something to do with using
min_tag_id
&
max_tag_id
? but couldn't find any solution on the instagram developer documentation or in google.

I have followed the exact documentation on the instagram developer but still cannot make it to work. Can anyone help identifying or guide me on what I'm doing wrong?

Answer

Ok here is the answer of your question. So answering your question will help other programmers like me