Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get all Instagram post comments via the API instagram?

I am making an Android-based application that utilizes Instagram API to retrieve comment data from Instagram, where I need all the comments on the post, but after I tried it with a request https://api.instagram.com/v1/media/{media_id}/comments?access_token={access_token} I didn't get pagination and only returned the latest 150 comments?

I hope to get all post comments even though the number of comments is more than 150 comments

like image 397
Asthok Aripasola Avatar asked Dec 05 '25 16:12

Asthok Aripasola


1 Answers

This is what I've found in the Instagram API documentation about pagination:

enter image description here

So i think you just need to check in the JSON answer you get, if you can find a pagination tag and the next_url tag and just call it to get the next results.

like image 96
MatPag Avatar answered Dec 08 '25 07:12

MatPag



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!