PHPackages                             rooxie/omdb - 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. rooxie/omdb

ActiveLibrary[API Development](/categories/api)

rooxie/omdb
===========

A PHP wrapper for OMDb API

1.0.0(1y ago)622331MITPHPPHP &gt;=7.1

Since Jun 4Pushed 1y agoCompare

[ Source](https://github.com/rooxie/omdb-php)[ Packagist](https://packagist.org/packages/rooxie/omdb)[ Docs](http://github.com/rooxie/omdb-php)[ RSS](/packages/rooxie-omdb/feed)WikiDiscussions master Synced 3d ago

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

OMDb API PHP Wrapper
====================

[](#omdb-api-php-wrapper)

Introduction
------------

[](#introduction)

A PHP wrapper for [OMDb](http://www.omdbapi.com/) API with [PSR-17 HTTP Factories](https://www.php-fig.org/psr/psr-17/) and [PSR-18 HTTP Client](https://www.php-fig.org/psr/psr-18/).

Prerequisites
-------------

[](#prerequisites)

- PHP &gt;= `8.1`
- Any PSR-17 and PSR-18 compatible HTTP client

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

[](#installation)

Install [`omdb-php`](http://packagist.org/packages/rooxie/omdb) using [Composer](https://getcomposer.org/).

```
# Install the package
composer require rooxie/omdb

# Install the PSR-17 and PSR-18 implementations
composer require guzzlehttp/guzzle
```

Usage
-----

[](#usage)

*Create an instace of `OMDb` class, providing the API key as the constructor argument*

```
$omdb = new Rooxie\OMDb(
    new \GuzzleHttp\Client(),
    new \GuzzleHttp\Psr7\HttpFactory(),
    'your-api-key'
);
```

#### Get title by IMDb ID

[](#get-title-by-imdb-id)

*One gets an instance of `Movie` model class after fetching movie data vit HTTP request*

```
$movie = $omdb->getByImdbId('tt0110912');
// {"Title":"Pulp Fiction","Year":"1994","Rated":"R","Released":"14 Oct 1994" ...
echo $movie->getBody()->getContents();
```

#### Get by title and other optional arguments

[](#get-by-title-and-other-optional-arguments)

*Same goes for fetching data using movie title. One can also provide optional arguments such as movie type (`movie`, `series` or `episode`) and the release year*

```
$movie = $omdb->getByTitle('harry potter', \Rooxie\Enum\TitleType::MOVIE, 2004);
// {"Title":"Harry Potter and the Prisoner of Azkaban","Year":"2004","Rated":"PG","Released":"04 Jun 2004" ...
echo $movie->getBody()->getContents();
```

#### Search by title and other optional arguments

[](#search-by-title-and-other-optional-arguments)

*Movie search method returns a raw array from the API response and has an optional pagination parameter as the last argument*

```
$movies = $omdb->search('arrival', \Rooxie\Enum\TitleType::MOVIE, 2016, 1)->getBody()->getContents();
print_r(json_decode($movies, true));
```

```
Array
(
    [Search] => Array
        (
            [0] => Array
                (
                    [Title] => Arrival
                    [Year] => 2016
                    [imdbID] => tt2543164
                    [Type] => movie
                    [Poster] => https://m.media-amazon.com/images/M/MV5BMTExMzU0ODcxNDheQTJeQWpwZ15BbWU4MDE1OTI4MzAy._V1_SX300.jpg
                )

            [1] => Array
                (
                    [Title] => Alien Arrival
                    [Year] => 2016
                    [imdbID] => tt3013160
                    [Type] => movie
                    [Poster] => https://m.media-amazon.com/images/M/MV5BMjE5ODg2MTUtMDQ3Ny00MjA2LWJmZjMtYThlNTY3NGJhZmI2XkEyXkFqcGdeQXVyMjA4MDYxNDk@._V1_SX300.jpg
                )

            [2] => Array
                (
                    [Title] => The Arrival
                    [Year] => 2016
                    [imdbID] => tt5623378
                    [Type] => movie
                    [Poster] => https://images-na.ssl-images-amazon.com/images/M/MV5BNTMyMDRhODgtOTE4Yi00MGI5LTllMDUtNThhYWM0ZGVhZTg1XkEyXkFqcGdeQXVyNjQ2NzI0Mw@@._V1_SX300.jpg
                )

            [3] => Array
                (
                    [Title] => Arrival
                    [Year] => 2016
                    [imdbID] => tt5433758
                    [Type] => movie
                    [Poster] => https://images-na.ssl-images-amazon.com/images/M/MV5BMTNiMDRlMDQtZTVkNS00MWVhLWFiOGUtMTkxNTgzODBkMWIyXkEyXkFqcGdeQXVyMjMxMTU4MzA@._V1_SX300.jpg
                )

            [4] => Array
                (
                    [Title] => The Arrival of the Train at a Subway Station in Vienna
                    [Year] => 2016
                    [imdbID] => tt5972896
                    [Type] => movie
                    [Poster] => https://images-na.ssl-images-amazon.com/images/M/MV5BMGVlY2MwYWUtODE1Zi00NGNjLWJjMDgtM2M0ZmJmYTFmMWM4XkEyXkFqcGdeQXVyNDcwNDE0Nzk@._V1_SX300.jpg
                )

            [5] => Array
                (
                    [Title] => Arrival: Common Ground
                    [Year] => 2016
                    [imdbID] => tt6196852
                    [Type] => movie
                    [Poster] => https://images-na.ssl-images-amazon.com/images/M/MV5BMTE4ZjA0MjctNmY0Yy00OWE2LTk1ZTItZmViZDg3ODQwY2NjL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyMzM2MjIzNA@@._V1_SX300.jpg
                )

            [6] => Array
                (
                    [Title] => The Arrival
                    [Year] => 2016
                    [imdbID] => tt5678770
                    [Type] => movie
                    [Poster] => N/A
                )

            [7] => Array
                (
                    [Title] => Dead on Arrival
                    [Year] => 2016
                    [imdbID] => tt5175144
                    [Type] => movie
                    [Poster] => N/A
                )

            [8] => Array
                (
                    [Title] => Arrival of a Train At
                    [Year] => 2016
                    [imdbID] => tt5333154
                    [Type] => movie
                    [Poster] => http://ia.media-imdb.com/images/M/MV5BY2M2YWYyMDUtNGM5MC00Y2YwLTkzZWEtNzgzOGEzYTQxYmQwXkEyXkFqcGdeQXVyNjQ3Mjc0Nzg@._V1_SX300.jpg
                )

            [9] => Array
                (
                    [Title] => Arrival of Their Majesties the Emperor and Empress of Japan
                    [Year] => 2016
                    [imdbID] => tt5378228
                    [Type] => movie
                    [Poster] => N/A
                )

        )

    [totalResults] => 10
    [Response] => True
)

```

### Error Handling

[](#error-handling)

Error handling fully depends on the PSR-18 HTTP client implementation. One can catch exceptions thrown by the HTTP client and handle them accordingly.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance40

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

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 ~470 days

Total

5

Last Release

657d ago

Major Versions

0.4.0 → 1.0.02024-07-26

PHP version history (2 changes)0.1.0PHP ^7.1

0.4.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/6064e8378f3bd99e811e30ed3ec99682b009c4bf91146752b14b92c503e34239?d=identicon)[rooxie](/maintainers/rooxie)

---

Top Contributors

[![rooxie](https://avatars.githubusercontent.com/u/13544320?v=4)](https://github.com/rooxie "rooxie (15 commits)")

---

Tags

apimoviesimdbomdbratingsseriesepisodesfilms

### Embed Badge

![Health badge](/badges/rooxie-omdb/health.svg)

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

###  Alternatives

[fabianbeiner/php-imdb-grabber

This PHP library enables you to scrape data from IMDB.com.

2764.8k1](/packages/fabianbeiner-php-imdb-grabber)[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)[hmerritt/imdb-api

IMDB API that can fetch film data and search results

6911.3k](/packages/hmerritt-imdb-api)[dariusiii/php-itunes-api

Query iTunes API System

1116.9k](/packages/dariusiii-php-itunes-api)

PHPackages © 2026

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