postaddictme / instagram-php-scraper

Get account information, photos, videos, stories and comments.
https://packagist.org/packages/raiym/instagram-php-scraper
MIT License
3.1k stars 800 forks source link

"max_id" doesn't work anymore for users feeds #288

Closed aik27 closed 5 years ago

aik27 commented 6 years ago

"max_id" doesn't work anymore for this endpoint :

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

So paginated requests return same content

aik27 commented 6 years ago

Solution by Mark:

https://instagram.com/graphql/query/?query_id=17888483320059182&id=user_id&first=12&after=end_cursor

This returns:

['data']['user']['edge_owner_to_timeline_media']['page_info']['end_cursor']

And Media:

['data']['user']['edge_owner_to_timeline_media']['edges']

the 'query_id' is static now so just use: 17888483320059182

'id' is the "instagram user id" so you have to use ?__a=1 to grab ['graphql']['user']['id']

'first' is the number of photos you desire returned. Just use 12 to keep the media return the same.

'after' is the new 'max_id' for use ['data']['user']['edge_owner_to_timeline_media']['page_info']['end_cursor']

aik27 commented 6 years ago

Raw solution for instagram-php-scraper: getMedias.txt

aik27 commented 6 years ago

https://github.com/postaddictme/instagram-php-scraper/pull/290

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

MikeCodechief commented 4 years ago

do hashtags and locations has similar way to do it?