Charts

Historical price charts supporting OHLC and simple formats across multiple timeframes. Chart endpoints are capped at 30 requests per minute on the Free tier; paid plans use their standard rate limit.

Data resolution

The API automatically selects the best data source for each timeframe. Raw price data is aggregated into hourly and daily OHLC candles for efficient long-range queries.

TimeframeResolutionData sourceHistory
1h5 minRaw data30 days
24h1 hourHourly candles1 year
7d1 hourHourly candles1 year
30d1 dayDaily candles5 years
90d1 dayDaily candles5 years
1y1 dayDaily candles5 years
max1 dayDaily candles5 years

GET/api/v1/charts/:coinId

Get chart data

Get historical price chart for a coin. Supports two formats:

  • ohlc (default) — full OHLC data with dataPoints array containing open, high, low, close, and price fields plus aggregate stats.
  • simple — lightweight [timestamp, price] pairs in a prices array.

Path parameters

  • Name
    coinId
    Type
    string
    Description

    Coin identifier (e.g., "bitcoin").

Optional attributes

  • Name
    timeframe
    Type
    string
    Description

    Chart timeframe: 1h, 24h, 7d, 30d, 90d, 1y, or max. Defaults to 24h.

  • Name
    format
    Type
    string
    Description

    Output format: ohlc or simple. Defaults to ohlc.

Request

GET
/api/v1/charts/bitcoin
curl -G https://api.bitcompare.net/api/v1/charts/bitcoin \
  -d timeframe=7d \
  -d format=ohlc

Response (OHLC format)

{
  "data": {
    "coinId": "bitcoin",
    "timeframe": "7d",
    "dataPoints": [
      {
        "timestamp": "2025-10-22T00:00:00Z",
        "price": 44500.00,
        "open": 44200.00,
        "high": 45100.00,
        "low": 44000.00,
        "close": 44800.00
      }
    ],
    "stats": {
      "minPrice": 43800.00,
      "maxPrice": 45500.00,
      "avgPrice": 44650.00,
      "changePct": 2.5,
      "totalPoints": 168
    }
  }
}

GET/api/v1/charts/:coinId/rates/:category

Category rate charts

Get historical rate charts for a specific rate category (lending, staking, or borrowing). Supports the same ohlc and simple formats as price charts — see above for format details. Rate charts use rate instead of price and rates instead of prices in the response.

Path parameters

  • Name
    coinId
    Type
    string
    Description

    Coin identifier.

  • Name
    category
    Type
    string
    Description

    Rate category: lending, staking, or borrowing.

Optional attributes

  • Name
    timeframe
    Type
    string
    Description

    Chart timeframe: 1h, 24h, 7d, 30d, 90d, 1y, or max. Defaults to 24h.

  • Name
    format
    Type
    string
    Description

    Output format: ohlc or simple. Defaults to ohlc.

Request

GET
/api/v1/charts/bitcoin/rates/lending
curl -G https://api.bitcompare.net/api/v1/charts/bitcoin/rates/lending \
  -d timeframe=30d

Response (OHLC format)

{
  "data": {
    "coinId": "bitcoin",
    "category": "lending",
    "timeframe": "30d",
    "dataPoints": [
      {
        "timestamp": 1729555200000,
        "rate": 5.2,
        "open": 5.1,
        "high": 5.3,
        "low": 5.0,
        "close": 5.2
      }
    ],
    "stats": {
      "minRate": 4.8,
      "maxRate": 5.5,
      "avgRate": 5.1,
      "changePct": 3.2,
      "totalPoints": 30
    }
  }
}

GET/api/v1/charts

Multi-coin charts

Get chart data for multiple coins in a single request.

Required attributes

  • Name
    coins
    Type
    string
    Description

    Comma-separated coin identifiers (e.g., "bitcoin,ethereum,cardano").

Optional attributes

  • Name
    timeframe
    Type
    string
    Description

    Chart timeframe. Defaults to 24h.

Request

GET
/api/v1/charts?coins=bitcoin,ethereum
curl -G https://api.bitcompare.net/api/v1/charts \
  -d coins=bitcoin,ethereum \
  -d timeframe=24h

Response

{
  "data": {
    "timeframe": "24h",
    "charts": {
      "bitcoin": {
        "coinId": "bitcoin",
        "timeframe": "24h",
        "dataPoints": [
          {
            "timestamp": "2025-10-29T00:00:00Z",
            "price": 44500.00,
            "open": 44200.00,
            "high": 45100.00,
            "low": 44000.00,
            "close": 44800.00
          }
        ],
        "stats": {
          "minPrice": 44500.00,
          "maxPrice": 45500.00,
          "avgPrice": 45000.00,
          "changePct": 1.2,
          "totalPoints": 24
        }
      },
      "ethereum": {
        "coinId": "ethereum",
        "timeframe": "24h",
        "dataPoints": [
          {
            "timestamp": "2025-10-29T00:00:00Z",
            "price": 2450.00,
            "open": 2430.00,
            "high": 2550.00,
            "low": 2420.00,
            "close": 2500.00
          }
        ],
        "stats": {
          "minPrice": 2450.00,
          "maxPrice": 2550.00,
          "avgPrice": 2500.00,
          "changePct": 0.8,
          "totalPoints": 24
        }
      }
    }
  }
}

GET/api/v1/charts/:coinId/current

Current price

Get the current price for a coin. Cached for 30 seconds.

Path parameters

  • Name
    coinId
    Type
    string
    Description

    Coin identifier.

Request

GET
/api/v1/charts/bitcoin/current
curl https://api.bitcompare.net/api/v1/charts/bitcoin/current

Response

{
  "data": {
    "coinId": "bitcoin",
    "price": 45000.50,
    "source": "local_database"
  }
}

Was this page helpful?