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.
- Host: GitHub
- URL: https://github.com/musheabdulhakim/coingeckoapi
- Owner: MusheAbdulHakim
- License: mit
- Created: 2022-09-10T02:45:18.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2025-01-04T01:56:11.000Z (9 months ago)
- Last Synced: 2025-04-11T12:23:04.467Z (6 months ago)
- Topics: altcoins, bitcoin-api, coingecko, coingecko-api, coingecko-php, cryptocurrency, laravel, php, sdk, sdk-php
- Language: PHP
- Homepage: https://musheabdulhakim.github.io/CoinGeckoApi/
- Size: 342 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
------
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/)**```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 :).