Limit images returned less than 20 Instagram API

不羁的心 提交于 2019-12-11 06:18:31

问题


I have a small script a friend has helped me with. I only want to return 10 images from the API. Here is a link to my instagram api example using the featured images from instagram.

As I mentioned someone has helped me put this together, I am not very advanced so figuring it out on my own is difficult. I have searched stackoverflow, and google. But most posts want to display more than the 20 limit.

If anyone has some links to where I can read up on this, I would be glad to do so!

Thanks, Clayton


回答1:


What you are looking for is the count parameter. Change this line:

var apiUrl = "https://api.instagram.com/v1/media/popular?client_id=" + client_id + "&callback=?"

To:

var apiUrl = "https://api.instagram.com/v1/media/popular?client_id=" + client_id + "&callback=?&count=10"


来源:https://stackoverflow.com/questions/20815839/limit-images-returned-less-than-20-instagram-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!