Skip to content

MusheAbdulHakim/CoinGeckoApi

Repository files navigation

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

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

Requirement

Requires Composer Requires PHP 8.2+

Installation

 composer require musheabdulhakim/coingecko

Basic usage

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

//or 

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

Example

$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

'COINGECKO_API_VERSION' => 'v3',

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

'COINGECKO_API_KEY' => 'xxxxxxxxxxxxxxxxxxxxxx',

Ping

Check API server status

$ping = $coingecko->ping();

License

musheabdulhakim/coingecko is released under the MIT License. See the bundled LICENSE for details.

Contribution

🧹 Keep a modern codebase with php-cs-fixer:

composer lint

🚀 Run the entire test suite:

composer test

Report all your issues Here

All your pull requests are welcome :).