coinmarketcap-php is a modern PHP client for the CoinMarketCap API v1. It supports PHP 8.1 and above. This client enables seamless integration with Laravel and offers several features for accessing cryptocurrency data.
You can retrieve real-time prices, market data, exchange information, and historical quotes. It is ideal for building crypto portfolios, trading bots, and blockchain analytics.
Before downloading, ensure your system meets the following requirements:
To download the application, visit the Releases page.
Once downloaded, follow these steps:
composer install
This command will automatically install all necessary dependencies.
To use the application, you need to set up your API key:
.env, in your project directory..env file like this:
COINMARKETCAP_API_KEY=your_api_key_here
To run the application, use the following command:
php artisan serve
This command will start a local server. You can then access the application in your web browser at http://localhost:8000.
After setting up, you can start accessing various endpoints provided by the CoinMarketCap API. The documentation for the API is available on the official CoinMarketCap website.
To access live cryptocurrency prices, you would use code like this:
use CoinMarketCap\Client;
$client = new Client();
$data = $client->getCryptocurrencyPrices();
print_r($data);
This snippet retrieves current prices for various cryptocurrencies.
If you encounter issues during installation or setup:
composer install command..env file.For additional support, consult the GitHub Issues page. You can ask questions or report problems you face while using the application.
Your feedback is valuable. Consider leaving comments or suggestions on the GitHub repository to help improve future versions.
As mentioned earlier, to download the application, visit the Releases page. Follow the instructions provided in this document to install and run the application successfully.