PHPackages                             oh/instagram-bundle-2 - 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. oh/instagram-bundle-2

ActiveSymfony-bundle[API Development](/categories/api)

oh/instagram-bundle-2
=====================

Use Instaphp by sesser (Randy) as a Symfony2 service. Adapted to use Instaphp v2 as a dependency.

087PHP

Since Dec 9Pushed 11y ago1 watchersCompare

[ Source](https://github.com/stephen-crowdreactive/OhInstagramBundle)[ Packagist](https://packagist.org/packages/oh/instagram-bundle-2)[ RSS](/packages/oh-instagram-bundle-2/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

OhInstagramBundle
=================

[](#ohinstagrambundle)

Uses [Instaphp](https://github.com/sesser/Instaphp) by [sesser](https://github.com/sesser) as a Symfony2 service. Adapted to use Instaphp v2 as a dependency.

Installation
------------

[](#installation)

Install this bundle as usual by adding to composer.json:

```
"oh/instagram-bundle": "dev-master"

```

After installing above module you need to update your composer

```
run the command “php composer.phar update”

```

Register the bundle in `app/AppKernel.php`:

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Oh\InstagramBundle\OhInstagramBundle(),
    );
}

```

Add the following line to `app/config/config.yml`:

```
imports:
	- { resource: @OhInstagramBundle/Resources/config/services.yml }

```

Add the following config to your parameters.yml:

```
instagram_api_client_id: YOUR_API_ID
instagram_api_client_secret: YOUR_API_SECRET
instagram_timeout: 30
instagram_connect_timeout: 8

```

And if you're OK with the provided routes, add these to `app/config/routing.yml`

```
OhInstagramBundle:
    resource: "@OhInstagramBundle/Resources/config/routing.yml"
    prefix:   /

```

Usage (Controller)
------------------

[](#usage-controller)

```
//finding a user
$query = "snoopdogg";

$api = $this->get('instaphp');

$response = $api->Users->Find($query);

$userInfo = $response->data[0];

// NB: pagination no longer compatible

```

You can also test if a user is logged in.

```
//is a user logged in?
$loggedIn = $this->get('instaphp_token_handler')->isLoggedIn();

```

Usage (Twig)
------------

[](#usage-twig)

Theres a login button included in the views. Just implement this line in your Twig template

```
{{ render(controller('OhInstagramBundle:Instagram:instagramLoginStatus')) }}

```

You should set up your Instagram API account to callback to the "OhInstagramBundle\_callback" route, which you can set yourself, or use the ones provided - "/instaphp/callback".

Instagram Auth Token
--------------------

[](#instagram-auth-token)

There are 2 TokenHandlers included.

1. CookieToken - The Instagram auth code is stored in a cookie

    ```
    services:
        instaphp_token_handler:
            class:            Oh\InstagramBundle\TokenHandler\CookieToken

    ```
2. UserToken - The Instagram auth code is stored in the User Entity. The methods setInstagramAuthCode() and getInstagramAuthCode() must be implemented on your User. When the login call is returned from Instagram, the code is set and the user is persisted and flushed in the Handler.

    ```
    services:
        instaphp_token_handler:
            class:            Oh\InstagramBundle\TokenHandler\UserToken
            arguments:        [@security.context, @doctrine.orm.default_entity_manager]

    ```
3. Both - This will look to see if the user can be retrieved from the context and if it can't it will store the auth code in a cookie.

    ```
    services:
        instaphp_user_token_handler:
            class:            Oh\InstagramBundle\TokenHandler\UserToken
            arguments:        [@security.context, @doctrine.orm.default_entity_manager]
        instaphp_cookie_token_handler:
            class:            Oh\InstagramBundle\TokenHandler\CookieToken
        instaphp_token_handler:
            class:            Oh\InstagramBundle\TokenHandler\TokenManager
            arguments:        [@instaphp_user_token_handler, @instaphp_cookie_token_handler]

    ```

You can also implement your own TokenHandlerInterface to store the auth code somewhere else, like the session etc.

Tests
-----

[](#tests)

@todo

Credits
-------

[](#credits)

- Ollie Harridge (ollietb) as the author.
- Randy (sesser) for writing the Instaphp script \[\]

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8859564?v=4)[Stephen Wilkinson](/maintainers/stephen-crowdreactive)[@stephen-crowdreactive](https://github.com/stephen-crowdreactive)

---

Top Contributors

[![ollietb](https://avatars.githubusercontent.com/u/342090?v=4)](https://github.com/ollietb "ollietb (27 commits)")[![rmasters](https://avatars.githubusercontent.com/u/34284?v=4)](https://github.com/rmasters "rmasters (4 commits)")[![stephen-crowdreactive](https://avatars.githubusercontent.com/u/8859564?v=4)](https://github.com/stephen-crowdreactive "stephen-crowdreactive (3 commits)")[![ramireddy558](https://avatars.githubusercontent.com/u/7223426?v=4)](https://github.com/ramireddy558 "ramireddy558 (2 commits)")

### Embed Badge

![Health badge](/badges/oh-instagram-bundle-2/health.svg)

```
[![Health](https://phpackages.com/badges/oh-instagram-bundle-2/health.svg)](https://phpackages.com/packages/oh-instagram-bundle-2)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k14](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
