Instagram web scraper based on PHP. You can get account information, photos and videos from Instagram web version

0.1.1 2018-10-24 10:51 UTC

This package is auto-updated.

Last update: 2022-09-25 02:27:13 UTC


This library is based on Postaddictme's Instagram PHP Scraper.

This library is based on the Instagram web version. Most of the time you don't have to use OAuth.

Code Example

$instagram = Instagram::withCredentials('username', 'password');
$account = $instagram->getAccountById(3);
echo $account->getUsername();

Some methods do not require authentication:

$instagram = new Instagram();
$nonPrivateAccountMedias = $instagram->getMedias('kevin');
echo $nonPrivateAccountMedias[0]->getLink();

If you use authentication it is recommended to cache the user session. In this case you don't need to run the $instagram->login() method every time your program runs:

$instagram = Instagram::withCredentials('username', 'password', '/path/to/cache/folder/');
$instagram->login(); // will use cached session if you can force login $instagram->login(true)
$account = $instagram->getAccountById(3);
echo $account->getUsername();

Using proxy for requests:

$instagram = new Instagram();
    'address' => '',
    'port'    => '8080',
    'tunnel'  => true,
    'timeout' => 30,
// Request with proxy
$account = $instagram->getAccount('kevin');
// Request without proxy
$account = $instagram->getAccount('kevin');


Using composer

composer.phar require taufikp/igscraper


composer require taufikp/igscraper

If you don't have composer

You can download it here.


See examples here.