Download the PHP package zero-to-prod/omdb-api without Composer
On this page you can find all versions of the php package zero-to-prod/omdb-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zero-to-prod/omdb-api
More information about zero-to-prod/omdb-api
Files in zero-to-prod/omdb-api
Package omdb-api
Short Description A cURL wrapper for the OMDb API
License MIT
Homepage https://github.com/zero-to-prod/omdb-api
Informations about the package omdb-api
Zerotoprod\OmdbApi
Zerotoprod\OmdbApi
is a PHP cURL wrapper for the OMDb API.
It allows you to search for movies, series, and other media, retrieve detailed information using IMDb IDs or titles, and fetch poster images.
TLDR
Requirements
- PHP 8.0 or higher.
- cURL extension enabled (typically enabled by default in most PHP installations).
- A valid OMDb API key. A free key is typically available.
Getting an OMDb API Key
- Go to the OMDb API website.
- Sign up for a free or paid plan depending on your usage requirements.
- After registering, you will receive an API Key that you must pass to the OmdbApi class during initialization.
Installation
Install Zerotoprod\OmdbApi
via Composer:
This will add the package to your project’s dependencies and create an autoloader entry for it.
Usage
Initialization
You can also customize the base URL and the poster URL if you need to (for example, to proxy through another service):
Methods Overview
Below is a summary of the primary methods exposed by this package:
byIdOrTitle()
Retrieve detailed information about a specific movie, TV series, or episode by either its IMDb ID or title.
Returns on Error
Returns Data
search()
Search for multiple titles using a keyword.
Returns on Error
Returns Data
poster()
Get the direct URL to the poster image for a given IMDb ID.
Error Handing
When a request fails (for example, if no matching title is found, cURL fails to initialize, or an invalid response comes back), the returned array includes:
Testing
This package uses PHPUnit for testing. Run the tests locally:
Ensure you have installed all the development dependencies (composer install) before running the tests.
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
All versions of omdb-api with dependencies
ext-curl Version *