Download the PHP package adimiuprix/coinmarketcap without Composer
On this page you can find all versions of the php package adimiuprix/coinmarketcap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adimiuprix/coinmarketcap
More information about adimiuprix/coinmarketcap
Files in adimiuprix/coinmarketcap
Package coinmarketcap
Short Description CoinMarketCap API Client for Laravel
License MIT
Informations about the package coinmarketcap
CoinMarketCap API Client/SDK for Laravel & PHP

A small PHP client for the CoinMarketCap API. It works on its own or with Laravel through auto-discovery, a facade, and dependency injection.
Responses are returned as decoded associative arrays, preserving the API response shape and allowing every documented query parameter to be passed through without waiting for model updates.
Requirements
- PHP 8.1 or newer
- Laravel 10, 11, or 12 when using the Laravel integration
- A CoinMarketCap API key — create one here
Install
Laravel discovers the service provider automatically. To publish the configuration file:
Configuration
Set the API key in .env:
COINMARKETCAP_SANDBOX_URL may be set when a custom sandbox endpoint is required. Timeout is measured in seconds; 0 disables Guzzle's timeout.
For a standalone client:
Use ->useSandbox() with a sandbox API key when testing.
Quick start
Laravel facade:
For production lookups, CoinMarketCap recommends stable cryptocurrency IDs. Use cryptocurrency()->map() to obtain them.
Every API method accepts an array of query parameters. Refer to the official API documentation for valid parameters, plan availability, credit usage, and the precise response format.
Supported endpoints
| Service | Methods |
|---|---|
cryptocurrency() |
listingsLatest, listingsHistorical, listingsNew, quotesLatest, quotesHistorical, info, map, ohlcvLatest, ohlcvHistorical, categories, category, marketPairsLatest, pricePerformanceStatsLatest, simplePrice, airdrops, airdrop, trendingLatest, trendingGainersLosers, trendingMostVisited |
exchange() |
listingsLatest, quotesLatest, quotesHistorical, info, map, marketPairsLatest, assets |
globalMetrics() |
quotesLatest, quotesHistorical, fearAndGreedLatest, fearAndGreedHistorical, altcoinSeasonIndexLatest, altcoinSeasonIndexHistorical |
tools() |
priceConversion |
For example, fetch the first ten cryptocurrencies by market cap:
Errors
All API and transport errors extend ApiException. Specific response status codes map to these types:
| Exception | HTTP status |
|---|---|
AuthenticationException |
401 |
InvalidRequestException |
400 |
NotFoundException |
404 |
RateLimitException |
429 |
ApiException |
Other API, transport, or malformed-response errors |
ApiException exposes statusCode and getResponse(). RateLimitException also provides getRetryAfter(), populated from CoinMarketCap's response or the standard Retry-After header when present.
Sandbox
V3 migration
cryptocurrency()->listingsLatest(), quotesLatest(), and quotesHistorical() use CoinMarketCap's current V3 endpoints. V3 responses can differ from their V1/V2 predecessors; notably, latest quotes return data as an array of asset records rather than a symbol-keyed map. Update consumers before adopting this release and publish it as a new major version.
Testing
The test suite verifies builder validation, Laravel registration, HTTP encoding and error handling, and the endpoint paths exposed by every service method.
GitHub Actions runs the test suite on PHP 8.1–8.4, static analysis, code style checks, and PCOV coverage. The coverage workflow uploads coverage.xml to Codecov when the CODECOV_TOKEN repository secret is configured.
License
MIT
All versions of coinmarketcap with dependencies
guzzlehttp/guzzle Version ^8.2.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
psr/http-client Version ^1.0.3
psr/http-factory Version ^1.1.0