Skip to content
Advertisement

Instagram Basic Display API: how can I limit the number of posts to less than 20?

Using the Instagram Basic Display API, how can I limit the number of posts that it fetches to less than 20?

Inside a class in PHP, I defined the following base URL for the endpoints:

JavaScript

These two functions get the posts:

JavaScript

In this post I found this endpoint:

JavaScript

But how would I make this work with my functions? I don’t want to use pagination, but only return like, say, the last 5-10 posts.

Advertisement

Answer

Add an entry for the limit parameter to the url_params arrays:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement