PHPackages                             reelflow/reelflow-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. reelflow/reelflow-php

ActiveLibrary

reelflow/reelflow-php
=====================

Elegant and powerful Instagram video downloader for seamless content extraction

1.4.0(1y ago)5804↓10.4%2MITPHPPHP &gt;=7.4

Since Mar 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/code3-dev/reelflow-php)[ Packagist](https://packagist.org/packages/reelflow/reelflow-php)[ Docs](https://github.com/code3-dev/reelflow-php)[ RSS](/packages/reelflow-reelflow-php/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

📹 ReelFlow - Instagram Reels Downloader
=======================================

[](#-reelflow---instagram-reels-downloader)

A modern, elegant PHP library for downloading Instagram reels with ease.

[![PHP Version](https://camo.githubusercontent.com/7404ac2849f95f99ace60c4b949c4e57e3188dfc0d5df7a913378138ac571fb6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e342d626c7565)](https://camo.githubusercontent.com/7404ac2849f95f99ace60c4b949c4e57e3188dfc0d5df7a913378138ac571fb6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e342d626c7565)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)[![Status](https://camo.githubusercontent.com/f3adeea933a64c2014c89092040b8c02f4931f3f5a5d46a189133d4ac21d0ebf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374617475732d737461626c652d627269676874677265656e)](https://camo.githubusercontent.com/f3adeea933a64c2014c89092040b8c02f4931f3f5a5d46a189133d4ac21d0ebf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374617475732d737461626c652d627269676874677265656e)

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

[](#-features)

- 🎯 Download videos from Instagram reels
- 🖼️ Get reel thumbnails
- 🚀 Simple and intuitive API
- 🔄 Automatic fallback mechanisms
- 🛡️ Comprehensive error handling
- 🔍 Smart reel URL validation

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

[](#-installation)

Install via Composer:

```
composer require reelflow/reelflow-php
```

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

[](#-quick-start)

### Basic Usage

[](#basic-usage)

```
use Code3\ReelFlow\ReelFlow;
use Code3\ReelFlow\InstagramException;

// Create an instance
$downloader = new ReelFlow();

try {
    // Get reel information
    $video = $downloader->getVideoInfo('https://www.instagram.com/reel/xyz123/');

    // Access reel details
    echo $video->getVideoUrl();      // Direct video URL
    echo $video->getThumbnailUrl();  // Thumbnail URL
    echo $video->getWidth();         // Video width
    echo $video->getHeight();        // Video height
    echo $video->getUsername();      // Creator's username
    echo $video->getDescription();   // Reel description
} catch (InstagramException $e) {
    echo "Error {$e->getStatusCode()}: {$e->getMessage()}";
}
```

### Using the Facade

[](#using-the-facade)

```
use Code3\ReelFlow\ReelflowFacade;

// Use the static facade method
$video = ReelflowFacade::getVideoInfo('https://www.instagram.com/reel/xyz123/');
```

📋 API Reference
---------------

[](#-api-reference)

### ReelFlow Class

[](#reelflow-class)

#### `getVideoInfo(string $url): VideoInfo`

[](#getvideoinfostring-url-videoinfo)

Retrieves video information from an Instagram reel URL.

- **Parameters:**
    - `$url` (string): The Instagram reel URL
- **Returns:** VideoInfo object
- **Throws:** InstagramException

### VideoInfo Class

[](#videoinfo-class)

#### Methods:

[](#methods)

- `getVideoUrl(): string` - Get the direct video URL
- `getThumbnailUrl(): string` - Get thumbnail image URL
- `getWidth(): int` - Get video width
- `getHeight(): int` - Get video height
- `getUsername(): string` - Get the username of the reel creator
- `getDescription(): string` - Get the reel description
- `toArray(): array` - Get all info as array

#### Example using toArray():

[](#example-using-toarray)

```
$video = $downloader->getVideoInfo($url);
$videoData = $video->toArray();

// Access data from array
echo $videoData['videoUrl'];     // Direct video URL
echo $videoData['thumbnailUrl']; // Thumbnail URL
echo $videoData['width'];        // Video width
echo $videoData['height'];       // Video height
echo $videoData['username'];     // Creator's username
echo $videoData['description'];  // Reel description
```

### InstagramException Class

[](#instagramexception-class)

Extends PHP's built-in Exception class with additional status code information.

#### Methods:

[](#methods-1)

- `getStatusCode(): int` - Get HTTP status code
- `getMessage(): string` - Get error message

🌟 Examples
----------

[](#-examples)

### Handling Different Reel URL Formats

[](#handling-different-reel-url-formats)

```
// Regular reel URL
$url1 = 'https://www.instagram.com/reel/xyz123/';

// Short reel URL
$url2 = 'https://www.instagram.com/reels/xyz123/';

// URL with parameters
$url3 = 'https://www.instagram.com/reel/xyz123/?utm_source=ig_web_copy_link';
```

### Error Handling

[](#error-handling)

```
try {
    $video = $downloader->getVideoInfo($url);

    if ($video) {
        // Process reel video
        $videoUrl = $video->getVideoUrl();
        // Download or stream video
    } else {
        echo "No reel information found";
    }
} catch (InstagramException $e) {
    switch ($e->getStatusCode()) {
        case 400:
            echo "Invalid reel URL format";
            break;
        case 404:
            echo "Reel not found";
            break;
        case 500:
            // Handle various 500 error cases
            if (strpos($e->getMessage(), 'Failed to parse server response') !== false) {
                echo "Error: Instagram API response was malformed";
            } elseif (strpos($e->getMessage(), 'Failed to connect to Instagram server') !== false) {
                echo "Error: Could not establish connection with Instagram";
            } elseif (strpos($e->getMessage(), 'Instagram server error') !== false) {
                echo "Error: Instagram server is experiencing issues";
            } elseif (strpos($e->getMessage(), 'Failed to extract video dimensions') !== false) {
                echo "Error: Could not retrieve video dimensions";
            } else {
                echo "Internal server error: " . $e->getMessage();
            }
            break;
        default:
            echo "Error: " . $e->getMessage();
    }
}
```

🛠️ Development
--------------

[](#️-development)

### Requirements

[](#requirements)

- PHP 7.4 or higher
- Composer
- GuzzleHttp Client
- Symfony DomCrawler

📞 Support
---------

[](#-support)

- GitHub Issues: [Open an issue](https://github.com/code3-dev/reelflow-php/issues)
- Email:
- Telegram: [@h3dev](https://t.me/h3dev)

📄 License
---------

[](#-license)

MIT © [Hossein Pira](https://github.com/code3-dev)

---

Made with ❤️ by [Hossein Pira](https://github.com/code3-dev)

###  Health Score

33

—

LowBetter than 76% of packages

Maintenance49

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

4

Last Release

377d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40130ba18b583ddbb28f5251503480424ac073656c20e1375628b126359bf21a?d=identicon)[code3-dev](/maintainers/code3-dev)

---

Top Contributors

[![code3-dev](https://avatars.githubusercontent.com/u/158034265?v=4)](https://github.com/code3-dev "code3-dev (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/reelflow-reelflow-php/health.svg)

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

###  Alternatives

[buchin/bing

Bing scraper: Text, Image, Video

172.0k1](/packages/buchin-bing)[dpi/dogit

191.1k](/packages/dpi-dogit)

PHPackages © 2026

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