PHPackages                             mamoot/cardmarket-php-sdk - 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. mamoot/cardmarket-php-sdk

ActiveLibrary[API Development](/categories/api)

mamoot/cardmarket-php-sdk
=========================

Wrap Cardmarket API with PHP

1104[7 issues](https://github.com/mamoot64/cardmarket-php-sdk/issues)[4 PRs](https://github.com/mamoot64/cardmarket-php-sdk/pulls)PHP

Since Oct 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mamoot64/cardmarket-php-sdk)[ Packagist](https://packagist.org/packages/mamoot/cardmarket-php-sdk)[ RSS](/packages/mamoot-cardmarket-php-sdk/feed)WikiDiscussions develop Synced 2d ago

READMEChangelogDependenciesVersions (7)Used By (0)

Cardmarket PHP SDK
==================

[](#cardmarket-php-sdk)

🔥 **WORK IN PROGRESS**

[![Build Status](https://camo.githubusercontent.com/c51baa9c28fcd09de67a2349630a2629d88edc379ea1463df6900cb6d7b1adbb/68747470733a2f2f7472617669732d63692e6f72672f6d616d6f6f7436342f636172646d61726b65742d7068702d73646b2e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/mamoot64/cardmarket-php-sdk)

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

[](#installation)

Use [Composer](http://getcomposer.org/) to install the package:

```
$ composer require mamoot/cardmarket-php-sdk

```

Usage and examples
------------------

[](#usage-and-examples)

### Init the Cardmarket client

[](#init-the-cardmarket-client)

```
use Mamoot\CardMarket\Cardmarket;
use Mamoot\CardMarket\HttpClient\HttpClientCreator;

$httpCreator = new HttpClientCreator();
$httpCreator->setApplicationToken('your_application_token')
            ->setApplicationSecret('your_application_secret')
            ->setAccessToken('your_access_token')
            ->setAccessSecret('your_access_secret');

$cardmarket = new Cardmarket($httpCreator);
```

### Play with!

[](#play-with)

Retrieve all TCG Games from CardMarket

```
$cardmarket->games()->getGamesList());
```

Retrieve all expansions by game.

```
// All pokemon expansions
$cardmarket->expansions()->getExpansionsListByGame(6);

// All Magic The Gathering expansions
$cardmarket->expansions()->getExpansionsListByGame(1);
```

Retrieve all cards for a given expansion.

```
// All Pokemon cards of the Jungle expansion
$cardmarket->expansions()->getCardsListByExpansion(1525);
```

Retrieve the details and price guide of a single card

```
// Cards details for "Electrode (Holo) - Jungle expansion"
$cardmarket->cards()->getCardsDetails(273799);
```

### Add your custom Resources

[](#add-your-custom-resources)

It's not really a part of the Cardmarket SDK but if want to organize your work, it can be a good place!

```
namespace Vendor\MyNamespace;

use Mamoot\CardMarket\Resources\HttpCaller;

class MyPokemonResource extends HttpCaller
{
    public function getOrderedExpansions(): array
    {
        // do stuff
    }
}
```

```
use Vendor\MyNamespace\MyPokemonResource;

$cardmarket = new Cardmarket($httpCreator);
$cardmarket->registerResources('pokemon', MyPokemonResource::class);
```

Now you can manipulate your resource like the default provided :

```
$cardmarket->pokemon()->getOrderedExpansions();
```

> You can't redefined default resources

### Get your CSV stock files

[](#get-your-csv-stock-files)

Get your MTG CSV file from CardMarket into your disk

```
// 1 = (gameId) Magic The Gathering
$magicStock = $cardmarket->stock()->getStockFile(1);
```

Now, you can use the Helper `CsvStockFileHelper` to store data on your disk.

```
use \Mamoot\CardMarket\Helper\CsvStockFileHelper;

$stockHelper = new CsvStockFileHelper($magicStock['stock']);
$stockHelper->storeStockFileOnDisk("./mtg.csv");
```

### Execute test suite

[](#execute-test-suite)

If you want to run the tests you should run the following commands:

```
git clone git@github.com:mamoot64/cardmarket-php-sdk.git
cd cardmarket-php-sdk
composer install
composer test

```

If you want to generate coverage with HTML report, run:

```
composer test-coverage-html

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance9

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f7125a1568f9e92a454e5a9681c8bc8f9f602550a939ce2e374ca7e4f703940?d=identicon)[mamoot](/maintainers/mamoot)

---

Top Contributors

[![mamoot64](https://avatars.githubusercontent.com/u/6313848?v=4)](https://github.com/mamoot64 "mamoot64 (47 commits)")[![brambaud](https://avatars.githubusercontent.com/u/9115419?v=4)](https://github.com/brambaud "brambaud (5 commits)")

---

Tags

hacktoberfest

### Embed Badge

![Health badge](/badges/mamoot-cardmarket-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/mamoot-cardmarket-php-sdk/health.svg)](https://phpackages.com/packages/mamoot-cardmarket-php-sdk)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
