# CoinGecko OHLC Candlestick Data

> CoinGecko OHLC Candlestick Data is a paid API for AI agents from coingecko.use.x402atlas.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-11).

Returns daily open/high/low/close candlestick price data for any cryptocurrency over a 1–365 day window, identified by CoinGecko coin ID.

## Facts

- Endpoint: GET https://coingecko.use.x402atlas.com/ohlc?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coingecko-ohlc-candlestick-data-b3519d92
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mMQyMfTFxgYpdjHt9avT1

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability coingecko-ohlc-candlestick-data-b3519d92
```

Example prompt: Pull 30-day daily OHLC candlestick data for Bitcoin (coin ID: bitcoin) in USD from CoinGecko so I can chart the price action.

## When to prefer this

Choose this endpoint when you need structured OHLC candlestick price data for charting or technical analysis over a multi-day window. Prefer it over a simple spot price endpoint when historical daily open/high/low/close values are needed, and over a generic historical endpoint when chart-ready candle format is required. Ideal for feeding trading dashboards, backtesting, or visualizing price action.

## Known failure modes

- Invalid coin ID returns an error or empty response — check CoinGecko coin slug spelling
- Unsupported 'days' value (not one of 1, 7, 14, 30, 90, 180, 365) may return an error or unexpected data
- Invalid vs_currency code returns an error — use standard ISO 4217 codes like 'usd' or 'eur'
- Payment failure (x402) if USDC balance is insufficient — endpoint costs $0.005 per call
- Rate limiting if too many requests are made in a short period

## How this service works

OHLC candlestick data for crypto — daily open/high/low/close candles over 1-365 days for any coin by CoinGecko id, chart-ready.

## Output

An array of OHLC candles, each containing a timestamp plus open, high, low, and close price values in the requested currency, covering the specified number of days — ready for charting libraries or technical analysis.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "id",
      "days"
     ],
     "properties": {
      "id": {
       "type": "string",
       "description": "CoinGecko coin id slug"
      },
      "days": {
       "enum": [
        1,
        7,
        14,
        30,
        90,
        180,
        365
       ],
       "type": "integer",
       "description": "Window size in days: one of 1, 7, 14, 30, 90, 180, 365"
      },
      "vs_currency": {
       "type": "string",
       "default": "usd",
       "description": "Target currency code (default: usd)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "queried_at",
      "id",
      "vs_currency",
      "days",
      "candles"
     ],
     "properties": {
      "id": {
       "type": "string",
       "description": "CoinGecko coin id slug"
      },
      "days": {
       "type": "integer",
       "description": "Requested window size in days"
      },
      "candles": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "time",
         "open",
         "high",
         "low",
         "close"
        ],
        "properties": {
         "low": {
          "type": "number",
          "description": "Low price"
         },
         "high": {
          "type": "number",
          "description": "High price"
         },
         "open": {
          "type": "number",
          "description": "Open price"
         },
         "time": {
          "type": "string",
          "format": "date-time",
          "description": "Candle timestamp (UTC)"
         },
         "close": {
          "type": "number",
          "description": "Close price"
         }
        }
       },
       "description": "OHLC bars, oldest first"
      },
      "queried_at": {
       "type": "string",
       "format": "date-time",
       "description": "UTC timestamp the upstream was queried"
 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "bitcoin",
  "days": 30,
  "candles": [
   {
    "low": 26900,
    "high": 27100,
    "open": 27000,
    "time": "2026-05-08T00:00:00Z",
    "close": 27050
   }
  ],
  "queried_at": "2026-06-08T12:00:00Z",
  "vs_currency": "usd"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/coingecko-ohlc-candlestick-data-b3519d92/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from coingecko.use.x402atlas.com](https://www.zero.xyz/host/coingecko.use.x402atlas.com/llms.txt)
