PHPackages                             sparks-coding/movie-information - 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. sparks-coding/movie-information

ActiveLibrary[API Development](/categories/api)

sparks-coding/movie-information
===============================

Wrapper for the OMDb API

v1.0.1(10y ago)7592GPLv3PHPPHP &gt;=5.4.0

Since May 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/SparksCodingCompany/movie-information)[ Packagist](https://packagist.org/packages/sparks-coding/movie-information)[ RSS](/packages/sparks-coding-movie-information/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

Movie Information PHP Class
===========================

[](#movie-information-php-class)

A Simple PHP Wrapper for the OMDb API ()

Usage
-----

[](#usage)

```
// Include the Class
require 'MovieInformation.php';

// Namespace
use SparksCoding\MovieInformation\MovieInformation;

// Get move by title
$movie = new MovieInformation('The Matrix', array('plot'=>'full', 'tomatoes'=>'true'));

echo $movie->title;      // The Matrix
echo $movie->year;       // 1999
echo $movie->rated;      // R
echo $movie->released;   // 31 Mar 1999
echo $movie->runtime;    // 136 min
echo $movie->genre;      // Action, Sci-Fi
echo $movie->director;   // Andy Wachowski, Lana Wachowski
echo $movie->actors;     // Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving
echo $movie->plot;       // A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.
echo $movie->language;   // English
echo $movie->country;    // USA, Australia
echo $movie->awards;     // Won 4 Oscars. Another 34 wins & 39 nominations.
echo $movie->poster;     // http://ia.media-imdb.com/images/M/MV5BMTkxNDYxOTA4M15BMl5BanBnXkFtZTgwNTk0NzQxMTE@._V1_SX300.jpg
echo $movie->metascore;  // 73
echo $movie->imdbRating; // 8.7
echo $movie->imdbVotes;  // 1023621
echo $movie->imdbID;     // tt0133093

// Additional Information Returned when 'tomatoes' is set to true

echo $movie->tomatoMeter;        // RT Meter
echo $movie->tomatoImage;        // RT Image
echo $movie->tomatoRating;       // RT Rating
echo $movie->tomatoReviews;      // Number of RT Reviews
echo $movie->tomatoFresh;        // Number of RT Fresh Reviews
echo $movie->tomatoRotten;       // Number of RT Rotten Reviews
echo $movie->tomatoConsensus;    // RT Consensus
echo $movie->tomatoUserMeter;    // RT User Meter
echo $movie->tomatoUserRating;   // RT User Rating
echo $movie->tomatoUserReviews;  // Number of RT User Reviews
echo $movie->dvd;                // DVD Release Date
echo $movie->boxOffice;          // Box Office
echo $movie->production;         // Production Company
echo $movie->website;            // Movie Website

// Get movie by IMDB ID
$movie = new MovieInformation('tt0133093');

echo $movie->title; // The Matrix
```

Options
-------

[](#options)

OptionValuesDefaultDescriptionplotshort, fullshortReturn short or full movie plottomatoestrue, falsefalseReturn additional information from Rotten TomatoesMethods
-------

[](#methods)

### `get($key, $asArray)`

[](#getkey-asarray)

Get the value of specified key. Optionally return the value as an array.

```
// As String
$actors = $movie->get('actors');

echo $actors // Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving

// As Array
$actors = $movie->get('actors', true);

print_r($actors); // Array ( [0] => Keanu Reeves [1] => Laurence Fishburne [2] => Carrie-Anne Moss [3] => Hugo Weaving )
```

### `getMultiple(array('title', 'year'))`

[](#getmultiplearraytitle-year)

Get multiple values returned in an array.

```
$multiple = $movie->getMultiple(array('title', 'year', 'genre', 'dvd'));

print_r($multiple);

// Array
// (
//     [title] => The Matrix
//     [year] => 1999
//     [genre] => Action, Sci-Fi
//     [dvd] => 21 Sep 1999
// )
```

### `getAll($asJson)`

[](#getallasjson)

Get all the movie's information as an array or JSON.

```
$all = $movie->getAll();

print_r($all);

// Array
// (
//     [title] => The Matrix
//     [year] => 1999
//     [rated] => R
//     [released] => 31 Mar 1999
//     [runtime] => 136 min
//     [genre] => Action, Sci-Fi
//     [director] => Andy Wachowski, Lana Wachowski
//     [writer] => Andy Wachowski, Lana Wachowski
//     [actors] => Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving
//     [plot] => A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.
//     [language] => English
//     [country] => USA, Australia
//     [awards] => Won 4 Oscars. Another 34 wins & 40 nominations.
//     [poster] => http://ia.media-imdb.com/images/M/MV5BMTkxNDYxOTA4M15BMl5BanBnXkFtZTgwNTk0NzQxMTE@._V1_SX300.jpg
//     [metascore] => 73
//     [imdbRating] => 8.7
//     [imdbVotes] => 1,037,112
//     [imdbID] => tt0133093
//     [type] => movie
//     [tomatoMeter] => 87
//     [tomatoImage] => certified
//     [tomatoRating] => 7.6
//     [tomatoReviews] => 139
//     [tomatoFresh] => 121
//     [tomatoRotten] => 18
//     [tomatoConsensus] => Thanks to the Wachowskis' imaginative vision, The Matrix is a smartly crafted combination of spectacular action and groundbreaking special effects.
//     [tomatoUserMeter] => 85
//     [tomatoUserRating] => 3.6
//     [tomatoUserReviews] => 33317892
//     [dvd] => 21 Sep 1999
//     [boxOffice] => N/A
//     [production] => Warner Bros. Pictures
//     [website] => http://www.whatisthematrix.com
//     [response] => True
// )

// As JSON
$json = $movie->getAll(true);

echo $json;

// {"title":"The Matrix","year":"1999","rated":"R","released":"31 Mar 1999","runtime":"136 min","genre":"Action, Sci-Fi","director":"Andy Wachowski, Lana Wachowski","writer":"Andy Wachowski, Lana Wachowski","actors":"Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving","plot":"A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.","language":"English","country":"USA, Australia","awards":"Won 4 Oscars. Another 34 wins & 40 nominations.","poster":"http:\/\/ia.media-imdb.com\/images\/M\/MV5BMTkxNDYxOTA4M15BMl5BanBnXkFtZTgwNTk0NzQxMTE@._V1_SX300.jpg","metascore":"73","imdbRating":"8.7","imdbVotes":"1,037,112","imdbID":"tt0133093","type":"movie","tomatoMeter":"87","tomatoImage":"certified","tomatoRating":"7.6","tomatoReviews":"139","tomatoFresh":"121","tomatoRotten":"18","tomatoConsensus":"Thanks to the Wachowskis' imaginative vision, The Matrix is a smartly crafted combination of spectacular action and groundbreaking special effects.","tomatoUserMeter":"85","tomatoUserRating":"3.6","tomatoUserReviews":"33317892","dvd":"21 Sep 1999","boxOffice":"N\/A","production":"Warner Bros. Pictures","website":"http:\/\/www.whatisthematrix.com","response":"True"}
```

To Do
-----

[](#to-do)

This is a work in progress. More robust options are on the way.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

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

2

Last Release

4004d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7c254290222b725ad4654ceaf2b0ec1624f84fe7882f6d2fd3f1aa865efb8b6?d=identicon)[SparksCoding](/maintainers/SparksCoding)

---

Top Contributors

[![mattsparks](https://avatars.githubusercontent.com/u/1678388?v=4)](https://github.com/mattsparks "mattsparks (27 commits)")[![jpuck](https://avatars.githubusercontent.com/u/15305396?v=4)](https://github.com/jpuck "jpuck (2 commits)")

---

Tags

moviesmovieimdb.comomdbapi.com

### Embed Badge

![Health badge](/badges/sparks-coding-movie-information/health.svg)

```
[![Health](https://phpackages.com/badges/sparks-coding-movie-information/health.svg)](https://phpackages.com/packages/sparks-coding-movie-information)
```

###  Alternatives

[php-tmdb/api

PHP wrapper for TMDB (TheMovieDatabase) API v3. Supports two types of approaches, one modelled with repositories, models and factories. And the other by simple array access to RAW data from The Movie Database.

424378.6k16](/packages/php-tmdb-api)[php-tmdb/laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

16553.3k1](/packages/php-tmdb-laravel)[php-tmdb/symfony

Symfony Bundle for TMDB (The Movie Database) API. Provides easy access to the php-tmdb/api library.

3649.7k](/packages/php-tmdb-symfony)[hmerritt/imdb-api

IMDB API that can fetch film data and search results

6911.3k](/packages/hmerritt-imdb-api)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)[aharen/omdbapi

PHP package for OMDbAPI.com by Brian Fritz

1126.7k1](/packages/aharen-omdbapi)

PHPackages © 2026

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