php-mtg / mtg-api-com-scryfall-object
A library that implements the php-mtg/mtg-api-com-scryfall-interface
Package info
gitlab.com/php-mtg/mtg-api-com-scryfall-object
pkg:composer/php-mtg/mtg-api-com-scryfall-object
9.0.6
2026-05-20 19:28 UTC
Requires
Requires (Dev)
This package is auto-updated.
Last update: 2026-05-20 17:28:40 UTC
README
A library that implements the php-mtg/mtg-api-com-scryfall-interface.
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.pharfrom their website. - Then run the following command to install this library as dependency :
php composer.phar php-mtg/mtg-api-com-scryfall-object ^9
Basic Usage
This library may be used the following way :
use PhpMtg\Scryfall\ScryfallApiEndpoint;
/* @var $client \Psr\Http\Client\ClientInterface */
$endpoint = new ScryfallApiEndpoint($client);
$collection = $endpoint->getSets();
foreach($collection as $set)
{
$page = 1;
do
{
/** @var \PhpMtg\Scryfall\ScryfallApiPagination $pagination */
$pagination = $endpoint->getCardsSearch($page, 'e='.$set->getId());
foreach($pagination->getData() as $card)
{
// do something with $card
}
$page++;
}
while($pagination->hasMore());
}
License
MIT (See license file).