PHPackages                             mkhab7/php-instagram-graph - 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. mkhab7/php-instagram-graph

ActiveLibrary[API Development](/categories/api)

mkhab7/php-instagram-graph
==========================

A modern PHP 8.4 SDK for Instagram Graph API with comprehensive features and clean architecture

v1.0.0(10mo ago)06MITPHPPHP ^8.4

Since Aug 10Pushed 6mo agoCompare

[ Source](https://github.com/mkhab7/php-instagram-graph)[ Packagist](https://packagist.org/packages/mkhab7/php-instagram-graph)[ RSS](/packages/mkhab7-php-instagram-graph/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (12)Versions (2)Used By (0)

PHP Instagram Graph API SDK
===========================

[](#php-instagram-graph-api-sdk)

[![Latest Version](https://camo.githubusercontent.com/6d72e0385bda325b642a650f3fb53f2d94328fa9aeda40633ad5db9a6a86b488/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6b686162372f7068702d696e7374616772616d2d67726170682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mkhab7/php-instagram-graph)[![PHP Version](https://camo.githubusercontent.com/3499676ec8edcbc1310f3758a28baafac825c7885d2aa41d901f17ab45a7c768/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d6b686162372f7068702d696e7374616772616d2d67726170682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mkhab7/php-instagram-graph)[![Tests](https://camo.githubusercontent.com/31c4dda56e4a8812ee65fe36b8afba78f372bcc05645cdbe920c00e65ca78cea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d6b686162372f7068702d696e7374616772616d2d67726170682f74657374733f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/mkhab7/php-instagram-graph/actions)[![Code Coverage](https://camo.githubusercontent.com/8ab7e1fe9fff1d110d39b3ba78ef823831e1201ab768ebb9147bfe84d17414d8/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6d6b686162372f7068702d696e7374616772616d2d67726170683f7374796c653d666c61742d737175617265)](https://codecov.io/gh/mkhab7/php-instagram-graph)[![License](https://camo.githubusercontent.com/d76ab68583c0305601ff233178552e304723c0d8514ea01ca3b5c43943522d93/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6b686162372f7068702d696e7374616772616d2d67726170682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mkhab7/php-instagram-graph)

A modern, comprehensive PHP 8.4+ SDK for the Instagram Graph API with clean architecture, full type safety, and extensive feature coverage.

✨ Features
----------

[](#-features)

- **🚀 Modern PHP 8.4** - Leverages latest PHP features: typed properties, attributes, enums, match expressions, named arguments
- **🏗️ Clean Architecture** - SOLID principles, dependency injection, service-oriented design
- **🔐 Complete Authentication** - OAuth 2.0 flow, token management, automatic refresh
- **📊 Full API Coverage** - Users, Media, Comments, Messaging, Insights, Webhooks
- **🛡️ Type Safety** - Comprehensive DTOs with strict typing and validation
- **⚡ HTTP Client Abstraction** - Robust error handling, rate limiting, retry logic
- **🧪 Fully Tested** - Comprehensive test suite with Pest PHP
- **📚 Rich Documentation** - Detailed examples and API reference
- **🔍 Developer Friendly** - Intuitive API design with IDE autocompletion

📋 Requirements
--------------

[](#-requirements)

- PHP 8.4 or higher
- Composer
- Instagram Business or Creator Account
- Facebook App with Instagram API access

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require mkhab7/php-instagram-graph
```

⚙️ Configuration
----------------

[](#️-configuration)

### 1. Create Facebook App

[](#1-create-facebook-app)

1. Go to [Facebook Developers](https://developers.facebook.com/)
2. Create a new app with **Business** type
3. Add **Instagram API** product
4. Configure OAuth redirect URIs

### 2. Environment Setup

[](#2-environment-setup)

Create a `.env` file or set environment variables:

```
INSTAGRAM_APP_ID=your_app_id
INSTAGRAM_APP_SECRET=your_app_secret
INSTAGRAM_REDIRECT_URI=https://yourapp.com/callback
```

🚀 Quick Start
-------------

[](#-quick-start)

### Authentication Flow

[](#authentication-flow)

```
