https://github.com/ikoene/marvel-api-client
A PHP Client to handle Marvel API calls
https://github.com/ikoene/marvel-api-client
api-client comics marvel php
Last synced: 4 days ago
JSON representation
A PHP Client to handle Marvel API calls
- Host: GitHub
- URL: https://github.com/ikoene/marvel-api-client
- Owner: ikoene
- License: mit
- Created: 2016-09-23T18:38:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-03T18:39:18.000Z (over 7 years ago)
- Last Synced: 2025-02-08T16:46:27.940Z (8 months ago)
- Topics: api-client, comics, marvel, php
- Language: PHP
- Size: 47.9 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://insight.sensiolabs.com/projects/aff00f1f-c4f7-43de-b3c3-b74ecba4f893)
[](https://travis-ci.org/ikoene/Marvel-API-client)
[](https://scrutinizer-ci.com/g/ikoene/Marvel-API-client/?branch=master)
[](https://packagist.org/packages/ikoene/marvel-api-client)
[](https://packagist.org/packages/ikoene/marvel-api-client)
[](https://github.com/ikoene/Marvel-API-client/blob/master/LICENSE)# Marvel API client
The **Marvel Comics API** allows developers everywhere to access information about Marvel's vast library of comics—from what's coming up, to 70 years ago. This **Marvel API client** helps you explore the Marvel universe with great ease.
## Requirements
* PHP 7.0.0
* [Marvel API key](http://developer.marvel.com/account)
* Love for Marvel## Installation
Add the API client as a dependency to your project using [Composer](https://getcomposer.org/).
```
composer require ikoene/marvel-api-client
```## Usage
```
getCharacter(1009610);var_dump($response);
```### Endpoints
You can call every endpoint with an explicitly defined method. So if you, for example, want a list of comics containing a specific character, you can call `getComicsForCharacter()`.
```
$response = $client->getComicsForCharacter(1009610);
```### Optional filters
It's also possible to add optional filters to the calls. Let's get all comics for 'Spider-Man' which title starts with 'Age of Ultron' and order the results by 'title'.
```
$comicFilter = new \ikoene\Marvel\Entity\ComicFilter();
$comicFilter->setTitleStartsWith('Age of Ultron');
$comicFilter->setOrderBy('title');$response = $client->getComicsForCharacter(1009610, $comicFilter);
```Pretty easy, right?
### Examples
You can find some more examples [here](https://github.com/ikoene/marvel-api-client/tree/master/examples).
## Additional info
* [Marvel API documentation](http://developer.marvel.com/docs)
* [Marvel API terms of use](http://developer.marvel.com/terms)