https://github.com/kriosmane/coinmarketcap-api
Laravel package for interacting with CoinMarketCap API
https://github.com/kriosmane/coinmarketcap-api
coinmarketcap coinmarketcap-api cryptocoins cryptocurrencies cryptocurrency cryptocurrency-price-ticker cryptocurrency-prices laravel
Last synced: 9 months ago
JSON representation
Laravel package for interacting with CoinMarketCap API
- Host: GitHub
- URL: https://github.com/kriosmane/coinmarketcap-api
- Owner: kriosmane
- License: other
- Created: 2019-01-18T16:23:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-02-28T17:24:44.000Z (over 1 year ago)
- Last Synced: 2025-08-16T12:01:56.332Z (10 months ago)
- Topics: coinmarketcap, coinmarketcap-api, cryptocoins, cryptocurrencies, cryptocurrency, cryptocurrency-price-ticker, cryptocurrency-prices, laravel
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 8
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel CoinMarketCap API
[](https://packagist.org/packages/kriosmane/coinmarketcap-api)
[](https://packagist.org/packages/kriosmane/coinmarketcap-api)
A Laravel package for interacting with the CoinMarketCap API.
## 🚀 Installation
Laravel 11 requires **PHP 8.1+** and **Composer**.
To install the latest version, run:
```bash
composer require kriosmane/coinmarketcap-api
```
### 📌 Service Provider & Facade (Not Required for Laravel 11)
From Laravel 11, service providers and facades are auto-discovered. However, if you need to register them manually, add the following to your `config/app.php` file:
#### Service Provider (Only if required)
```php
'providers' => [
KriosMane\CoinMarketCap\Providers\CoinMarketCapServiceProvider::class,
],
```
#### Facade (Only if required)
```php
'aliases' => [
'CoinMarketCapApi' => KriosMane\CoinMarketCap\Facades\CoinMarketCap::class,
],
```
## ⚙️ Configuration
Publish the configuration file using:
```bash
php artisan vendor:publish --provider="KriosMane\CoinMarketCap\Providers\CoinMarketCapServiceProvider"
```
This will create a `coinmarketcap.php` file in your `config` directory.
Get your **CoinMarketCap API Key** from:
🔗 [CoinMarketCap API](https://pro.coinmarketcap.com/login/)
Then, add the key to your `.env` file:
```env
CMC_API_KEY=your-api-key-here
```
## 📖 Usage
You can start using the API in your controllers or services:
```php
use CoinMarketCap;
// Get latest cryptocurrency listings
$cryptos = CoinMarketCap::listCryptos();
// Get latest market quotes for a specific cryptocurrency
$quotes = CoinMarketCap::getQuotes(['symbol' => 'BTC,ETH']);
```
## 🤝 Contributing
Feel free to fork this repository and submit a pull request to enhance its functionality.
## ☕ How can I thank you?
If you found this package helpful, consider buying me a coffee!
[☕ Buy me a coffee](https://www.buymeacoffee.com/kriosmane)
⭐ Star the repo, share it on Twitter, or post about it on HackerNews. Spread the word!
Thank you!
**Krios Mane**
## 📜 License
Please see [License File](LICENSE.md) for more information.