There is a method of getting all stories but how to get specified user's stories?
You need to have logged in Instagram instance. In this case - it's $instagram.
// Specified user
$username = 'instagram';
$userId = $instagram->getAccountInfo($username)->getId();
This line retrieves array of UserStories. On that first element, we call getStories() to get an array of Story.
$stories = $instagram->getStories([$userId])[0]->getStories();
Now we can process the array of single stories. On these, you can call Media methods.
foreach ($stories as $story) {
var_dump($story->getImageHighResolutionUrl());
}
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.
Most helpful comment
You need to have logged in
Instagraminstance. In this case - it's$instagram.This line retrieves array of
UserStories. On that first element, we callgetStories()to get an array ofStory.Now we can process the array of single stories. On these, you can call Media methods.