This is the code that I used to get images of hashtag without API. I do not want to use any credentials. It does not require me to add either client_id or acces
Easily way is request with ?__a=1 like https://www.instagram.com/explore/tags/girls/?__a=1 and receive JSON without parsing HTML and window._sharedData =
In json you can see page_info scope with end_cursor:
"page_info": {
"has_previous_page": false,
"start_cursor": "1381007800712523480",
"end_cursor": "J0HWCVx1AAAAF0HWCVxxQAAAFiYA",
"has_next_page": true
},
use end_cursor to request next portion of images:
https://www.instagram.com/explore/tags/girls/?__a=1&max_id=J0HWCVx1AAAAF0HWCVxxQAAAFiYA
UPD:
tag->media->nodes);
if(!$json->tag->media->page_info->has_next_page) break;
$url = $baseUrl.'&max_id='.$json->tag->media->page_info->end_cursor;
}