PHPackages                             espresso-dev/instagram-php - 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. espresso-dev/instagram-php

ActiveLibrary[API Development](/categories/api)

espresso-dev/instagram-php
==========================

A simple PHP class for accessing the Instagram API

v1.1.2(1y ago)923.0k—3.1%1[2 issues](https://github.com/espresso-dev/instagram-php/issues)1MITPHPPHP &gt;=5.6

Since Sep 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/espresso-dev/instagram-php)[ Packagist](https://packagist.org/packages/espresso-dev/instagram-php)[ Docs](https://github.com/espresso-dev/instagram-php)[ RSS](/packages/espresso-dev-instagram-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (1)

Instagram PHP API
=================

[](#instagram-php-api)

A simple PHP wrapper for the Instagram API. Based on the original [Instagram-PHP-API](https://github.com/cosenary/Instagram-PHP-API) by [Christian Metz](http://metzweb.net)

[![Latest Stable Version](https://camo.githubusercontent.com/95a75f20ab67ae833515b8bee283cc7ad5dbf0f7e4a9defe07955c147b6f97c2/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f657370726573736f2d6465762f696e7374616772616d2d7068702e7376673f7374796c653d666c6174)](https://packagist.org/packages/espresso-dev/instagram-php)[![License](https://camo.githubusercontent.com/6b94fc76414fb89dee1fee429965bba4581ab11fe1a28b0638874a0be7e87c7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f657370726573736f2d6465762f696e7374616772616d2d7068702e7376673f7374796c653d666c6174)](https://packagist.org/packages/espresso-dev/instagram-php)[![Total Downloads](https://camo.githubusercontent.com/cc42503b529e81299f416524cc2a3dbeeaa1a2bde2218b70cbe8592d9db2769a/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f657370726573736f2d6465762f696e7374616772616d2d7068702e7376673f7374796c653d666c6174)](https://packagist.org/packages/espresso-dev/instagram-php)

> [Composer](#installation) package available.

Requirements
------------

[](#requirements)

- PHP 5.6 or higher
- cURL
- Facebook Developer Account
- Facebook App

Get started
-----------

[](#get-started)

To use the Instagram API, you will need to register a Facebook app and configure Instagram Basic Display. Follow the [getting started guide](https://developers.facebook.com/docs/instagram-basic-display-api/getting-started).

### Installation

[](#installation)

I strongly advise using [Composer](https://getcomposer.org) to keep updates as smooth as possible.

```
$ composer require espresso-dev/instagram-php
```

### Initialize the class

[](#initialize-the-class)

```
use EspressoDev\Instagram\Instagram;

$instagram = new Instagram([
    'appId' => 'YOUR_APP_ID',
    'appSecret' => 'YOUR_APP_SECRET',
    'redirectUri' => 'YOUR_APP_REDIRECT_URI'
]);

echo "Login with Instagram";
```

### Authenticate user (OAuth2)

[](#authenticate-user-oauth2)

```
// Get the OAuth callback code
$code = $_GET['code'];

// Get the short lived access token (valid for 1 hour)
$token = $instagram->getOAuthToken($code, true);

// Exchange this token for a long lived token (valid for 60 days)
$token = $instagram->getLongLivedToken($token, true);

echo 'Your token is: ' . $token;
```

### Get user profile

[](#get-user-profile)

```
// Set user access token
$instagram->setAccessToken($token);
// Get the users profile
$profile = $instagram->getUserProfile();

echo '';
print_r($profile);
echo '';
```

### Get user media

[](#get-user-media)

```
// Set user access token
$instagram->setAccessToken($token);
// Get the users media
$media = $instagram->getUserMedia();

echo '';
print_r($media);
echo '';
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90% 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.

###  Release Activity

Cadence

Every ~5 days

Total

4

Last Release

584d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/254865472?v=4)[espressodev](/maintainers/espressodev)[@espressodev](https://github.com/espressodev)

---

Top Contributors

[![hermanschutte](https://avatars.githubusercontent.com/u/767120?v=4)](https://github.com/hermanschutte "hermanschutte (9 commits)")[![repat](https://avatars.githubusercontent.com/u/516807?v=4)](https://github.com/repat "repat (1 commits)")

---

Tags

apiinstagram

### Embed Badge

![Health badge](/badges/espresso-dev-instagram-php/health.svg)

```
[![Health](https://phpackages.com/badges/espresso-dev-instagram-php/health.svg)](https://phpackages.com/packages/espresso-dev-instagram-php)
```

###  Alternatives

[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

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