An open API service indexing awesome lists of open source software.

https://github.com/musheabdulhakim/coingeckoapi

PHP API client for CoinGecko.
https://github.com/musheabdulhakim/coingeckoapi

altcoins bitcoin-api coingecko coingecko-api coingecko-php cryptocurrency laravel php sdk sdk-php

Last synced: 5 months ago
JSON representation

PHP API client for CoinGecko.

Awesome Lists containing this project

README

          


CoinGecko client example


GitHub Workflow Status (master)
Total Downloads
Latest Version
License


------
This package provides a wonderful **PHP API** client that allows you to interact
with [CoinGecko Api](https://docs.coingecko.com/reference/introduction)

**This SDK** is a PHP & Laravel Package, (Designed to help working with coingecko api easier and faster).

## Requirement
> **Requires [Composer](https://getcomposer.org/)**
> **Requires [PHP 8.2+](https://php.net/releases/)**


## Installation

```bash
composer require musheabdulhakim/coingecko
```

## Basic usage

```php
$coingecko = \MusheAbdulHakim\CoinGecko\CoinGecko::client('your-api-key');

//or

$coingecko = \MusheAbdulHakim\CoinGecko\CoinGecko::client('your-api-key','https://api.coingecko.com/api', 'v3');
```

### Example
```php
$coingecko = \MusheAbdulHakim\CoinGecko\CoinGecko::client('your-api-key');
$ping = $coingecko->ping();

$pingTest = $ping->ping();

//or

$coingecko->pingServer();

```

### Configuration
Update api version, base url and api key
```php

'COINGECKO_API_VERSION' => 'v3',

'COINGECKO_BASE_URI' => 'https://api.coingecko.com/api',

'COINGECKO_API_KEY' => 'xxxxxxxxxxxxxxxxxxxxxx',

```

### Ping

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

Check API server status

```php
$ping = $coingecko->ping();
```

## License

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

## Contribution

๐Ÿงน Keep a modern codebase with **php-cs-fixer**:

```bash
composer lint
```

๐Ÿš€ Run the entire test suite:

```bash
composer test
```

Report all your issues [Here](https://github.com/MusheAbdulHakim/CoinGeckoApi/issues)

All your pull requests are welcome :).