instagram-php-scraper

Instagram PHP Scraper. Get account information, photos, videos, stories and comments.

Github星跟踪图

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.

Dependencies

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:

use Phpfastcache\Helper\Psr16Adapter;

$instagram = Instagram::withCredentials('username', 'password', new Psr16Adapter('Files'));
$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

主要指标

概览
名称与所有者postaddictme/instagram-php-scraper
主编程语言PHP
编程语言PHP (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2016-04-22 07:44:18
推送于2025-05-28 22:55:53
最后一次提交2025-05-28 23:55:49
发布数114
最新版本名称v0.12.9 (发布于 )
第一版名称v0.0.1 (发布于 2016-04-22 12:16:14)
用户参与
星数3.2k
关注者数161
派生数798
提交数609
已启用问题?
问题数827
打开的问题数56
拉请求数199
打开的拉请求数2
关闭的拉请求数71
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?