PHPackages                             cointokio/coinmarketcap-api-client - 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. cointokio/coinmarketcap-api-client

ActiveLibrary[API Development](/categories/api)

cointokio/coinmarketcap-api-client
==================================

Fetch data from the CoinMarketCap API, intended for use in WordPress plugins or themes.

v1.0.0(2w ago)05GPL-2.0-or-laterPHP

Since May 24Pushed 2w agoCompare

[ Source](https://github.com/cointokio/coinmarketcap-api-client)[ Packagist](https://packagist.org/packages/cointokio/coinmarketcap-api-client)[ Docs](https://github.com/cointokio/coinmarketcap-api-client)[ RSS](/packages/cointokio-coinmarketcap-api-client/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

CoinMarketCap API Client for WordPress
======================================

[](#coinmarketcap-api-client-for-wordpress)

A PHP client for fetching data from the [CoinMarketCap Pro Cryptocurrency API](https://pro.coinmarketcap.com/api/documentation/pro-api-reference/cryptocurrency) endpoint intended to be used in WordPress plugins or themes. Being a good WordPress citizen, this client uses the WordPress core [HTTP API](https://developer.wordpress.org/plugins/http-api/) to fetch its data.

Note that this package only covers the Cryptocurrency endpoint family, with the addition of the [Key Info](https://pro.coinmarketcap.com/api/documentation/pro-api-reference/cryptocurrency) endpoint for use as a health probe.

Use
---

[](#use)

Include the main `class-client.php` file and create an instance of the `Client` class and use its methods to fetch data from the CoinMarketCap API. Each method maps to one of the [Implemented endpoints](#implemented-endpoints) listed above and will either return the decoded response body as an array or a [WP\_Error](https://developer.wordpress.org/reference/classes/wp_error/) object. Note that access to the CoinMarketCap API requires an API key.

```
require_once '/your/cool/path/to/coinmarketcap-client/class-client.php';

/*
 * There are two ways the Client class can use your CoinMarketCap API key:
 *
 * - Pass the API key to the Client class directly like in the example below.
 * - Define a global COINMARKETCAP_API_KEY constant.
 */
$client = new Cointokio\CoinMarketCap\Client( 'your-api-key' );

/*
 * Use the key()->get_info() method to inspect the configured API key
 * (does not consume call credits).
 *
 * @see https://pro.coinmarketcap.com/api/documentation/pro-api-reference/tools/key-info
 */
$response = $client->key()->get_info();

```

The following example uses the `$client->cryptocurrency()->quotes_latest()` method to fetch data from the `/v3/cryptocurrency/quotes/latest` endpoint.

```
require_once '/your/cool/path/to/coinmarketcap-client/class-client.php';

$client = new Cointokio\CoinMarketCap\Client( 'your-api-key' );

/*
 * Get the latest market quote for one or more cryptocurrencies. The
 * `convert` argument bundles multiple fiat conversions into a single call.
 *
 * @see https://pro.coinmarketcap.com/api/documentation/pro-api-reference/cryptocurrency/cryptocurrency-quotes-latest
 *
 * Note that the $client->cryptocurrency() method returns an instance of the
 * \Cointokio\CoinMarketCap\Cryptocurrency class. This allows us to use the
 * Cryptocurrency class methods more easily via method chaining, eg.:
 *
 * $client->cryptocurrency()->quotes_latest()
 *
 * @see https://en.wikipedia.org/wiki/Method_chaining
 */
$response = $client->cryptocurrency()->quotes_latest( '1,1027', 'USD,EUR' );

```

### `convert` limit

[](#convert-limit)

Every CoinMarketCap plan caps the number of `convert` values accepted per `quotes/latest` request, with the free Basic plan capped at one. Bundling more than the per-plan cap into a single call is rejected with a `400` ("Your plan is limited to N convert options"), surfaced by the client as `WP_Error( 'http_400', ... )`. To stay portable across plan tiers, issue one `quotes_latest()` request per fiat:

```
foreach ( $fiats as $fiat ) {
    $response = $client->cryptocurrency()->quotes_latest( $ids_csv, $fiat );
    // Aggregate per-fiat responses into your own structure.
}

```

Coding Standards
----------------

[](#coding-standards)

This project aims to adhere to the [VIP Coding Standards](https://github.com/Automattic/VIP-Coding-Standards).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance97

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

16d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc3005a412327fcadf1d65f43882764e5ab756255cfa17bbf0f65913ffd76f22?d=identicon)[cointokio](/maintainers/cointokio)

---

Top Contributors

[![barryceelen](https://avatars.githubusercontent.com/u/4179791?v=4)](https://github.com/barryceelen "barryceelen (2 commits)")

---

Tags

phpapiclientwordpresscoinmarketcapcoinmarketcap.com

### Embed Badge

![Health badge](/badges/cointokio-coinmarketcap-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/cointokio-coinmarketcap-api-client/health.svg)](https://phpackages.com/packages/cointokio-coinmarketcap-api-client)
```

###  Alternatives

[kunalvarma05/dropbox-php-sdk

Dropbox PHP API V2 SDK (Unofficial)

3683.1M18](/packages/kunalvarma05-dropbox-php-sdk)[mozex/anthropic-php

PHP client for the Anthropic API: messages, streaming, tool use, thinking, web search, code execution, batches, and more.

49480.9k16](/packages/mozex-anthropic-php)[google-gemini-php/symfony

Symfony Bundle for Gemini

1412.3k2](/packages/google-gemini-php-symfony)

PHPackages © 2026

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