PHPackages                             madmis/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. madmis/coingecko-api

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

madmis/coingecko-api
====================

Coingecko REST API php client

1.0.0(8y ago)153929MITPHPPHP ^7.1

Since Aug 31Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (2)Used By (0)

Coingecko REST API PHP Client
=============================

[](#coingecko-rest-api-php-client)

[![SensioLabsInsight](https://camo.githubusercontent.com/6f6fcc68c045aeb334651310f5b527f6a7844b31bb8d27bea0e1f06abef35810/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62373637646430322d393237642d343334302d616265652d6561376631306265613938312f6d696e692e706e67)](https://insight.sensiolabs.com/projects/b767dd02-927d-4340-abee-ea7f10bea981)[![Build Status](https://camo.githubusercontent.com/eb6fa73a4687ba455f914b51a74f538e063151b9beeb1cc180d0bfb480f8d4b1/68747470733a2f2f7472617669732d63692e6f72672f6d61646d69732f636f696e6765636b6f2d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/madmis/coingecko-api)[![Coverage Status](https://camo.githubusercontent.com/f9dd1293d3f50519f1b11b7020bd351138659106003c4cb4380e0d147b6cdb77/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d61646d69732f636f696e6765636b6f2d6170692f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/madmis/coingecko-api?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/cb09dc709df0b62d8395606e05e1e48f6094b7cca86799379f4662721977dc87/68747470733a2f2f706f7365722e707567782e6f72672f6d61646d69732f636f696e6765636b6f2d6170692f762f737461626c65)](https://packagist.org/packages/madmis/coingecko-api)[![Total Downloads](https://camo.githubusercontent.com/31535bfff9ef1bfee2b220f8671013a77ca81c2c33ac3bb1408233cc50183689/68747470733a2f2f706f7365722e707567782e6f72672f6d61646d69732f636f696e6765636b6f2d6170692f646f776e6c6f616473)](https://packagist.org/packages/madmis/coingecko-api)[![License](https://camo.githubusercontent.com/ed072f9b18b0ab8c15aecbec6da1ba80aec5d95b95cc40af446ed3cd6a98b20c/68747470733a2f2f706f7365722e707567782e6f72672f6d61646d69732f636f696e6765636b6f2d6170692f6c6963656e7365)](https://packagist.org/packages/madmis/coingecko-api)

This API client will help you interact with Coingecko data.

License
-------

[](#license)

MIT License

Contributing
------------

[](#contributing)

To create new endpoint - [create issue](https://github.com/madmis/coingecko-api/issues/new)or [create pull request](https://github.com/madmis/coingecko-api/compare)

Install
-------

[](#install)

```
composer require madmis/coingecko-api 1.0.*

```

Usage
-----

[](#usage)

```
$api = new CoingeckoApi();
$timestamp = $api->shared()->priceCharts(Api::BASE_ETH, Api::QUOTE_USD, Api::PERIOD_24HOURS, true));
```

### Mapping

[](#mapping)

Each endpoint response can be received as `array` or as `object`.

To use mapping response to `object` set parameter `$mapping` to `true`.

```
$issue = $api->shared()->priceCharts(Api::BASE_ETH, Api::QUOTE_USD, Api::PERIOD_24HOURS, true));

// Result
[
    {
    class madmis\CoingeckoApi\Model\Price {
        protected $price => 379.62131925945
        protected $date => DateTime
      }

    },
    ...
]
```

### Error handling

[](#error-handling)

Each client request errors wrapped to custom exception **madmis\\ExchangeApi\\Exception\\ClientException**

```
class madmis\ExchangeApi\Exception\ClientException {
  private $request => class GuzzleHttp\Psr7\Request
  private $response => NULL
  protected $message => "cURL error 7: Failed to connect to 127.0.0.1 port 8080: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)"
  ...
}
```

**ClientException** contains original **request object** and **response object** if response available

```
class madmis\ExchangeApi\Exception\ClientException {
  private $request => class GuzzleHttp\Psr7\Request
  private $response => class GuzzleHttp\Psr7\Response {
    private $reasonPhrase => "Unauthorized"
    private $statusCode => 401
    ...
  }
  protected $message => "Client error: 401"
  ...
}
```

Running the tests
-----------------

[](#running-the-tests)

To run the tests, you'll need to install [phpunit](https://phpunit.de/). Easiest way to do this is through composer.

```
composer install

```

### Running Unit tests

[](#running-unit-tests)

```
php vendor/bin/phpunit -c phpunit.xml.dist

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

3225d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1774703?v=4)[Dmytro](/maintainers/madmis)[@madmis](https://github.com/madmis)

---

Tags

apirestCoingecko

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.4k66.1M255](/packages/nelmio-api-doc-bundle)[retailcrm/api-client-php

PHP client for RetailCRM API

661.1M1](/packages/retailcrm-api-client-php)

PHPackages © 2026

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