Download the PHP package vittominacori/coinmarketcap-php without Composer
On this page you can find all versions of the php package vittominacori/coinmarketcap-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vittominacori/coinmarketcap-php
More information about vittominacori/coinmarketcap-php
Files in vittominacori/coinmarketcap-php
Package coinmarketcap-php
Short Description A PHP wrapper for CoinMarketCap API
License MIT
Homepage https://github.com/vittominacori/coinmarketcap-php
Informations about the package coinmarketcap-php
CoinMarketCap for PHP
A PHP wrapper for CoinMarketCap Professional API
NOTES: only FREE APIs. Check features list here.
Install
Usage
Create client
Call Cryptocurrency APIs
map
Returns a mapping of all cryptocurrencies to unique CoinMarketCap id
s. Per our best practices we recommend utilizing CMC ID instead of cryptocurrency symbols to securely identify cryptocurrencies with our other endpoints and in your own application logic. Each cryptocurrency returned includes typical identifiers such as name
, symbol
, and token_address
for flexible mapping to id
.
By default this endpoint returns cryptocurrencies that have actively tracked markets on supported exchanges. You may receive a map of all inactive cryptocurrencies by passing listing_status=inactive
. You may also receive a map of registered cryptocurrency projects that are listed but do not yet meet methodology requirements to have tracked markets via listing_status=untracked
.
Cryptocurrencies returned include first_historical_data
and last_historical_data
timestamps to conveniently reference historical date ranges available to query with historical time-series data endpoints. You may also use the aux
parameter to only include properties you require to slim down the payload if calling this endpoint frequently.
Params:
- (string)
listing_status
- Default "active" - Only active cryptocurrencies are returned by default. Passinactive
to get a list of cryptocurrencies that are no longer active. Passuntracked
to get a list of cryptocurrencies that are listed but do not yet meet methodology requirements to have tracked markets available. You may pass one or more comma-separated values. - (integer >= 1)
start
- Default 1 - Optionally offset the start (1-based index) of the paginated list of items to return. - (integer [1 .. 5000])
limit
- Default 100 - Optionally specify the number of results to return. Use this parameter and the "start" parameter to determine your own pagination size. - (string)
sort
- Default "id" - Valid values: "cmc_rank", "id" - What field to sort the list of cryptocurrencies by. - (string)
symbol
- Optionally pass a comma-separated list of cryptocurrency symbols to return CoinMarketCap IDs for. If this option is passed, other options will be ignored. - (string)
aux
- Default "platform,first_historical_data,last_historical_data,is_active" - Optionally specify a comma-separated list of supplemental data fields to return. Passplatform,first_historical_data,last_historical_data,is_active,status
to include all auxiliary fields.
info
Returns all static metadata available for one or more cryptocurrencies. This information includes details like logo, description, official website URL, social links, and links to a cryptocurrency's technical documentation.
Params:
- (string)
id
- One or more comma-separated CoinMarketCap cryptocurrency IDs. - (string)
slug
- Alternatively pass a comma-separated list of cryptocurrency slugs. - (string)
symbol
- Alternatively pass one or more comma-separated cryptocurrency symbols. At least one "id" or "slug" or "symbol" is required for this request. - (string)
aux
- Default "urls,logo,description,tags,platform,date_added,notice" - Optionally specify a comma-separated list of supplemental data fields to return. Passurls,logo,description,tags,platform,date_added,notice,status
to include all auxiliary fields.
listings/latest
Returns a paginated list of all active cryptocurrencies with latest market data. The default "market_cap" sort returns cryptocurrency in order of CoinMarketCap's market cap rank but you may configure this call to order by another market ranking field. Use the "convert" option to return market values in multiple fiat and cryptocurrency conversions in the same call.
Params:
- (integer >= 1)
start
- Default 1 - Optionally offset the start (1-based index) of the paginated list of items to return. - (integer [1 .. 5000])
limit
- Default 100 - Optionally specify the number of results to return. Use this parameter and the "start" parameter to determine your own pagination size. - (integer [ 1 .. 100000000000 ])
volume_24h_min
- Optionally specify a threshold of minimum 24 hour USD volume to filter results by. - (string)
convert
- Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own "quote" object. - (string)
convert_id
- Optionally calculate market quotes by CoinMarketCap ID instead of symbol. This option is identical toconvert
outside of ID format. Ex: convert_id=1,2781 would replace convert=BTC,USD in your query. This parameter cannot be used whenconvert
is used. - (string)
sort
- Default "market_cap" - Valid values: "name""symbol", "date_added", "market_cap", "market_cap_strict", "price", "circulating_supply", "total_supply", "max_supply", "num_market_pairs", "volume_24h", "percent_change_1h", "percent_change_24h", "percent_change_7d", "market_cap_by_total_supply_strict", "volume_7d""volume_30d" - What field to sort the list of cryptocurrencies by. - (string)
sort_dir
- Valid values: "asc", "desc" - The direction in which to order cryptocurrencies against the specified sort. - (string)
cryptocurrency_type
- Default "all" - Valid values: "all", "coins", "tokens" - The type of cryptocurrency to include. - (string)
aux
- Default "num_market_pairs,cmc_rank,date_added,tags,platform,max_supply,circulating_supply,total_supply" - Optionally specify a comma-separated list of supplemental data fields to return. Passnum_market_pairs,cmc_rank,date_added,tags,platform,max_supply,circulating_supply,total_supply,market_cap_by_total_supply,volume_24h_reported,volume_7d,volume_7d_reported,volume_30d,volume_30d_reported
to include all auxiliary fields.
quotes/latest
Returns the latest market quote for 1 or more cryptocurrencies. Use the "convert" option to return market values in multiple fiat and cryptocurrency conversions in the same call.
Params:
- (string)
id
- One or more comma-separated CoinMarketCap cryptocurrency IDs. - (string)
slug
- Alternatively pass a comma-separated list of cryptocurrency slugs. - (string)
symbol
- Alternatively pass one or more comma-separated cryptocurrency symbols. At least one "id" or "slug" or "symbol" is required for this request. - (string)
convert
- Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own "quote" object. - (string)
convert_id
- Optionally calculate market quotes by CoinMarketCap ID instead of symbol. This option is identical toconvert
outside of ID format. Ex: convert_id=1,2781 would replace convert=BTC,USD in your query. This parameter cannot be used whenconvert
is used. - (string)
aux
- Default "num_market_pairs,cmc_rank,date_added,tags,platform,max_supply,circulating_supply,total_supply" - Optionally specify a comma-separated list of supplemental data fields to return. Passnum_market_pairs,cmc_rank,date_added,tags,platform,max_supply,circulating_supply,total_supply,market_cap_by_total_supply,volume_24h_reported,volume_7d,volume_7d_reported,volume_30d,volume_30d_reported
to include all auxiliary fields. - (boolean)
skip_invalid
- Default false - Passtrue
to relax request validation rules. When requesting records on multiple cryptocurrencies an error is returned if no match is found for 1 or more requested cryptocurrencies. If set to true, invalid lookups will be skipped allowing valid cryptocurrencies to still be returned.
Call GlobalMetrics APIs
quotes/latest
Returns the latest global cryptocurrency market metrics. Use the "convert" option to return market values in multiple fiat and cryptocurrency conversions in the same call.
Params:
- (string)
convert
- Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own "quote" object. - (string)
convert_id
- Optionally calculate market quotes by CoinMarketCap ID instead of symbol. This option is identical toconvert
outside of ID format. Ex: convert_id=1,2781 would replace convert=BTC,USD in your query. This parameter cannot be used whenconvert
is used.
Call Tools APIs
price-conversion
Convert an amount of one cryptocurrency or fiat currency into one or more different currencies utilizing the latest market rate for each currency. You may optionally pass a historical timestamp as time to convert values based on historical rates (as your API plan supports).
Params:
- (number [ 1e-8 .. 1000000000 ] )
amount
- An amount of currency to convert. - (string)
id
- The CoinMarketCap currency ID of the base cryptocurrency or fiat to convert from. - (string)
symbol
- Alternatively the currency symbol of the base cryptocurrency or fiat to convert from. - (string)
time
- Optional timestamp (Unix or ISO 8601) to reference historical pricing during conversion. If not passed, the current time will be used. If passed, we'll reference the closest historic values available for this conversion. - (string)
convert
- Pass up to 120 comma-separated fiat or cryptocurrency symbols to convert the source amount to.
Call Partners APIs
flipside-crypto/fcas/listings/latest
Returns a paginated list of FCAS scores for all cryptocurrencies currently supported by FCAS. FCAS ratings are on a 0-1000 point scale with a corresponding letter grade and is updated once a day at UTC midnight.
Params:
- (integer >= 1)
start
- Default 1 - Optionally offset the start (1-based index) of the paginated list of items to return. - (integer [ 1 .. 5000 ])
limit
- Default 100 - Optionally specify the number of results to return. Use this parameter and the "start" parameter to determine your own pagination size. - (string)
aux
- Default "point_change_24h,percent_change_24h" - Optionally specify a comma-separated list of supplemental data fields to return. Passpoint_change_24h,percent_change_24h
to include all auxiliary fields.
flipside-crypto/fcas/quotes/latest
Returns the latest FCAS score for 1 or more cryptocurrencies. FCAS ratings are on a 0-1000 point scale with a corresponding letter grade and is updated once a day at UTC midnight.
Params:
- (string)
id
- One or more comma-separated cryptocurrency CoinMarketCap IDs. - (string)
slug
- Alternatively pass a comma-separated list of cryptocurrency slugs. - (string)
symbol
- Alternatively pass one or more comma-separated cryptocurrency symbols. Example: "BTC,ETH". At least one "id" or "slug" or "symbol" is required for this request. - (string)
aux
- Default "point_change_24h,percent_change_24h" - Optionally specify a comma-separated list of supplemental data fields to return. Passpoint_change_24h,percent_change_24h
to include all auxiliary fields.
License
Code released under the MIT License.