81trust / 100
Coin Ohlc
by Coin OHLC candles in Onchain & crypto
x402 APIPassing, checked 1 h ago
OHLC candles for a coin: days 1 (30-min candles), 7 or 14 (4-hour), 30 / 90 / 180 / 365 (daily), in any vs currency. Returns aligned {time, open, high, low, close} bars plus the window's high/low/first/last and % change. The candle sibling of crypto-history, which returns close-only points: use OHLC for technical indicators, range/volatility work and charting. Cached in-process for 60 seconds.
GET https://agent402.tools/api/coin-ohlc
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 100%
- Response time
- 190 ms typical, 190 ms slowest 5%
- Last check
- 1 h ago
- Next check
- any minute now
How to call it
# See the payment challenge (nothing is charged)
curl -i -X GET "https://agent402.tools/api/coin-ohlc?coin=bitcoin¤cy=usd&days=7"import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client().register(
"eip155:8453",
new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagent402.tools%2Fapi%2Fcoin-ohlc
const res = await pay("https://agent402.tools/api/coin-ohlc?coin=bitcoin¤cy=usd&days=7");
console.log(await res.json());Example input
{
"coin": "bitcoin",
"currency": "usd",
"days": 7
}Example output
{
"bars": [
{
"close": 66210.3,
"high": 66500.1,
"low": 65900,
"open": 66120.4,
"time": "2026-08-15T16:00:00.000Z"
}
],
"cached": false,
"coin": "bitcoin",
"count": 42,
"currency": "usd",
"days": 7,
"fetchedAt": "2026-08-22T13:20:00.000Z",
"granularity": "4h",
"source": "coingecko",
"summary": {
"changePct": 3.16,
"first": 66120.4,
"high": 69850,
"last": 68210,
"low": 64995.9
}
}Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 1 h ago | Passed | 402 | 190 ms | $0.008 |
| 7 h ago | Passed | 402 | 196 ms | $0.008 |