duck7000 / themoviedb-api-php
Library for retrieving film and tv information from TMDb (themoviedb) through API
V1.0.5
2026-08-15 12:40 UTC
Requires
- php: >=8.0
- ext-curl: *
- ext-json: *
- psr/log: ^3.0
- psr/simple-cache: ^1.0
README
PHP library for retrieving movie or tv show from TMDb API.
For this to work you need a tmdb API bearer token (not api key!) so you have to create a account to get it
All info is in the wiki pages
https://github.com/duck7000/TMDbAPIPHP/wiki
This library is also available on packagist under name: themoviedb-api-php
Quick Start
- Clone this repo or download the latest [release zip]
- Find a film you want the data for e.g. 1408 https://www.themoviedb.org/movie/3021-1408
- Include
bootstrap.php. - Get some data
Search For Title, person, tv, keyword, company and collection
$Tmdb = new \Tmdb\Search(); $results = $Tmdb->textSearch("1408");
For convert imdbId to tmdbId:
$Tmdb = new \Tmdb\Search(); $results = $Tmdb->imdbToTmdb("tt0450385"); // tt and nm are supported
For Movie:
$title = new \Tmdb\Movie("3021"); $results = $title->fetchMovieData();
For Person:
$person = new \Tmdb\Person("3036"); $results = $person->fetchPersonData();
For Tv series:
$tv = new \Tmdb\Tv("66788"); $results = $tv->fetchTvData();
Installation
Download the latest version or latest git version and extract it to your webserver. Use one of the above methods to get some results
Get the files with one of:
- Git clone. Checkout the latest release tag
- [Zip/Tar download]
Requirements
- PHP >= works from 8.0 - 8.5
- PHP cURL extension
- PHP json extension