Instagram-php-scraper: How to get someone's stories?

Created on 4 Oct 2020  路  2Comments  路  Source: postaddictme/instagram-php-scraper

There is a method of getting all stories but how to get specified user's stories?

wontfix

Most helpful comment

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());
}

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alabamaster picture alabamaster  路  6Comments

moh6mmad picture moh6mmad  路  3Comments

kiskaserver picture kiskaserver  路  4Comments

fsjdg picture fsjdg  路  8Comments

jakerator picture jakerator  路  5Comments