PHP SDK for the TMDB API.
Looking for a Laravel package? Check out chiiya/laravel-tmdb
.
- Complete coverage of all non-user related APIv3 endpoints (see here)
- Strongly typed API responses
Install the package via composer:
composer require chiiya/tmdb-php
You will also need to create a v4 auth token for the TMDB API. You can find it under
API > API Read Access Token
in your TMDB account settings.
Create an authenticated client, then use a repository with the client you just created:
use Chiiya\Tmdb\Http\Client;
use Chiiya\Tmdb\Repositories\MovieRepository;
$client = Client::createAuthenticatedClient('your_v4_bearer_token');
$repository = new MovieRepository($client);
$movie = $repository->getMovie(550);
dump($movie->title); // "Fight Club"
$movie = $this->movies->getMovie(550, [
new AppendToResponse([
AppendToResponse::IMAGES,
AppendToResponse::WATCH_PROVIDERS,
]),
]);
$movie->watch_providers['US']->flatrate[0]->provider_name;
$repository->getPopular();
$repository->getNowPlaying();
// ...
This package covers all non-account-related API endpoints. Specifically, this means that all V3 endpoints except for the following ones are supported:
- Account >
*
- Authentication >
*
- Guest Sessions >
*
- Lists >
*
*
> Get Account States*
> Rate Movie/TV*
> Delete Rating*
> Get Lists
Similarly, no v4 API endpoints are covered.
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.