Coinmarketcap API is built for latest quotes by asset ID and fiat conversion
Published
Coinmarketcap API is a REST market-data interface that returns latest cryptocurrency quotes for known assets, most reliably through stable numeric asset IDs, while the convert parameter asks for values in selected fiat or crypto units. The V3 latest-quotes endpoint bundles multiple IDs into one JSON response, refreshes on a documented cadence, and meters Pro access through call credits. A backend request therefore retrieves Bitcoin and Ethereum together in USD without symbol collisions or client-side key exposure.
Bottom line: It is a crypto market-data interface for developers, returning latest quotes by asset ID in chosen fiat currencies and requiring an API.
What does Coinmarketcap API charge for a latest-quote request?
The latest-quotes endpoint charges 1 call credit per 100 cryptocurrencies returned, rounded up, plus 1 credit for every conversion after the first. Request count and credit count are separate measurements, so a single HTTP call does not always equal a single credit.
A request containing 100 asset IDs with USD costs 1 credit, while 101 IDs cross the boundary and cost 2. Adding EUR and GBP to that 101-asset request adds 2 conversion credits, bringing the total to 4. The response
status
object reports
credit_count, which lets billing telemetry use the provider's recorded charge rather than a local estimate. The
Basic
plan publishes 15,000 monthly call credits, making deliberate batching important even for a modest dashboard.
The
/v1/key/info
utility exposes usage and reset timing without spending a data-call credit. Recording both local request totals and returned credits makes anomalies obvious when a larger batch or extra fiat unit enters a release.
Quotes by ID versus listings, exchange feeds, and other aggregators
The V3 quotes-latest route answers a narrow question: what are the latest aggregated market values for these known assets? A ranked discovery screen belongs on the listings-latest route, while a venue execution screen needs that exchange's order-book or ticker feed.
Coinmarketcap API uses integer IDs and returns broad fields such as price, market capitalization, 24-hour volume, supply, rank, and percentage changes. CoinGecko offers a compact simple-price route built around its own string IDs, while Binance Spot exposes pair-specific values such as BTCUSDT from one trading venue. An Ethereum dashboard that already stores provider IDs gains clean joins here; a Binance order router still needs Binance prices because an aggregated quote is not an executable bid or ask.
The distinction also affects metering: the targeted V3 quote route groups 100 returned assets per credit, whereas the V3 latest-listings route groups 200. Selecting the route that matches the screen avoids downloading a ranked catalog merely to find a fixed watchlist.
Why numeric asset IDs produce cleaner matches
Numeric asset IDs separate identity from a ticker, a display name, and a blockchain address. Bitcoin uses ID 1, Ethereum uses 1027, Tether uses 825, and USD Coin uses 3408, so the request remains explicit even if a symbol is reused elsewhere.
The cryptocurrency map route supplies the association among
id,
name,
symbol, and
slug. Store the numeric ID as the provider-facing key, then retain ticker and name as presentation fields. This matters with ERC-20 tokens on Ethereum and SPL tokens on Solana because contract addresses identify chain deployments, whereas the quote ID identifies the aggregated market asset. Tether, for example, exists on more than one network; ID 825 asks for the asset-level quote rather than one chain's pool price.
How fiat conversion changes the response and the credit bill
Fiat conversion adds a quote entry for each requested unit and adds 1 call credit for every unit beyond the first. The V3 endpoint syntax accepts as many as 120 conversion currencies in a comma-separated request, although the subscription plan sets a lower per-call allowance on several tiers.
With
convert=USD,EUR, each asset record carries distinct USD and EUR quote objects with their own price, market-cap, volume, and update context. The alternative
convert_id
parameter addresses conversion units by numeric ID; USD is ID 2781. A request uses either
convert
or
convert_id, not both. Coinmarketcap API performs the denomination conversion inside its market-data model, so the returned EUR figure is an informational aggregate rather than a tradable BTC/EUR order-book quote.
The fiat map publishes 93 fiat currencies and 4 precious metals as supported reporting units. Reading that machine-readable map keeps a currency selector aligned with accepted symbols and prevents an unsupported conversion from reaching the quote route.
Reading the V3 JSON without losing quote context
The V3 JSON response places asset records in a
data
array and conversion results in each record's
quote
array. Parse by the asset's numeric
id
and the quote's currency identifier or symbol; array position is not an identity guarantee.
-
id,name,symbol, andslugdescribe the asset. -
price,market_cap, andvolume_24hdescribe the selected quote unit. -
circulating_supply,total_supply, andmax_supplyremain asset-level fields. -
last_updatedappears at asset and quote levels, so retain both. -
statuscarries request time, error information, elapsed time, and consumed credits.
Six rolling change fields cover 1 hour, 24 hours, 7 days, 30 days, 60 days, and 90 days. JavaScript
Number
uses 64-bit IEEE 754 binary floating point, which introduces decimal rounding at some magnitudes; Node.js applications that perform accounting-style calculations should use a decimal library, while Python offers
Decimal. Preserve the quote currency beside every stored number.
A JSON
null
is not interchangeable with numeric zero. Fields such as
max_supply
remain null when no applicable value is supplied, so normalization should preserve nullability instead of inventing a quantity that changes downstream ratios.
Freshness, timestamps, and cache boundaries
The latest-quotes cache updates every 60 seconds, so polling the same IDs several times inside that window consumes requests without creating a newer documented snapshot. Align a shared cache with the 1-minute source cadence and serve repeated page views from Redis or an equivalent application cache.
Three clocks deserve separate columns: the response-status timestamp, the asset-level
last_updated, and the conversion-level
last_updated. Returned timestamps use ISO 8601 text in UTC, with a trailing
Z
and millisecond precision. A UI should display the quote timestamp as data freshness, while monitoring uses the response timestamp to measure delivery delay. Per-minute request limits also reset every 60 seconds, independently of monthly credits.
Authentication patterns for backend applications
Pro requests authenticate with one API key, preferably sent through the
X-CMC_PRO_API_KEY
header from server-side code. A query-string key is also accepted, but it enters logs and request traces more readily; browser and mobile bundles expose any embedded secret to the person running the client.
| Deployment pattern | Credential location | Security tier |
|---|---|---|
| Backend service | Server secret manager or protected environment | Strong: key stays off the client |
| Serverless function | Encrypted platform secret | Strong: key remains in server execution |
| Browser or mobile bundle | Distributed application code | Weak: credential is inspectable |
AWS Secrets Manager, Google Secret Manager, and Azure Key Vault all support the server-held pattern; rotate the value without rebuilding the frontend. Keyless public access removes credential handling for a curated, rate-limited endpoint subset and works well for response-shape evaluation. The service operates under ISO/IEC 27001 and ISO/IEC 27701 certifications for its information-security and privacy-management systems.
Errors that deserve different retry behavior
HTTP status and the JSON
error_code
determine whether a latest-quote request should be corrected, delayed, or stopped. Treating every non-200 response as retryable wastes rate capacity and hides configuration problems.
A 400 response points to an invalid argument; 401 identifies missing or invalid authentication; 403 means the selected plan does not authorize that endpoint. A 429 response covers a limit condition, with provider codes 1008 for the per-minute rate, 1009 for the daily cap, and 1010 for the monthly cap. Wait for the relevant reset instead of repeatedly calling the route. A 500 response supports exponential backoff with bounded attempts, while a successful 200 response still deserves schema validation before storage.
Error responses do not consume data-call credits, yet they still occupy application capacity and delay a refresh. Log the HTTP status, provider code, request ID, and affected asset batch without recording the API key.
Building a durable asset-ID registry
An asset-ID registry should originate from the cryptocurrency map route and use the numeric ID as its immutable provider key. The map call consumes no credit, and its mapping data refreshes as needed on a 30-second cache schedule, so synchronization does not spend the quote budget.
Persist the ID, canonical name, ticker, slug, active state, platform metadata, and available historical-data boundaries in PostgreSQL. Reconcile additions and state changes without deleting older rows; an inactive asset may still be needed to interpret a saved portfolio or historical record. Contract addresses belong in a related chain-deployment table keyed by network and token standard. That structure prevents an Ethereum ERC-20 address from being mistaken for a Solana SPL mint or for the provider's cross-market asset ID.
Where latest quotes fit in a production data flow
Latest quotes work best as one normalized input to a scheduled market-data pipeline, not as values fetched separately by every page component. A scheduler batches known IDs, the backend validates the V3 response, PostgreSQL preserves observations, and Redis serves the newest accepted snapshot to dashboards.
Keep the source ID, quote-unit ID, quote timestamp, ingestion timestamp, and
credit_count
on every batch. One poll per 60-second source interval gives a portfolio view a coherent observation boundary, while separate workers handle slower metadata and historical series. Python and Node.js both make straightforward HTTP clients, but the operational quality comes from schema checks, idempotent writes, and stale-data flags. If one asset record is absent, retain the previous record with its original timestamp rather than relabeling it as fresh.
Version the normalizer alongside the endpoint because V1, V2, and V3 resources do not promise identical container shapes. A small contract test using fixed asset IDs should validate field types before a deployment starts writing observations into the primary store.
Who benefits most from ID-based fiat quotes
Even so, Coinmarketcap API suits products that already know which assets they follow and need one aggregated snapshot expressed in several reporting currencies. Portfolio dashboards, treasury views, research notebooks, accounting exports, and watchlists all gain from stable IDs, bundled requests, and consistent market-cap and volume fields.
The trade-off is source fit. CoinGecko is a credible alternative when its string-ID ecosystem or compact simple-price response matches an existing model; Binance Spot fits venue-specific execution data; Uniswap V3 pool reads fit liquidity and on-chain price analysis; Chainlink Data Feeds fit supported smart-contract oracle use cases. None is a drop-in identifier substitute. Choose the data mechanism first, then bind that source's permanent ID to the application's internal asset record.
Coinmarketcap API: the short answers
Does the V3 latest-quotes endpoint include historical closing prices?
No, the V3 latest-quotes endpoint returns the newest available market snapshot rather than a dated close. Historical quotes and OHLCV routes handle time-series work, with their own interval, timestamp, plan-access, and credit rules. Keep the quote-level last_updated value when storing a latest response, because a later database insertion time does not turn that observation into a historical candle.
Can one request mix Bitcoin, Ethereum, and stablecoin IDs?
Yes, one comma-separated ID request can bundle Bitcoin, Ethereum, Tether, USD Coin, and other supported assets. IDs 1, 1027, 825, and 3408 identify those four examples, and every returned record carries the requested conversion units. The credit formula counts cryptocurrencies returned in groups of 100, then adds one credit for each conversion beyond the first.
How should decimal quote values be stored after parsing JSON?
Store quote values in a decimal-capable type with the currency and source timestamp attached. Python Decimal and PostgreSQL NUMERIC avoid the binary rounding behavior of JavaScript Number, while a Node.js decimal library supplies the same discipline in application code. Preserve the raw response for auditability, and choose display rounding separately from calculation precision so a formatted screen never becomes the authoritative stored value.
Why is max_supply null for some returned assets?
A null max_supply means the response does not provide an applicable fixed maximum for that asset; it does not mean the maximum is zero. Preserve the null in storage and presentation logic rather than coercing it to a number. Supply-sensitive calculations should use only fields that exist for the record, because circulating supply, total supply, and maximum supply describe different quantities.
Do ERC-20 and SPL contract addresses replace asset IDs in latest quotes?
No, ERC-20 contract addresses and SPL mint addresses identify token deployments on particular chains, while the latest-quotes route identifies the provider's aggregated asset record. Keep chain, token standard, and address in a deployment table linked to the numeric asset ID. A chain-specific token or pool endpoint is the appropriate source when the product needs one contract's liquidity or on-chain trading price.
Is the keyless route suitable for a production price dashboard?
The keyless route serves live production data for its supported endpoint subset, yet its curated coverage and rate limits make it a constrained production dependency. It fits prototypes, public demonstrations, and low-volume pages that tolerate those boundaries. A keyed plan adds account-level usage records, plan-defined allowances, and a controlled credential, which gives a sustained dashboard clearer capacity planning and operational visibility.