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
This one works for me perfectly.
I only needed the thumbnails. You can easily change it to full size image. This example does not solve pagination, but you can do that from @ilyapt answer.
$tag = 'coronavirus';
$json = json_decode(file_get_contents("https://www.instagram.com/explore/tags/$tag/?__a=1", true));
$i = 0;
foreach($json->graphql->hashtag->edge_hashtag_to_media->edges as $key => $value) {
$img = $value->node->thumbnail_resources[0]->src;
echo "";
if (++$i == 9) break; // limit to the 9 newest posts
}