login($credentials->getLogin(), $credentials->getPassword()); $profile = $api->getProfile('wendyswan'); printIgtvs($profile->getIgtvs()); do { $profile = $api->getMoreIgtvs($profile); printIgtvs($profile->getIgtvs()); // avoid 429 Rate limit from Instagram sleep(1); } while ($profile->hasMoreIgtvs()); } catch (InstagramException $e) { print_r($e->getMessage()); } catch (CacheException $e) { print_r($e->getMessage()); } function printIgtvs(array $medias) { foreach ($medias as $media) { echo 'ID : ' . $media->getId() . "\n"; echo 'Caption : ' . $media->getCaption() . "\n"; echo 'Link : ' . $media->getLink() . "\n"; echo 'Likes : ' . $media->getLikes() . "\n"; echo 'Date : ' . $media->getDate()->format('Y-m-d h:i:s') . "\n\n"; } }