An easy-to-use and simple Instagram package.
use Vinkla\Instagram\Instagram; // Create a new instagram instance. $instagram = new Instagram('your-access-token'); // Fetch recent user media items. $instagram->media(); // Fetch user information. $instagram->self();
Instagram is decoupled from any library sending HTTP requests (like Guzzle), instead it uses an abstraction called HTTPlug which provides the http layer used to send requests to exchange rate services. This gives you the flexibility to choose what HTTP client and PSR-7 implementation you want to use.
$ composer require vinkla/instagram php-http/message php-http/guzzle6-adapter
Then create a new
Vinkla\Instagram\Instagram instance with your Instagram access token.
use Vinkla\Instagram\Instagram; $instagram = new Instagram('5937104658.5688ed0.675p84e21a0341gcb3b44b1a13d9de91');
To fetch the user's recent media items you may use the
To fetch the user information data you may use the
Note: You can only fetch a user's recent media from the given access token.
The Instagram allows you to call their API 200 times per hour. Try to cache the responses in your application.
The Instagram API uses the same rate limiting as the Graph API (200 calls per user per hour) with one exception: the /media/comments edge limits writes to 60 writes per user per hour. Please refer to the Graph API's rate limiting documentation for more information - Facebook