PHPackages                             spanky/instagram - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. spanky/instagram

ActiveLibrary[API Development](/categories/api)

spanky/instagram
================

Instagram API wrapper for PHP 5.3+

05PHP

Since May 18Pushed 12y ago1 watchersCompare

[ Source](https://github.com/samdjstevens/instagram)[ Packagist](https://packagist.org/packages/spanky/instagram)[ RSS](/packages/spanky-instagram/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#Instagram API for PHP 5.3+ \[Work in progress\]

A simple, framework agnostic, PHP implementation of a wrapper for the [Instagram API](http://instagram.com/developer/).

\##Installation

Install the package via composer:

```
{
	"require": {
		"spanky/instagram": "dev-master"
	}
}
```

and require the Composer autoloader in your PHP files:

```
	require 'vendor/autoload.php';
```

\###Laravel Installation

If you want to use this package with Laravel 4, you can make use of the included service provider and facades to take care of the bootstrapping code.

First, add the service provider to the `providers` array in `app/config/app.php`:

```
'providers' => array(
	...
	'Spanky\Instagram\Laravel\InstagramServiceProvider',
);
```

Next, publish the configuration file from the package to your project via the command line:

```
php artisan config:publish spanky/instagram

```

You should now see the config file at `app/config/packages/spanky/instagram/config.php`, where you can enter in your details.

Once you've entered in your app details in the config file, you can now access the `Spanky\Instagram\Factory` class with the `Instagram` alias.

\##Usage

\###Authentication

The package follows the server side flow for authentication, [described here](http://instagram.com/developer/authentication/). To setup authentication in your app, follow these steps:

- [Register a Instagram client](http://instagram.com/developer/clients/register), making note of the credentials that are generated.
- Next, create an instance of `Spanky\Instagram\Authorizor` by calling the `authorizor()` method (passing the configuration details in, if not using Laravel) on an instance of `Spanky\Instagram\Factory`, and call the `getAuthorizeUrl()` to return the Instagram authorization URL. Redirect your users to this URL via PHP, or other means.

```
