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

ActiveLibrary[API Development](/categories/api)

cointokio/coinpaprika-api-client
================================

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

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

Since May 24Pushed 2w agoCompare

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

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

CoinPaprika API Client for WordPress
====================================

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

A PHP client for fetching data from the [CoinPaprika API](https://docs.coinpaprika.com/api-reference/rest-api/introduction) 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.

The CoinPaprika API exposes a free tier (no API key required) and a paid tier (`api-pro.coinpaprika.com`). Both are reachable through the same client.

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

[](#installation)

This package is intended to be installed as a Composer dependency:

`composer require cointokio/coinpaprika-api-client`

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 CoinPaprika API. Each method represents a separate API endpoint and will either return the decoded response body as an array or a [WP\_Error](https://developer.wordpress.org/reference/classes/wp_error/) object.

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

/*
 * There are three ways the Client class can be configured:
 *
 * - Pass the API key (and optionally an endpoint) directly like in the
 *   example below.
 * - Define a COINPAPRIKA_API_KEY (and optionally a COINPAPRIKA_API_ENDPOINT)
 *   constant.
 * - Skip both entirely; the client will then target the free endpoint
 *   (https://api.coinpaprika.com/v1) without an Authorization header.
 */
$client = new Cointokio\CoinPaprika\Client( 'your-api-key' );

/*
 * Use the key()->get_info() method to inspect the configured API key.
 * Requires a paid plan (the free tier rejects this endpoint with a 403).
 *
 * @see https://docs.coinpaprika.com/api-reference/key/get-api-key-info
 */
$response = $client->key()->get_info();

```

The following example uses the `$client->tickers()->get()` method to fetch data from the `/tickers/{coin_id}` endpoint:

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

$client = new Cointokio\CoinPaprika\Client();

/*
 * Get the latest ticker for Bitcoin, with prices in USD and EUR.
 *
 * Note that the $client->tickers() method returns an instance of the
 * \Cointokio\CoinPaprika\Tickers class. This allows us to use the Tickers
 * class methods more easily via method chaining, eg.:
 *
 * $client->tickers()->get_list()
 * $client->tickers()->get( 'btc-bitcoin', array( 'quotes' => 'USD,EUR' ) )
 *
 * @see https://docs.coinpaprika.com/api-reference/tickers/get-ticker-for-a-specific-coin
 * @see https://en.wikipedia.org/wiki/Method_chaining
 */
$response = $client->tickers()->get(
	'btc-bitcoin',
	array( 'quotes' => 'USD,EUR' )
);

```

Free vs paid endpoints
----------------------

[](#free-vs-paid-endpoints)

CoinPaprika serves the free tier from `https://api.coinpaprika.com/v1` and the paid tiers from `https://api-pro.coinpaprika.com/v1`. The API key only authorises requests against the pro endpoint. To keep secrets from leaking, this client only attaches the `Authorization` header when the configured endpoint host matches one of the two recognised CoinPaprika hosts; requests to any other host (eg. a local mock or proxy) are sent without the header.

`quotes` limit
--------------

[](#quotes-limit)

The `/tickers` and `/tickers/{coin_id}` endpoints accept a comma-separated `quotes` parameter (eg. `USD,EUR,BTC`), capped at **3 quotes per request**. When you need more conversions, issue one request per chunk of three:

```
foreach ( array_chunk( $fiats, 3 ) as $chunk ) {
    $response = $client->tickers()->get( 'btc-bitcoin', array(
        'quotes' => implode( ',', $chunk ),
    ) );
    // Aggregate per-chunk responses into your own structure.
}

```

Coin ID format
--------------

[](#coin-id-format)

CoinPaprika coin IDs follow the pattern `{symbol}-{name}` (lowercase, hyphens for spaces). Examples: `btc-bitcoin`, `eth-ethereum`, `usdt-tether`, `sol-solana`. Use `$client->tools()->search( $query )` to look up the correct id for any coin.

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

Popularity7

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 (1 commits)")

---

Tags

phpapiclientwordpresscoinpaprikacoinpaprika.com

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/cointokio-coinpaprika-api-client/health.svg)](https://phpackages.com/packages/cointokio-coinpaprika-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)
