chiiya / tmdb-php
PHP SDK for the TMDB API
Fund package maintenance!
chiiya
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.4
- spatie/data-transfer-object: ^3.7
Requires (Dev)
- blastcloud/guzzler: ^2.0
- chiiya/code-style-php: ^2.9
- phpro/grumphp: ^1.12
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^6.1
This package is auto-updated.
Last update: 2024-11-09 08:23:38 UTC
README
PHP SDK for the TMDB API.
Looking for a Laravel package? Check out chiiya/laravel-tmdb
.
Features
- Complete coverage of all non-user related APIv3 endpoints (see here)
- Strongly typed API responses
Installation
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.
Usage
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(); // ...
API Coverage
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.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.