Search code examples
apiinstagraminstagram-api

get all of the user media with Instagram API return empty parameter


I'm in a problem with Instagram API and min_id and max_id parameters. My authenticated user have over 100 medias but when I try to get another part of the user medias over his first 20 medias it get empty data JSON parameter.

for example, my first media id is 1173958321567246146_177152120 and the last one is 1070424319045215888_177152120 but when I try to send the request with this URI I get an empty array:

https://api.instagram.com/v1/users/177152120/media/recent/?max_id=1070424319045215888_177152120&access_token={MY_ACCESS_TOKEN}

Solution

  • I think you are in sandbox mode? sandbox mode is limited to last 20 media items in API response.

    Here is more details about sandbox mode: https://www.instagram.com/developer/sandbox/

    To help you develop and test your app, the users and media available in Sandbox mode are real Instagram data (i.e. what is normally visible in the Instagram app), but with the following conditions:

    • Apps in sandbox are restricted to 10 users
    • Data is restricted to the 10 users and the 20 most recent media from each of those users
    • Reduced API rate limits