简体   繁体   中英

How to get more than 20 posts Instagram API (Rails)

I built a web app that renders photos from the Instagram API and I have the live token.

Wondering how I can pull more than 20 photos, I know there is the pagination but I am confused with the docs and how to actually implement this on my code

This is what I have to pull the 20 photos, how do I pull more?

 @response = client.get("tags/#{@tag_name}/media/recent")

在API响应中获取pagination.next_url并进行API调用,这将为您提供下一个20,然后执行相同操作,直到pagination.next_urlnull

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM