gaussblurinc
gaussblurinc

Reputation: 3682

Instagram API: How to specify count and offset for GET Likes/Comments?

How to get list of users, who like certain media, but with offset and limit parameters?

And how to use pagination?

When i retrieve response GET /media/{media-id}/likes?access_token={access_token}&count=5, it always return 200 likes and pagination=<null>.

How to iterate through all comments and likes?

Upvotes: 2

Views: 3632

Answers (3)

Peter
Peter

Reputation: 1

Not quite what you asked, but in case you just want to get like count, you can do:

GET /media/{media-id}

And check the --data-likes-count on the JSON response.

Upvotes: 0

czjvic
czjvic

Reputation: 123

Offset is not available. But there is MAX_ID parameter, where you can specify the ID of the last item you got.

You can find further information about the endpoints here.

Upvotes: 1

tcd
tcd

Reputation: 1605

I had this same problem... Instagram API doesn't allow you to paginate or limit the amount of likes returned. I solved this by limiting my foreach statement and you can probably do the same thing with a for statement.

Upvotes: 0

Related Questions