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

ActiveLibrary[API Development](/categories/api)

cointokio/coingecko-api-client
==============================

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

v2.0.0(1y ago)0201GPL-2.0-or-laterPHP

Since Jan 31Pushed 1y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

CoinGecko API Client for WordPress
==================================

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

A PHP client for fetching data from the [CoinGecko API](https://www.coingecko.com/en/api/documentation) 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.

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

[](#installation)

This package is [available on packagist.org](https://packagist.org/packages/cointokio/coingecko-api-client) can be added as a dependency to your project via [Composer](https://getcomposer.org).

`composer require cointokio/coingecko-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 CoinGecko API. Each method represents a separate API endpoint and will either return a list of response data or a [WP\_Error](https://developer.wordpress.org/reference/classes/wp_error/) object. Note that access to the CoinGecko API requires an API key.

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

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

/*
 * Use the ping() method to check the CoinGecko API status.
 *
 * @see https://www.coingecko.com/api/documentations/v3#/ping
 */
$response = $client->ping();

```

The following example uses the `$client->coins()->get_markets()` method to fetch data from CoinGecko's `/coins/markets` endpoint. Note that access to the CoinGecko API requires an API key.

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

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

/*
 * Get a list of price, market cap, volume and market-related data.
 *
 * @see https://www.coingecko.com/api/documentations/v3#/coins/get_coins_markets
 *
 * Note that the $client->coins() method returns an instance of the
 * \Cointokio\CoinGecko\Coins class. This allows us to use the Coins class methods
 * more easily via method chaining, eg.:
 *
 * $client->coins()->get_list()
 * $client->coins()->get_markets()
 *
 * @see https://github.com/cointokio/coingecko-api-client/blob/main/class-client.php#L41
 * @see https://github.com/cointokio/coingecko-api-client/blob/main/classes/class-coins.php
 * @see https://en.wikipedia.org/wiki/Method_chaining
 */
$response = $client->coins()->get_markets(
	'eur',
	array( 'ids' => 'btc, eth' )
);

```

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

[](#coding-standards)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance46

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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

Every ~563 days

Total

3

Last Release

432d ago

Major Versions

v1.0.1 → v2.0.02025-03-03

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

---

Tags

phpapiclientwordpresscoingecko.comCoingecko

### Embed Badge

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

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

###  Alternatives

[kunalvarma05/dropbox-php-sdk

Dropbox PHP API V2 SDK (Unofficial)

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

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[google-gemini-php/symfony

Symfony Bundle for Gemini

149.4k1](/packages/google-gemini-php-symfony)[sima-land/api-php-client

Client library for Simaland APIs

311.5k](/packages/sima-land-api-php-client)

PHPackages © 2026

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