PHPackages                             lukaszzychal/tmdb-client-php - 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. lukaszzychal/tmdb-client-php

ActiveLibrary[API Development](/categories/api)

lukaszzychal/tmdb-client-php
============================

A comprehensive PHP client for The Movie Database (TMDB) API

1.0.2(5mo ago)11.3k—0%MITPHPPHP ^8.1CI failing

Since Oct 15Pushed 5mo agoCompare

[ Source](https://github.com/lukaszzychal/tmdb-client-php)[ Packagist](https://packagist.org/packages/lukaszzychal/tmdb-client-php)[ RSS](/packages/lukaszzychal-tmdb-client-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (10)Versions (4)Used By (0)

TMDB Client PHP
===============

[](#tmdb-client-php)

[![CI/CD Pipeline](https://github.com/lukaszzychal/tmdb-client-php/workflows/CI/CD%20Pipeline/badge.svg)](https://github.com/lukaszzychal/tmdb-client-php/actions)[![Monthly Contract Tests](https://github.com/lukaszzychal/tmdb-client-php/workflows/Monthly%20Contract%20Tests/badge.svg)](https://github.com/lukaszzychal/tmdb-client-php/actions)[![Dependabot](https://camo.githubusercontent.com/fcea5968d1fd45751aa4913ff68a9b4c7fe2fc00d7441decfb3de486aca5d719/68747470733a2f2f6170692e646570656e6461626f742e636f6d2f6261646765732f7374617475733f646570656e64656e63792d6d616e616765723d636f6d706f736572267265706f7369746f72792d69643d313233343536373839)](https://github.com/lukaszzychal/tmdb-client-php/network/updates)[![Latest Stable Version](https://camo.githubusercontent.com/e7d087549e32a5d242f34f3f076e0765fc0e31c77e1f12e09cdc7dc72414b344/68747470733a2f2f706f7365722e707567782e6f72672f6c756b61737a7a796368616c2f746d64622d636c69656e742d7068702f762f737461626c65)](https://packagist.org/packages/lukaszzychal/tmdb-client-php)[![Total Downloads](https://camo.githubusercontent.com/138700079702453a615bfad60e91e99d6073d37a5262aa9ab3020d130f59c8b3/68747470733a2f2f706f7365722e707567782e6f72672f6c756b61737a7a796368616c2f746d64622d636c69656e742d7068702f646f776e6c6f616473)](https://packagist.org/packages/lukaszzychal/tmdb-client-php)[![License](https://camo.githubusercontent.com/d43d937c6a67a2bd8e309c49eaf51030576182bbd9d17b93f27268599f5e96b0/68747470733a2f2f706f7365722e707567782e6f72672f6c756b61737a7a796368616c2f746d64622d636c69656e742d7068702f6c6963656e7365)](https://packagist.org/packages/lukaszzychal/tmdb-client-php)[![Code Coverage](https://camo.githubusercontent.com/751f8e541548b9c11b7f10f0f4410a4e67ad6969c0462b383f1c0509404abb4b/68747470733a2f2f636f6465636f762e696f2f67682f6c756b61737a7a796368616c2f746d64622d636c69656e742d7068702f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/lukaszzychal/tmdb-client-php)

A comprehensive PHP client for The Movie Database (TMDB) API built with modern PHP practices and full test coverage.

**Author:** [Łukasz Zychal](https://github.com/lukaszzychal)

⚖️ TMDB License Compliance
--------------------------

[](#️-tmdb-license-compliance)

This client is designed to help you comply with [TMDB API Terms of Service](https://www.themoviedb.org/documentation/api/terms-of-use). When using this client, you must:

- ✅ **Include TMDB Attribution** - Display "This product uses the TMDB API but is not endorsed or certified by TMDB"
- ✅ **Use Official TMDB Logo** - Include the TMDB logo when displaying data
- ✅ **Respect Rate Limits** - This client includes built-in rate limiting
- ✅ **Handle Errors Properly** - Use the provided exception handling

See [TMDB\_LICENSE\_COMPLIANCE.md](TMDB_LICENSE_COMPLIANCE.md) for detailed requirements and examples.

Features
--------

[](#features)

- 🎬 **Complete TMDB API Coverage** - Movies, TV Shows, People, Search, Configuration, Genres
- 🚀 **Modern PHP** - Built for PHP 8.1+ with strict types and PSR compliance
- 🛡️ **Type Safety** - Full type declarations and static analysis support
- 🧪 **Comprehensive Testing** - Unit, integration, and contract tests
- 📊 **CI/CD Pipeline** - Automated testing, code quality, and security scanning
- 📚 **Well Documented** - Complete API documentation and examples
- 🔧 **PSR Standards** - PSR-4 autoloading, PSR-3 logging, PSR-7 HTTP messages
- ⚡ **Guzzle Integration** - Built on top of Guzzle HTTP client
- 🎯 **Exception Handling** - Specific exceptions for different error types

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

[](#installation)

Install via Composer:

```
composer require lukaszzychal/tmdb-client-php
```

Configuration
-------------

[](#configuration)

### 1. Get TMDB API Key

[](#1-get-tmdb-api-key)

1. Visit [themoviedb.org](https://www.themoviedb.org/settings/api)
2. Create an account or log in
3. Request an API key
4. Copy your API key

### 2. Configure API Key

[](#2-configure-api-key)

**Option A: Using .env file (Recommended)**

```
# Copy the example environment file
cp .env.example .env

# Edit .env and replace 'your-tmdb-api-key-here' with your actual API key
nano .env
```

**Option B: Environment Variable**

```
export TMDB_API_KEY="your-actual-api-key"
```

Quick Start
-----------

[](#quick-start)

```
