Alireza Etehadi
Alireza Etehadi

Reputation: 80

Get Last Post instagram of public_users

I have a site written with PHP. I asked if it would be possible to automatically display the latest public post on Instagram on my site? And who will open the site to see the posts? No need to enter the Instagram account

If it is possible, please give me guidance so that I will look for its training

Example : enter image description here

Upvotes: 1

Views: 2799

Answers (1)

coudy.one
coudy.one

Reputation: 1420

You can use this library:

https://github.com/cosenary/Instagram-PHP-API

Example call:

  1. Installation:

    $ composer require cosenary/instagram
    
  2. Initialize the class:

    use MetzWeb\Instagram\Instagram;
    
    $instagram = new Instagram(array(
        'apiKey'      => 'YOUR_APP_KEY',
        'apiSecret'   => 'YOUR_APP_SECRET',
        'apiCallback' => 'YOUR_APP_CALLBACK'
    ));
    
    echo "<a href='{$instagram->getLoginUrl()}'>Login with Instagram</a>";
    
  3. Data:

    $result = $instagram->getUserMedia();
    

Upvotes: 1

Related Questions