Instagram API returns only 4 likes
I am using the Instagram API to retrieve images with a specific hashtag that my organization liked. But when the API makes a get call, the response is returned with data like this, where the score is 83 (!), And the actual, like the data returned, only shows 4 (!). I've seen posts here that show that Instagram is returning about 120 data for likes. Why am I only four?
The api code I'm using is: https://api.instagram.com/v1/tags/mytag/media/recent/?client_id=myclientID
"likes": {
"count": 83,
"data": [
{
"username": "something",
"profile_picture": "picture",
"id": "idhere",
"full_name": "namehere"
},
{
"username": "",
"profile_picture": "",
"id": "",
"full_name": ""
},
{
"username": "",
"profile_picture": "",
"id": "",
"full_name": ""
},
{
"username": "",
"profile_picture": "",
"id": "",
"full_name": ""
}
]
},
source to share
When you fetch medians from Instagram using these endpoints:
/users/<user-id>/media/recent
/tags/<tag-name>/media/recent
You wouldn't like the answer; the same for comments. It's just a limitation set by Instagram . I think it would be very expensive to return all (or many) likes / comments in each of the media users.
But don't worry. If you get the medians you want, you have them id
and you can use this endpoint:
/media/<media-id>/likes
And then you will like everything (use pagination to get them all) and do great stuff with them.
Hope this helps you.
source to share
These can be three things:
1) Error, but it's unlikely (ha pun!)
2) Breaking pages. You need to request additional data in another call with MIN_TAG_ID and / or MAX_TAG_ID set .
3) Confidentiality. Instagram users have privacy settings in their profiles. Described here . This will definitely reduce the quantity even with pagination.
source to share