A PHP client for use with the Marvel API.
The Marvel API Client requires PHP 7.0 (or later).
To add the library as a local, per-project dependency use Composer! Simply add a dependency on chadicus/marvel-api-client
to your project's composer.json
file such as:
composer require chadicus/marvel-api-client
Examples of use can be found here
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Chadicus\Marvel\Api\Client;
$publicApiKey = 'YOUR PUBLIC API KEY';
$privateApiKey = 'YOUR PRIVATE API KEY';
$client = new Client($privateApiKey, $publicApiKey);
$dataWrapper = $client->get('characters', 1009351);
//Text to display for attribution requirements
$attributionText = $dataWrapper->getAttributionText();
$character = $dataWrapper->getData()->getResults()[0];
echo "{$character->getName()}\n";
echo "{$character->getDescription()}\n";
foreach ($character->getEvents()->getItems() as $event) {
echo "\t{$event->getName()}\n";
}
Developers may be contacted at:
With a checkout of the code get Composer in your PATH and run:
composer install
./vendor/bin/phpunit
When using the marvel-api-client
you must follow Marvel's Rules of Attribution