PHPackages                             duyplus/tmdbapi - 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. duyplus/tmdbapi

ActiveLibrary[API Development](/categories/api)

duyplus/tmdbapi
===============

TMDB API v3 PHP client library, updated for CI4 compatibility

1.0.0(1y ago)0371MITPHPPHP &gt;=7.3

Since Jan 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/duyplus/tmdbapi)[ Packagist](https://packagist.org/packages/duyplus/tmdbapi)[ RSS](/packages/duyplus-tmdbapi/feed)WikiDiscussions master Synced 1mo ago

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

TMDBAPI
=======

[](#tmdbapi)

TMDB API v3 PHP Library - wrapper to [API](https://developers.themoviedb.org/3/) version 3 of [themoviedb.org](http://themoviedb.org). With the TMDB API v3 PHP Library, you can easily access information about movies, actors, reviews, genres, and many other related data. The library supports basic HTTP requests and automatically handles JSON responses, enabling you to quickly and efficiently integrate TMDB functionalities into your PHP projects with flexibility.

[![GitHub tag](https://camo.githubusercontent.com/00932a79569a5816ca5b4812e61441b16e93204df3221f8aacbc4472116c8163/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f647579706c75732f746d64626170693f7374796c653d666f722d7468652d6261646765)](https://github.com/duyplus/tmdbapi/releases/?include_prereleases)[![GitHub last commit](https://camo.githubusercontent.com/de395dd7dcf5c029e97b1c58196b9fdaba248c8f950e531147ee11806cd64408/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f647579706c75732f746d64626170693f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/de395dd7dcf5c029e97b1c58196b9fdaba248c8f950e531147ee11806cd64408/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f647579706c75732f746d64626170693f7374796c653d666f722d7468652d6261646765)

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

[](#installation)

You can install the TMDB API via Composer:

```
composer require duyplus/tmdbapi
```

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

[](#requirements)

- PHP 5.3.x or higher
- cURL
- TMDB API Key (get key from [here](https://www.themoviedb.org/settings/api))

Documentation
-------------

[](#documentation)

[View document](https://duyplus.github.io/tmdbapi/index.html)

Changelog
---------

[](#changelog)

[View changelog](https://github.com/duyplus/tmdbapi/blob/master/CHANGELOG.md)

Initialize the class
--------------------

[](#initialize-the-class)

If you have a $conf array

```
use Duyplus\TMDBApi\TMDB;
// if you have a $conf array - (See LIB_ROOT/src/Config/Default.php as an example)
$tmdb = new TMDB($conf);
```

If you have no $conf array it uses the default conf but you need to have an API Key

```
use Duyplus\TMDBApi\TMDB;
// if you have no $conf it uses the default config
$tmdb = new TMDB();
//Insert your API Key of TMDB
//Necessary if you use default conf
$tmdb->setAPIKey('YOUR_API_KEY');
```

Movies
------

[](#movies)

### Search a Movie

[](#search-a-movie)

```
//Title to search for
$title = 'back to the future';
$movies = $tmdb->searchMovie($title);
// returns an array of Movie Object
foreach ($movies as $movie) {
    echo $movie->getTitle() . '';
}
```

returns an array of [Movie](https://duyplus.github.io/tmdbapi/class-Movie.html) Objects.

### Get a Movie

[](#get-a-movie)

You should take a look at the Movie class [Documentation](https://duyplus.github.io/tmdbapi/class-Movie.html) and see all the info you can get from a Movie Object.

```
$idMovie = 11;
$movie = $tmdb->getMovie($idMovie);
// returns a Movie Object
echo $movie->getTitle();
```

returns a [Movie](https://duyplus.github.io/tmdbapi/class-Movie.html) Object.

TV Shows
--------

[](#tv-shows)

### Search a TV Show

[](#search-a-tv-show)

```
// Title to search for
$title = 'breaking bad';
$tvShows = $tmdb->searchTVShow($title);
foreach ($tvShows as $tvShow) {
    echo $tvShow->getName() . '';
}
```

returns an array of [TVShow](https://duyplus.github.io/tmdbapi/class-TVShow.html) Objects.

### Get a TVShow

[](#get-a-tvshow)

You should take a look at the TVShow class [Documentation](https://duyplus.github.io/tmdbapi/class-TVShow.html) and see all the info you can get from a TVShow Object.

```
$idTVShow = 1396;
$tvShow = $tmdb->getTVShow($idTVShow);
// returns a TVShow Object
echo $tvShow->getName();
```

returns a [TVShow](https://duyplus.github.io/tmdbapi/class-TVShow.html) Object.

### Get a TVShow's Season

[](#get-a-tvshows-season)

You should take a look at the Season class [Documentation](https://duyplus.github.io/tmdbapi/class-Season.html) and see all the info you can get from a Season Object.

```
$idTVShow = 1396;
$numSeason = 2;
$season = $tmdb->getSeason($idTVShow, $numSeason);
// returns a Season Object
echo $season->getName();
```

returns a [Season](https://duyplus.github.io/tmdbapi/class-Season.html) Object.

### Get a TVShow's Episode

[](#get-a-tvshows-episode)

You should take a look at the Episode class [Documentation](https://duyplus.github.io/tmdbapi/class-Episode.html) and see all the info you can get from a Episode Object.

```
$idTVShow = 1396;
$numSeason = 2;
$numEpisode = 8;
$episode = $tmdb->getEpisode($idTVShow, $numSeason, $numEpisode);
// returns a Episode Object
echo $episode->getName();
```

returns a [Episode](https://duyplus.github.io/tmdbapi/class-Episode.html) Object.

Persons
-------

[](#persons)

### Search a Person

[](#search-a-person)

```
// Name to search for
$name = 'Johnny';
$persons = $tmdb->searchPerson($name);
foreach ($persons as $person) {
    echo $person->getName() . '';
}
```

returns an array of [Person](https://duyplus.github.io/tmdbapi/class-Person.html) Objects.

### Get a Person

[](#get-a-person)

You should take a look at the Person class [Documentation](https://duyplus.github.io/tmdbapi/class-Person.html) and see all the info you can get from a Person Object.

```
$idPerson = 85;
$person = $tmdb->getPerson($idPerson);
// returns a Person Object
echo $person->getName();
```

returns a [Person](https://duyplus.github.io/tmdbapi/class-Person.html) Object.

### Get Person's Roles

[](#get-persons-roles)

You should take a look at the Role class [Documentation](https://duyplus.github.io/tmdbapi/class-Role.html) and see all the info you can get from a Role Object.

```
$movieRoles = $person->getMovieRoles();
foreach ($movieRoles as $movieRole) {
    echo $movieRole->getCharacter() . ' in ' . $movieRole->getMovieTitle() . '';
}
```

returns an array of [MovieRole](https://duyplus.github.io/tmdbapi/class-MovieRole.html) Objects.

```
$tvShowRoles = $person->getTVShow();
foreach ($tvShowRoles as $tvShowRole) {
    echo $tvShowRole->getCharacter() . ' in ' . $tvShowRole->getMovieName() . '';
}
```

returns an array of [TVShowRole](https://duyplus.github.io/tmdbapi/class-TVShowRole.html) Objects.

Collections
-----------

[](#collections)

### Search a Collection

[](#search-a-collection)

```
// Name to search for
$name = 'the hobbit';
$collections = $tmdb->searchCollection($name);
foreach ($collections as $collection) {
    echo $collection->getName() . '';
}
```

returns an array of [Collection](https://duyplus.github.io/tmdbapi/class-Collection.html) Objects.

### Get a Collection

[](#get-a-collection)

You should take a look at the Collection class [Documentation](https://duyplus.github.io/tmdbapi/class-Collection.html) and see all the info you can get from a Collection Object.

```
$idCollection = 121938;
$collection = $tmdb->getCollection($idCollection);
// returns a Collection Object
echo $collection->getName();
```

returns a [Collection](https://duyplus.github.io/tmdbapi/class-Collection.html) Object.

Companies
---------

[](#companies)

### Search a Company

[](#search-a-company)

```
// Name to search for
$name = 'Sony';
$companies = $tmdb->searchCompany($name);
foreach ($companies as $company) {
    echo $company->getName() . '';
}
```

returns an array of [Company](https://duyplus.github.io/tmdbapi/class-Company.html) Objects.

### Get a Company

[](#get-a-company)

You should take a look at the Company class [Documentation](https://duyplus.github.io/tmdbapi/class-Company.html) and see all the info you can get from a Company Object.

```
$idCompany = 34;
$company = $tmdb->getCompany($idCompany);
// returns a Company Object
echo $company->getName();
```

returns a [Company](https://duyplus.github.io/tmdbapi/class-Company.html) Object.

Credits
-------

[](#credits)

@author [Pixelead0](https://twitter.com/pixelead0) also on [Github](https://github.com/pixelead0)
@author [Deso85](https://twitter.com/Cizero) also on [Github](https://github.com/deso85)
Forked from a similar [project](https://github.com/buibr/tmdbapi) by [Burhan Ibrahimi](https://github.com/buibr)

License
-------

[](#license)

This project is licensed under the [MIT License](https://github.com/duyplus/tmdbapi/blob/master/LICENSE). See the LICENSE file for details.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance45

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

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

Total

2

Last Release

431d ago

Major Versions

0.7 → 1.0.02025-03-14

PHP version history (2 changes)0.7PHP &gt;=5.3.0

1.0.0PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/67746edfba007029beddf9944b03988b1ae5b7924e4e1b9ccff92643b4fce47b?d=identicon)[duyplus](/maintainers/duyplus)

---

Top Contributors

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

---

Tags

apiwrappertmdbcodeigniter4

### Embed Badge

![Health badge](/badges/duyplus-tmdbapi/health.svg)

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

###  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)[wtfzdotnet/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.

4252.9k](/packages/wtfzdotnet-php-tmdb-api)[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)[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)[walle89/swedbank-json

Unofficial API client for the Swedbank's and Sparbanken's mobile apps in Sweden.

752.5k](/packages/walle89-swedbank-json)

PHPackages © 2026

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