问题
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