lunoxis/instagram

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

v1.0.1 2023-06-23 08:20 UTC

This package is not auto-updated.

Last update: 2025-06-24 20:59:10 UTC


README

This is a simple library for extracting media from Instagram.

Dependencies

  • PHP >= 8.0.6

Login Example

require __DIR__.'/vendor/autoload.php';
$ig = new Instagram\Login\Instagram('Username', 'Pass');
$cooki = $ig->login();
$session = new \Instagram\Login\Session();
print_r($session->SetSession($cooki->getCookieByName('rur')->getValue(),$cooki->getCookieByName('csrftoken')->getValue(),$cooki->getCookieByName('sessionid')->getValue(),$cooki->getCookieByName('ds_user_id')->getValue()));

Get Post Media By Link:

require __DIR__.'/vendor/autoload.php';
$media = new \Instagram\Media\Post('https://www.instagram.com/p/CfJec1mMLie/?igshid=YmMyMTA2M2Y=');
print_r( $media->GetPost());

Get Account Info By Username

require __DIR__.'/vendor/autoload.php';

$info = new \Instagram\Media\Info('click.ir');
Get All Info
print_r($info->GetInfo());
Get Info
echo $info->GetInfo()[0]['username'];

Get Story By Story Link

require __DIR__.'/vendor/autoload.php';

$story = new \Instagram\Media\Story('https://instagram.com/stories/pcgadjettv/2868234876450457114?igshid=MDJmNzVkMjY=');
echo $story->GetLink();

Get All Story By Username

require __DIR__.'/vendor/autoload.php';

$story = new \Instagram\Media\AllStory('click.ir');
print_r( $story->GetLink());
echo $story->MediaCount();

Get HighLight BY HighLight Link

require __DIR__.'/vendor/autoload.php';

$high = new \Instagram\Media\HighLight('https://www.instagram.com/s/aGlnaGxpZ2h0OjE3OTI5NjQ4NzIzOTAyNjMy?story_media_id=2768449635828641458_7247131961&igshid=YmMyMTA2M2Y=');
echo $high->GetLink();

Get All HighLight BY Username

require __DIR__.'/vendor/autoload.php';

$all = new \Instagram\Media\AllHighLight();
$all->GetAllHighLight('click.ir');
print_r($all->GetHighLight());

Download HighLight BY HighLight ID 

$all->GetHighLightmedia('highlight:17917690438338215');
print_r($all->HighLightLink());

Installation

Using composer

composer.phar require lunoxis/instagram

or

composer require lunoxis/instagram 

If you don't have composer

You can download it here.