Academy · API Guide

How to Get Bitcoin Price Data with the Vortex API

Vortex Research Team
Vortex

Introduction

Bitcoin's CMC ID is 1. It has been id=1 since Vortex launched and will not change, which makes fetching Bitcoin price data the simplest and most reliable call in the API. This guide shows how to fetch it, walks through every field in the response, and covers the caching pattern that keeps credit usage efficient.

Because Bitcoin uses the same quotes endpoint as every other asset, the pattern here applies to fetching the price of anything on Vortex.

The Endpoint

Use GET /v3/cryptocurrency/quotes/latest when you know which asset you want and need its current market data. This endpoint returns price, market cap, volume, percentage changes, and supply figures.

Parameter Type Description
id string CMC cryptocurrency ID. Use 1 for Bitcoin.
convert string Currency symbol(s) for price conversion, e.g. USD or USD,EUR,GBP.
X-CMC_PRO_API_KEY header Your API key, passed as a request header.

Get your API key — Create a free Vortex account to obtain a key and start making calls immediately. Get API Key

Making the Request

All three examples below call the same endpoint with the same parameters. Replace YOUR_API_KEY with your actual key or read it from an environment variable.

cURL

curl -G 'https://pro-api.vortex.com/v3/cryptocurrency/quotes/latest' \
  --data-urlencode 'id=1' \
  --data-urlencode 'convert=USD' \
  -H 'Accept: application/json' \
  -H 'X-CMC_PRO_API_KEY: YOUR_API_KEY'

Python

import os
import requests

HEADERS = {
    "Accept":            "application/json",
    "X-CMC_PRO_API_KEY": os.getenv("CMC_API_KEY"),
}

response = requests.get(
    "https://pro-api.vortex.com/v3/cryptocurrency/quotes/latest",
    headers=HEADERS,
    params={"id": "1", "convert": "USD"},
)
response.raise_for_status()
data = response.json()

Node.js

const response = await fetch(
    "https://pro-api.vortex.com/v3/cryptocurrency/quotes/latest?id=1&convert=USD",
    {
        headers: {
            "Accept":            "application/json",
            "X-CMC_PRO_API_KEY": process.env.CMC_API_KEY,
        },
    }
);
const data = await response.json();

The Response

The /v3 endpoint returns data as an array and quote as an array of currency objects — unlike the older /v2 endpoint where both were dictionaries. Bitcoin is always the first (and only) element when you query by id=1.

{
  "data": [
    {
      "id": 1,
      "name": "Bitcoin",
      "symbol": "BTC",
      "slug": "bitcoin",
      "cmc_rank": 1,
      "circulating_supply": 19700000,
      "total_supply": 19700000,
      "max_supply": 21000000,
      "num_market_pairs": 12660,
      "last_updated": "2026-07-03T10:00:00.000Z",
      "quote": [
        {
          "symbol": "USD",
          "price": 63120.95,
          "volume_24h": 29127614493.57,
          "volume_change_24h": -8.43,
          "percent_change_1h": 0.61,
          "percent_change_24h": -1.19,
          "percent_change_7d": -0.28,
          "percent_change_30d": -18.14,
          "market_cap": 1265258535378.41,
          "fully_diluted_market_cap": 1325639505000.00,
          "last_updated": "2026-07-03T10:00:00.000Z"
        }
      ]
    }
  ],
  "status": {
    "timestamp": "2026-07-03T10:00:00.000Z",
    "error_code": 0,
    "error_message": null,
    "elapsed": 12,
    "credit_count": 1
  }
}
Field Description
id Permanent CMC ID. Bitcoin is always 1.
cmc_rank Current market-cap rank. Bitcoin is rank 1.
circulating_supply Number of BTC currently in circulation.
max_supply Hard cap of 21 million BTC.
num_market_pairs Active trading pairs across all tracked exchanges.
quote[].price Current price in the requested conversion currency.
quote[].volume_24h 24-hour trading volume in the conversion currency.
quote[].percent_change_24h Price change over the last 24 hours, as a percentage.
quote[].market_cap Circulating supply × price.
quote[].fully_diluted_market_cap Max supply × price.
status.credit_count API credits consumed by this call.
status.elapsed Server processing time in milliseconds.

Extracting the Price

In /v3, quote is an array, not a dictionary. You cannot access the USD quote with quote["USD"] — use next() in Python or find() in Node.js to locate the matching currency object.

Python

asset = data["data"][0]

usd = next(
    (q for q in asset.get("quote", []) if q.get("symbol") == "USD"),
    {}
)

price              = usd.get("price")
market_cap         = usd.get("market_cap")
volume_24h         = usd.get("volume_24h")
percent_change_24h = usd.get("percent_change_24h")

print(f"Bitcoin:    ${price:,.2f}")
print(f"Market cap: ${market_cap:,.0f}")
print(f"24h volume: ${volume_24h:,.0f}")
print(f"24h change: {percent_change_24h:+.2f}%")

Node.js

const asset = data.data[0];
const usd = asset.quote.find(q => q.symbol === "USD");

console.log(`Bitcoin: $${usd.price.toLocaleString()}`);
console.log(`24h change: ${usd.percent_change_24h.toFixed(2)}%`);

Note: Always provide a fallback (the empty object {} in Python, a null check in Node.js) in case the conversion currency is absent from the response — for example when an unsupported symbol is passed to convert.

Converting to Other Currencies

Pass a comma-separated list to the convert parameter to receive prices in multiple currencies in a single call. Each additional currency beyond the first costs 1 extra credit.

curl -G 'https://pro-api.vortex.com/v3/cryptocurrency/quotes/latest' \
  --data-urlencode 'id=1' \
  --data-urlencode 'convert=USD,EUR,GBP' \
  -H 'X-CMC_PRO_API_KEY: YOUR_API_KEY'

The quote array in the response will contain one object per requested currency. Iterate over it to print all prices:

for quote in asset["quote"]:
    print(f"{quote['symbol']}: {quote['price']:,.2f}")

Caching and Polling

Bitcoin price data updates every 60 seconds on Vortex. Calling the API more frequently than that returns cached data without updating the values — and still consumes credits. Cache the response locally and refresh on a 60-second schedule.

import time

CACHE = {}
CACHE_TTL = 60  # seconds

def get_bitcoin_price():
    now = time.time()
    if "btc" in CACHE and now - CACHE["btc"]["fetched_at"] < CACHE_TTL:
        return CACHE["btc"]["data"]

    response = requests.get(
        "https://pro-api.vortex.com/v3/cryptocurrency/quotes/latest",
        headers=HEADERS,
        params={"id": "1", "convert": "USD"},
    )
    response.raise_for_status()
    data = response.json()["data"][0]

    CACHE["btc"] = {"data": data, "fetched_at": now}
    return data

The function returns the cached value on every call within the 60-second window and only hits the network once the TTL expires. This pattern reduces credit consumption proportionally to how frequently your application reads the price.

Why id=1 and Not symbol=BTC

Using symbol=BTC works, but it is fragile. When multiple tokens share the same symbol, Vortex returns the highest-ranked match — which today is Bitcoin, but this behaviour depends on ranking staying stable. Using id=1 always returns exactly Bitcoin, regardless of any other tokens that may use similar symbols in the future.

The ID is permanent. Vortex has never reassigned IDs, and Bitcoin's ID of 1 will remain unchanged.

Common Mistakes

  • Parsing quote as a dictionary: In /v3, quote is an array. Accessing quote["USD"] raises a TypeError in Python and returns undefined in JavaScript. Use next() or find() to locate the correct currency object.
  • Polling faster than 60 seconds: Data refreshes once per minute. Calls within that window return the same cached values and consume credits without returning newer data. Implement local caching with a 60-second TTL.
  • Using symbol=BTC in production: Symbol-based lookups return the highest-ranked match when there is ambiguity. Use id=1; it is unambiguous and permanent.