musheabdulhakim/coingecko

CoinGecko API client for PHP and Laravel Applications.

v1.0.3 2025-01-04 01:54 UTC

This package is auto-updated.

Last update: 2025-01-04 01:56:13 UTC


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

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

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 :).