Instagram ?__a=1 url doesn't allow max_id

I was using instagram ?__a=1 url to read all the post of instagram's users.

A few hours ago there was a change in the response and now doesn't allow me to use max_id to paginate.

Before I usually sent a request to

https://www.instagram.com/{{username}}/?__a=1

and using the graphql.edge_owner_to_timeline_media.page_info.end_cursor in the response I called the same page with a new max_id

https://www.instagram.com/{{username}}/?__a=1&max_id={{end_cursor}}

Now the end_cursor changes in each call & max_id is not working.

Please help :)

1 answer

  • answered 2018-03-13 20:29 Daniel Choi

    I just came by the same issue.

    Looks like they just changed their private api by removing the max_id. Their website seems to have replaced the old api with the graphql api.

    https://www.instagram.com/graphql/query/?query_hash=472f257a40c653c64c666ce877d59d2b&variables={"id":"111","first":12,"after":"xxx"}

    • id: user ID,
    • first: amount of nodes to get,
    • after: the 'end_cursor' you can get from data['user']['edge_owner_to_timeline_media']['page_info']['end_cursor']

    use either query_hash or query_id

    • query_hash: 472f257a40c653c64c666ce877d59d2b
    • query_id: 17888483320059182

    I have no idea how long that query_id/query_hash will work, it's up to Instagram. They will eventually change it.