PHP code example of downace / instagram-php-scraper

1. Go to this page and download the library: Download downace/instagram-php-scraper 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/ */

    

downace / instagram-php-scraper example snippets


$insta = new Instagram(new \InstagramScraper\HttpClient\UnirestClient());

// \GuzzleHttp\Client with default options will be used
$insta = new Instagram(new \InstagramScraper\HttpClient\GuzzleClient());

// You can provide options for \GuzzleHttp\Client constructor
$insta = new Instagram(new \InstagramScraper\HttpClient\GuzzleClient([ 'timeout' => 5 ]));

// Or pass your own instance of \GuzzleHttp\ClientInterface:
$insta = new Instagram(new \InstagramScraper\HttpClient\GuzzleClient($myClient));

// With Guzzle.
$insta = new Instagram(new \InstagramScraper\HttpClient\GuzzleClient([
    'proxy' => 'http://user:pass@localhost:8125'
]));

// With Unirest
Request::proxy('localhost', 8125, CURLPROXY_HTTP);
Request::proxyAuth('user', 'pass');
$insta = new Instagram(new \InstagramScraper\HttpClient\UnirestClient());