Skip to content

Coin market chart for a time window

$0.008 per callUSDC via x402GET /api/coin-market-chart-range

Price, market cap and volume series for a coin over an ARBITRARY time window: `from`/`to` as unix seconds or ISO dates, or `lookback` ("6h", "3d", "2w") ending now. Send GET /api/coin-market-chart-range with the required field coin and pay $0.008 per call over x402 or MPP (there is no free tier). It returns a JSON object with source, fetchedAt, cached, coin, currency and 7 more.

Granularity is automatic upstream: 5-minute points for a window of 1 day or less, hourly up to 90 days, daily beyond. The windowed sibling of crypto-history (which counts days back from now): use it to align with a specific event, a filing date or another series. Window must lie within the past 365 days on this plan, enforced before the call. Cached in-process for 60 seconds. Data provided by CoinGecko (https://www.coingecko.com/en/api).

Category: Crypto & onchain dataTags: crypto history range chart timeseries backtest event-study

Try in playground →

Parameters

NameTypeRequiredDescription
coinstringyesCoin id (bitcoin, ethereum, ...). Also accepted as symbol, id, ticker, asset.
fromstringnoWindow start: unix seconds or ISO-8601 date. Default = to minus 24h.
tostringnoWindow end: unix seconds or ISO-8601 date. Default = now.
lookbackstringnoAlternative to from: a window ending at `to`, like "6h", "3d" or "2w".
currencystringnovs currency (default usd).

Example request

curl -i "https://agent402.tools/api/coin-market-chart-range?coin=ethereum&lookback=3d&currency=usd"

Without payment this returns HTTP 402 Payment Required with the exact price for coin-market-chart-range; any x402 v2 or MPP client pays it and retries.

Watch a call get paid

RequestGET /api/coin-market-chart-range
402$0.008 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "source": "coingecko",
  "fetchedAt": "2026-08-22T13:20:00.000Z",
  "cached": false,
  "coin": "ethereum",
  "currency": "usd",
  "from": "2026-08-19T13:20:00.000Z",
  "to": "2026-08-22T13:20:00.000Z",
  "count": 73,
  "granularity": "1h",
  "summary": {
    "first": 2380.1,
    "last": 2424.5,
    "high": 2480.1,
    "low": 2350,
    "changePct": 1.87
  },
  "points": [
    {
      "time": "2026-08-19T14:00:00.000Z",
      "price": 2380.1,
      "marketCap": 287000000000,
      "volume": 13800000000
    }
  ],
  "credit": "Data provided by CoinGecko (https://www.coingecko.com/en/api)."
}
FieldTypeAlways presentIn the example
sourcestringyescoingecko
fetchedAtstringyes2026-08-22T13:20:00.000Z
cachedbooleanyesfalse
coinstringyesethereum
currencystringyesusd
fromstringyes2026-08-19T13:20:00.000Z
tostringyes2026-08-22T13:20:00.000Z
countnumberyes73
granularitystringyes1h
summaryobjectyes5 fields: first, last, high, low, changePct
pointsarray of objectsyes1 item in the example
creditstringyesData provided by CoinGecko (https://www.coingecko.com/en/api).

From an MCP client

catalog.call {
  "slug": "coin-market-chart-range",
  "params": {
    "coin": "ethereum",
    "lookback": "3d",
    "currency": "usd"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for coin-market-chart-range; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp@0.14.0.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.008" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/coin-market-chart-range?coin=ethereum&lookback=3d&currency=usd");

Related tools

Token price history (USD)

$0.001POST /api/token-price-history

Historical USD price series for a token, by ticker symbol (ETH, BTC, SOL, ...) or by ERC-20 contract + network.

Crypto price history

$0.015GET /api/crypto-history

Crypto price chart series over a window of days: bars[] of {time, price, marketCap, volume} for charts and backtests.

Coin OHLC candles

$0.003GET /api/coin-ohlc

OHLC candles for a coin: days 1 (30-min candles), 7 or 14 (4-hour), 30 / 90 / 180 / 365 (daily), in any vs currency.

Wallet token transfers (filtered)

$0.003POST /api/asset-transfers

Recent token transfers for a wallet on Base, Ethereum and other EVM chains, newest first.

Coin snapshot on a date

$0.005GET /api/coin-history

Price, market cap and 24h volume of a coin on ONE past date (00:00 UTC snapshot), in every currency at once plus your.

Wallet transaction history

$0.001POST /api/wallet-transactions

Return the most recent asset transfers (incoming + outgoing) for a wallet address - native coin, ERC-20, ERC-721.