PHPackages                             npabisz/coingecko-api - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. npabisz/coingecko-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

npabisz/coingecko-api
=====================

PHP API Client for CoinGecko.com

v1.0.0(3y ago)034MITPHPPHP &gt;=7.2

Since Dec 1Pushed 3y ago1 watchersCompare

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

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

PHP API Client for CoinGecko.com
================================

[](#php-api-client-for-coingeckocom)

PHP API client for [coingecko.com](https://coingecko.com).

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2
- ext-json

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

[](#installation)

```
composer require npabisz/coingecko-api
```

Example
-------

[](#example)

```
use CoinGecko\Client;

// Basic usage
$client = new Client();

// Modify underlying HTTP client config
$client = new Client([], [
    'timeout' => 15,
])

// Use PRO api
$client = new Client([
    'api_mode' => 'pro',
    'api_key' => '************',
]);

$response = $client->Ping->get();
```

### [Ping](https://www.coingecko.com/api/documentations/v3#/ping)

[](#ping)

```
// [/ping]
$response = $client->Ping->get();
```

### [Simple](https://www.coingecko.com/api/documentations/v3#/simple/get_simple_price)

[](#simple)

```
// [/simple/price]
$response = $client->Simple->Price->get([
    'ids' => 'bitcoin',
    'vs_currencies' => 'usd',
]);

// [/simple/token_price/{id}]
$response = $client->Simple->TokenPrice('ethereum')->get([
    'contract_addresses' => '0xdac17f958d2ee523a2206206994597c13d831ec7',
    'vs_currencies' => 'usd',
]);

// [/simple/supported_vs_currencies]
$response = $client->Simple->SupportedVsCurrencies->get()
```

### [Coins](https://www.coingecko.com/api/documentations/v3#/coins/get_coins_list)

[](#coins)

```
// [/coins/list]
$response = $client->Coins->List->get();

// [/coins/markets]
$response = $client->Coins->Markets->get([
    'vs_currency' => 'usd',
]);

// [/coins/{id}]
$response = $client->Coins('bitcoin')->get();

// [/coins/{id}/tickers]
$response = $client->Coins('bitcoin')->Tickers->get();

// [/coins/{id}/history]
$response = $client->Coins('bitcoin')->History->get([
    'date' => '30-11-2022'
]);

// [/coins/{id}/market_chart]
$response = $client->Coins('bitcoin')->MarketChart->get([
    'vs_currency' => 'usd',
    'days' => 7,
]);

// [/coins/{id}/market_chart/range]
$response = $client->Coins('bitcoin')->MarketChart->Range->get([
    'vs_currency' => 'usd',
    'from' => 1669676400,
    'to' => 1669762800,
]);

// [/coins/{id}/ohlc]
$response = $client->Coins('bitcoin')->Ohlc->get([
    'vs_currency' => 'usd',
    'days' => 7,
]);
```

### [Contract](https://www.coingecko.com/api/documentations/v3#/contract)

[](#contract)

```
// [/coins/{id}/contract/{contract_address}]
$response = $client->Coins('ethereum')->Contract('0xdac17f958d2ee523a2206206994597c13d831ec7')->get();

// [/coins/{id}/contract/{contract_address}/market_chart]
$response = $client->Coins('ethereum')->Contract('0xdac17f958d2ee523a2206206994597c13d831ec7')->MarketChart->get([
    'vs_currency' => 'usd',
    'days' => 7,
]);

// [/coins/{id}/contract/{contract_address}/market_chart/range]
$response = $client->Coins('ethereum')->Contract('0xdac17f958d2ee523a2206206994597c13d831ec7')->MarketChart->Range->get([
    'vs_currency' => 'usd',
    'from' => 1669676400,
    'to' => 1669762800,
]);
```

### [AssetsPlatforms](https://www.coingecko.com/api/documentations/v3#/asset_platforms/get_asset_platforms)

[](#assetsplatforms)

```
// [/assets_platforms]
$response = $client->AssetPlatforms->get();
```

### [Categories](https://www.coingecko.com/api/documentations/v3#/categories/get_coins_categories_list)

[](#categories)

```
// [/coins/categories]
$response = $client->Coins->Categories->get();

// [/coins/categories/list]
$response = $client->Coins->Categories->List->get();
```

### [Exchanges](https://www.coingecko.com/api/documentations/v3#/exchanges)

[](#exchanges)

```
// [/exchanges]
$response = $client->Exchanges->get();

// [/exchanges/list]
$response = $client->Exchanges->List->get();

// [/exchanges/{id}]
$response = $client->Exchanges('binance')->get();

// [/exchanges/{id}/tickers]
$response = $client->Exchanges('binance')->Tickers->get();

// [/exchanges/{id}/volume_chart]
$response = $client->Exchanges('binance')->VolumeChart->get([
    'days' => 7,
]);
```

### [Indexes](https://www.coingecko.com/api/documentations/v3#/indexes/get_indexes)

[](#indexes)

```
// [/indexes]
$response = $client->Indexes->get();

// [/indexes/{market_id}/{id}]
$response = $client->Indexes($marketId, $id)->get();

// [/indexes/list]
$response = $client->Indexes->List->get();
```

### [Derivatives](https://www.coingecko.com/api/documentations/v3#/derivatives/get_derivatives)

[](#derivatives)

```
// [/derivatives]
$response = $client->Derivatives->get();

// [/derivatives/exchanges]
$response = $client->Derivatives->Exchanges->get();

// [/derivatives/exchanges/list]
$response = $client->Derivatives->Exchanges()->List->get();

// [/derivatives/exchanges/{id}]
$response = $client->Derivatives->Exchanges('binance_futures')->get();
```

### [NFTs](https://www.coingecko.com/api/documentations/v3#/nfts%20(beta)/get_nfts_list)

[](#nfts)

```
// [/nfts/list]
$response = $client->Nfts->List->get();

// [/nfts/{id}]
$response = $client->Nfts('8bit')->get();

// [/nfts/{asset_platform_id}/contract/{contract_address}]
$response = $client->Nfts('ethereum')->Contract('0xaae71bbbaa359be0d81d5cbc9b1e88a8b7c58a94')->get();
```

### [ExchangeRates](https://www.coingecko.com/api/documentations/v3#/exchange_rates)

[](#exchangerates)

```
// [/exchange_rates]
$response = $client->ExchangeRates->get();
```

### [Search](https://www.coingecko.com/api/documentations/v3#/search)

[](#search)

```
// [/search]
$response = $client->Search->get([
    'query' => 'bitcoin',
]);
```

### [Trending](https://www.coingecko.com/api/documentations/v3#/trending/get_search_trending)

[](#trending)

```
// [/search/trending]
$response = $client->Search->Trending->get();
```

### [Global](https://www.coingecko.com/api/documentations/v3#/global)

[](#global)

```
// [/global]
$response = $client->Global->get();

// [/global/decentralized_finance_defi]
$response = $client->Global->DecentralizedFinanceDefi->get();
```

### [Companies](https://www.coingecko.com/api/documentations/v3#/companies%20(beta))

[](#companies)

```
// [/companies/public_treasury/{coin_id}]
$response = $client->Companies->PublicTreasury('ethereum')->get();
```

### [API PRO Version](https://coingeckoapi.notion.site/coingeckoapi/CoinGecko-Pro-API-exclusive-endpoints-529f4bb5c4d84d5fad797b09cfdb4b53)

[](#api-pro-version)

```
// [/nfts/markets]
$response = $client->Nfts->Markets->get();

// [/nfts/{id}/market_chart]
$response = $client->Nfts('8bit')->MarketChart->get();

// [/nfts/{id}/tickers]
$response = $client->Nfts('8bit')->Tickers->get();

// [/global/market_cap_chart]
$response = $client->Global->MarketCapChart->get();
```

License
-------

[](#license)

`npabisz/coingecko-api` is released under the MIT License. See the bundled [LICENSE](./LICENSE) for details.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

Unknown

Total

1

Last Release

1254d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

phpapiclientrestcoingecko.com

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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