This is a scrapper to easily fetch any feed and interact with Instagram (like, follow, etc.) without OAuth for PHP.
This is a scrapper to easily fetch any feed and interact with Instagram (like, follow, etc.) without OAuth for PHP.
Warning 2023-12-31 - Version 7.0.0 will drop support for PHP Warning 2022-11-09 - Instagram changed his DOM AGAIN... Please update to this version 6.16.4
Warning 2022-06-01 - Instagram changed his DOM content and profile data loading. Please update to this version 6.15.0
Easily fetch any Instagram feed and more without OAuth for PHP.
If you like or use this package, please share your love by starring this repository, follow @pgrimaud or become a sponsor.
This version can retrieve ANY Instagram feed using web scraping.
⚠️ Version ^5.0 is no more maintained. ⚠️
composer require pgrimaud/instagram-user-feedv7.0.0 - 2023-12-31:
will always return an empty array after calling$api->getProfile(). It is necessary to call $api->getMoreMedias($profile)` to return the first 12 media (cookieguru)v6.16 - 2022-08-02:
v6.15 - 2022-06-02:
v6.12 - 2021-09-20:
v6.11 - 2021-09-13:
v6.10 - 2021-09-03:
v6.9 - 2021-09-02:
v6.8 - 2021-07-08:
v6.7 - 2021-01-31:
v6.6 - 2020-10-06:
v6.5 - 2020-09-14:
v6.4 - 2020-08-30:
v6.3 -2020-07-03:
v6.2 - 2020-06-01:
v6.1 - 2020-05-21:
v6.0 - 2020-05-20
Facebook added a new CORS policy, and you can't display the data directly.
You can now download media on your storage or server to serve it directly on your website. You can find an example here.
Example:
login('username', 'password'); // mandatory
$profile = $api->getProfile('robertdowneyjr');
echo $profile->getUserName(); // robertdowneyjr
echo $profile->getFullName(); // Robert Downey Jr. Officiallogin('username', 'password');
$profile = $api->getProfile('robertdowneyjr');
print_r($profile);…If you want to use paginate on medias, just call getMoreMedias method.
login($credentials->getLogin(), $credentials->getPassword());
$profile = $api->getProfile('twhiddleston');
print_r($profile->getMedias()); // 12 first medias
do {
$profile = $api->getMoreMedias($profile);
print_r($profile->getMedias()); // 12 more medias
// avoid 429 Rate limit from Instagram
sleep(1);
} while ($profile->hasMoreMedias());login('username', 'password'); // mandatory
$profile = $api->getProfile('starwars'); // we need instagram username
sleep(1);
$feedStories = $api->getStories($profile->getId());
$stories = $feedStories->getStories();
print_r($stories);Thanks goes to these wonderful people (emoji key):
Pierre Grimaud
Jan Östlund
Tim Bond
Dlinny
René
ikiselev1989
Pezhvak
David Greminger
Nana YAMANE
David Kurniawan
gtapps
Chun-Sheng, Li ⚠️
schelmo
Mojtaba
Georgy Gusev
Jibran Ijaz
Julien Cousin-Alliot
n-richaud
Dmitry Afonin
Andrei Firoiu
Fiki Pratama
Carl
Peter Kampjes
Bob Brown
nagajoomlapro
cleveng
BMRG14
Sinan Portakal
deepvision7
Yusuf Özdemir
Kadir Melih Can
This project follows the all-contributors specification. Contributions of any kind welcome!
You found a bug? You need a new feature? You can create an issue if needed or contact me on Twitter.
Licensed under the terms of the MIT License.
No open issues yet, or sync has not completed.