Skip to content
Instagram PHP Scraper. Get account information, photos, videos, stories and comments.
Branch: master
Clone or download
Latest commit 6e2ae04 Jul 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github #474. Add probot stale Apr 16, 2019
examples login-error-#446 Feb 15, 2019
src Merge pull request #510 from oalba/patch-1 Jul 17, 2019
tests Merge pull request #483 from David-Kurniawan/master May 18, 2019
.gitignore add like/unlike Nov 25, 2018
CHANGELOG Update Changelog Dec 12, 2016
CONTRIBUTING.md Add getPaginateMediasByLocationId Function May 14, 2019
LICENSE Create LICENSE Jun 4, 2019
README.md Fixed typo in Readme title May 10, 2019
composer.json Moved to psr-4 Apr 17, 2019
phpunit.xml.dist add like/unlike Nov 25, 2018

README.md

Instagram PHP Scraper

This library is based on the Instagram web version. We develop it because nowadays it is hard to get an approved Instagram application. The purpose is to support every feature that the web desktop and mobile version support.

Code Example

$instagram = Instagram::withCredentials('username', 'password');
$instagram->login();
$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();
Instagram::setProxy([
    'address' => '111.112.113.114',
    'port'    => '8080',
    'tunnel'  => true,
    'timeout' => 30,
]);
// Request with proxy
$account = $instagram->getAccount('kevin');
Instagram::disableProxy();
// Request without proxy
$account = $instagram->getAccount('kevin');

Installation

Using composer

composer.phar require raiym/instagram-php-scraper

or

composer require raiym/instagram-php-scraper

If you don't have composer

You can download it here.

Examples

See examples here.

Other

Java library: https://github.com/postaddictme/instagram-java-scraper

You can’t perform that action at this time.