PHP code example of jworksuk / instagram-api

1. Go to this page and download the library: Download jworksuk/instagram-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jworksuk / instagram-api example snippets

 php
$sessionId = new GuzzleHttp\Cookie\SetCookie([
    "Name"     => 'sessionid',
    "Value"    => 'ak91F09c_6sADwlo', // example
    "Domain"   => ".instagram.com",
    "Path"     => "/",
    "Expires"  => '2026-01-01 00:00:00', // example
    "Max-Age"  => "31536000",
    "Secure"   => true,
    "Discard"  => false,
    "HttpOnly" => false,
]);
$cookieJar = new GuzzleHttp\Cookie\CookieJar(false, [$sessionId]);

$instagramApiClient = new JWorksUK\InstagramApi\Client(
    new GuzzleHttp\Client(),
    $cookieJar
);

$stories = $instagramApiClient->getStoriesByProfileIds([25025320]);