/instagram

An easy-to-use and simple Instagram package

Primary LanguagePHPMIT LicenseMIT

Instagram

instagram

An easy-to-use and simple Instagram package.

use Vinkla\Instagram\Instagram;

// Create a new instagram instance.
$instagram = new Instagram('your-access-token');

// Fetch the user's recent media feed.
$instagram->get();

Build Status StyleCI Coverage Status Total Downloads Latest Version License

Installation

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.

Read more about the benefits of this and about what different HTTP clients you may use in the HTTPlug documentation. Below is an example using Guzzle 6:

$ composer require vinkla/instagram php-http/message php-http/guzzle6-adapter

Usage

First you need to generate an access token using Pixel Union's access token generator or by creating an Instagram application.

5937104658.5688ed0.675p84e21a0341gcb3b44b1a13d9de91

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 data you may use the get() method.

$instagram->get();

Note: You can only fetch a user's recent media from the given access token.

License

MIT © Vincent Klaiber