PHPackages                             andrijdavid/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. [API Development](/categories/api)
4. /
5. andrijdavid/coingecko-api

ActiveLibrary[API Development](/categories/api)

andrijdavid/coingecko-api
=========================

PHP REST API client for coingecko.com

03PHP

Since Mar 16Pushed 1y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

PHP API client for coingecko.com
================================

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

[![Build Status](https://camo.githubusercontent.com/f6e1fb4b82997397e954be9a73142a54e035b1e5a4a00017c4966122e7e0231a/68747470733a2f2f7472617669732d63692e636f6d2f636f64656e69782d73762f636f696e6765636b6f2d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/codenix-sv/coingecko-api)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/68400305ab41be0b6aaaf57daae9ae454629212f82cbbba84fbb3a8fdd160c68/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f64656e69782d73762f636f696e6765636b6f2d6170692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/codenix-sv/coingecko-api/?branch=master)[![Test Coverage](https://camo.githubusercontent.com/c9b1cc2da7432c05d9457f58446670f19918fb79699eeb2c6fb1cf0520f3b431/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f36353030313539373666323830363431383232612f746573745f636f766572616765)](https://codeclimate.com/github/codenix-sv/coingecko-api/test_coverage)[![Maintainability](https://camo.githubusercontent.com/139767bedba770ce300e6539171460bddab0962d6e801f3154b1f3a8c234a28c/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f36353030313539373666323830363431383232612f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/codenix-sv/coingecko-api/maintainability)[![License: MIT](https://camo.githubusercontent.com/31699d26b2308d473ec043a3b79d8ffce7b954bbb7476ba5721e0dea42925bcd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f64656e69782d73762f636f696e6765636b6f2d617069)](https://github.com/codenix-sv/coingecko-api/blob/master/LICENSE)

[![image info](./CoinGeckoLogo.png)](./CoinGeckoLogo.png)

A simple API client, written with PHP for [coingecko.com](https://coingecko.com).

CoinGecko provides a fundamental analysis of the crypto market. In addition to tracking price, volume and market capitalization, CoinGecko tracks community growth, open-source code development, major events and on-chain metrics.

For additional information about API visit [coingecko.com/api](https://www.coingecko.com/api)

CoinGecko API [Terms of Service](https://www.coingecko.com/en/api_terms)

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

[](#requirements)

- PHP &gt;= 7.2
- ext-json

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ composer require codenix-sv/coingecko-api
```

or add

```
"codenix-sv/coingecko-api": "^1.0"
```

Basic usage
-----------

[](#basic-usage)

### Example

[](#example)

```
use Codenixsv\CoinGeckoApi\CoinGeckoClient;

$client = new CoinGeckoClient();
$data = $client->ping();
```

You can get last response (`ResponseInterface::class`) uses `getLastResponse` method:

```
use Codenixsv\CoinGeckoApi\CoinGeckoClient;

$client = new CoinGeckoClient();
$data = $client->derivatives()->getExchanges();
$response = $client->getLastResponse();
$headers = $response->getHeaders();
```

Available methods
-----------------

[](#available-methods)

### Ping

[](#ping)

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

[](#ping-1)

Check API server status

```
$data = $client->ping();
```

### Simple

[](#simple)

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

[](#getprice)

Get the current price of any cryptocurrencies in any other supported currencies that you need.

```
$data = $client->simple()->getPrice('0x,bitcoin', 'usd,rub');
```

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

[](#gettokenprice)

Get current price of tokens (using contract addresses) for a given platform in any other currency that you need.

```
$data = $client->simple()->getTokenPrice('ethereum','0xE41d2489571d322189246DaFA5ebDe1F4699F498', 'usd,rub');
```

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

[](#getsupportedvscurrencies)

Get list of supported\_vs\_currencies.

```
$data = $client->simple()->getSupportedVsCurrencies();
```

### Coins

[](#coins)

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

[](#getlist)

List all supported coins id, name and symbol (no pagination required)

```
$data = $client->coins()->getList();
```

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

[](#getmarkets)

List all supported coins price, market cap, volume, and market related data

```
$data = $result = $client->coins()->getMarkets('usd');
```

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

[](#getcoin)

Get current data (name, price, market, ... including exchange tickers) for a coin

```
$result = $client->coins()->getCoin('bitcoin', ['tickers' => 'false', 'market_data' => 'false']);
```

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

[](#gettickers)

Get coin tickers (paginated to 100 items)

```
$result = $client->coins()->getTickers('bitcoin');
```

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

[](#gethistory)

Get historical data (name, price, market, stats) at a given date for a coin

```
$result = $client->coins()->getHistory('bitcoin', '30-12-2017');
```

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

[](#getmarketchart)

Get historical market data include price, market cap, and 24h volume (granularity auto)

```
$result = $client->coins()->getMarketChart('bitcoin', 'usd', 'max');
```

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

[](#getmarketchartrange)

Get historical market data include price, market cap, and 24h volume within a range of timestamp (granularity auto)

```
$result = $client->coins()->getMarketChartRange('bitcoin', 'usd', '1392577232', '1422577232');
```

#### [getMarketChartRange](https://www.coingecko.com/api/documentations/v3#/coins/get_coins__id__status_updates) \[BETA\]

[](#getmarketchartrange-beta)

Get status updates for a given coin

```
$result = $client->coins()->getStatusUpdates('0x');
```

### Contract

[](#contract)

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

[](#getcontract)

Get coin info from contract address

```
$data = $client->contract()->getContract('ethereum', '0xE41d2489571d322189246DaFA5ebDe1F4699F498');
```

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

[](#getmarketchart-1)

Get historical market data include price, market cap, and 24h volume (granularity auto) from a contract address

```
$result = $client->contract()->getMarketChart('ethereum', '0xE41d2489571d322189246DaFA5ebDe1F4699F498', 'usd', '1');
```

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

[](#getmarketchartrange-1)

Get historical market data include price, market cap, and 24h volume within a range of timestamp (granularity auto) from a contract address

```
$result = $result = $client->contract()->getMarketChartRange('ethereum', '0xE41d2489571d322189246DaFA5ebDe1F4699F498', 'usd', '11392577232', ' 1422577232');
```

### Exchange \[BETA\]

[](#exchange-beta)

#### [getExchanges](https://www.coingecko.com/api/documentations/v3#/exchanges_(beta)/get_exchanges)

[](#getexchanges)

List all exchanges

```
$data = $client->exchanges()->getExchanges();
```

#### [getList](https://www.coingecko.com/api/documentations/v3#/exchanges_(beta)/get_exchanges_list)

[](#getlist-1)

List all supported markets id and name (no pagination required)

```
$data = $client->exchanges()->getList();
```

#### [getExchange](https://www.coingecko.com/api/documentations/v3#/exchanges_(beta)/get_exchanges__id_)

[](#getexchange)

Get exchange volume in BTC and top 100 tickers only

```
$data = $client->exchanges()->getExchange('binance');
```

#### [getTickers](https://www.coingecko.com/api/documentations/v3#/exchanges_(beta)/get_exchanges__id__tickers)

[](#gettickers-1)

Get exchange tickers (paginated)

```
$data = $client->exchanges()->getTickers('binance', ['coin_ids' => '0x,bitcoin']);
```

#### [getStatusUpdates](https://www.coingecko.com/api/documentations/v3#/exchanges_(beta)/get_exchanges__id__status_updates)

[](#getstatusupdates)

Get status updates for a given exchange (beta)

```
$data = $client->exchanges()->getStatusUpdates('binance');
```

#### [getVolumeChart](https://www.coingecko.com/api/documentations/v3#/exchanges_(beta)/get_exchanges__id__volume_chart)

[](#getvolumechart)

Get volume\_chart data for a given exchange (beta)

```
$data = $client->exchanges()->getVolumeChart('binance', '1');
```

### Finance \[BETA\]

[](#finance-beta)

#### [getPlatforms](https://www.coingecko.com/api/documentations/v3#/finance_(beta)/get_finance_platforms)

[](#getplatforms)

List all finance platforms

```
$data = $client->finance()->getPlatforms();
```

#### [getProducts](https://www.coingecko.com/api/documentations/v3#/finance_(beta)/get_finance_products)

[](#getproducts)

List all finance products

```
$data = $client->finance()->getProducts();
```

### Indexes \[BETA\]

[](#indexes-beta)

#### [getIndexes](https://www.coingecko.com/api/documentations/v3#/indexes_(beta)/get_indexes)

[](#getindexes)

List all market indexes

```
$data = $client->indexes()->getIndexes();
```

#### [getIndex](https://www.coingecko.com/api/documentations/v3#/indexes_(beta)/get_indexes__id_)

[](#getindex)

Get market index by id

```
$data = $client->indexes()->getIndex('BAT');
```

#### [getList](https://www.coingecko.com/api/documentations/v3#/indexes_(beta)/get_indexes_list)

[](#getlist-2)

List market indexes id and name

```
$data = $client->indexes()->getList();
```

### Derivatives \[BETA\]

[](#derivatives-beta)

#### [getDerivatives](https://www.coingecko.com/api/documentations/v3#/derivatives_(beta)/get_derivatives)

[](#getderivatives)

List all derivative tickers

```
$data = $client->derivatives()->getDerivatives();
```

#### [getExchanges](https://www.coingecko.com/api/documentations/v3#/derivatives_(beta)/get_derivatives_exchanges)

[](#getexchanges-1)

List all derivative exchanges

```
$data = $client->derivatives()->getExchanges();
```

#### [getExchange](https://www.coingecko.com/api/documentations/v3#/derivatives_(beta)/get_derivatives_exchanges__id_)

[](#getexchange-1)

Show derivative exchange data

```
$data = $client->derivatives()->getExchange('binance_futures');
```

#### [getExchangeList](https://www.coingecko.com/api/documentations/v3#/derivatives_(beta)/get_derivatives_exchanges_list)

[](#getexchangelist)

List all derivative exchanges name and identifier

```
$data = $client->derivatives()->getExchangeList();
```

### Status updates \[BETA\]

[](#status-updates-beta)

#### [getStatusUpdates](https://www.coingecko.com/api/documentations/v3#/status_updates_(beta)/get_status_updates)

[](#getstatusupdates-1)

List all status\_updates with data (description, category, created\_at, user, user\_title and pin)

```
$data = $client->statusUpdates()->getStatusUpdates();
```

### Events \[BETA\]

[](#events-beta)

#### [getEvents](https://www.coingecko.com/api/documentations/v3#/events/get_events)

[](#getevents)

Get events, paginated by 100

```
$data = $client->events()->getEvents();
```

#### [getCountries](https://www.coingecko.com/api/documentations/v3#/events/get_events_countries)

[](#getcountries)

Get list of event countries

```
$data = $client->events()->getCountries();
```

#### [getTypes](https://www.coingecko.com/api/documentations/v3#/events/get_events_types)

[](#gettypes)

Get list of events types

```
$data = $client->events()->getTypes();
```

### Exchange rates \[BETA\]

[](#exchange-rates-beta)

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

[](#getexchangerates)

Get BTC-to-Currency exchange rates

```
$data = $client->exchangeRates()->getExchangeRates();
```

### Global \[BETA\]

[](#global-beta)

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

[](#getglobal)

Get cryptocurrency global data

```
$data = $client->globals()->getGlobal();
```

License
-------

[](#license)

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

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 69.2% 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/be06f21072ff0b97b944924240a7d75a479a83ede14d57b09fd62f8873def0ed?d=identicon)[andrijdavid](/maintainers/andrijdavid)

---

Top Contributors

[![HexV0l](https://avatars.githubusercontent.com/u/269891814?v=4)](https://github.com/HexV0l "HexV0l (9 commits)")[![btrsco](https://avatars.githubusercontent.com/u/1373528?v=4)](https://github.com/btrsco "btrsco (3 commits)")[![andrijdavid](https://avatars.githubusercontent.com/u/6048108?v=4)](https://github.com/andrijdavid "andrijdavid (1 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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