# CoinGecko — Coin Historical Chart Data within Time Range by ID

Get CoinGecko historical chart data for a Unix time range via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by CoinGecko, pass parameters such as from, to, vs_currency, and retrieve structured data including prices, market caps, and total volumes for bounded history views, and period comparisons, ready for production pipelines and AI agent automation.

Documentation: https://openany.si/coingecko/coingecko-coin-historical-chart-data-within-time-range-by-id/6792afaa-3e05-40f1-961a-d85aaca96348/
API ID: 6792afaa-3e05-40f1-961a-d85aaca96348
Provider: CoinGecko
Contract revision: 4
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/coingecko/api/v3/coins/{id}/market_chart/range
Page update time: 2026-12-03T02:49:12.805Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0 / call
The published contract currently has no usage charge. Authentication and service limits still apply.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:49:12.368Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## CoinGecko Coin Chart Range API

Provide a coin ID, vs\_currency, and integer from/to Unix timestamps in seconds. Chart responses use millisecond timestamp-value pairs. Optional interval is hourly or daily; optional precision affects price formatting, not the requested time range.

## What You Can Build

- **Bounded history views**: Request a selected time window for one coin.
- **Period comparisons**: Align currency units and returned timestamps across separate requests.

## Documented Response Fields

| Field | Meaning |
| --- | --- |
| `prices[]` | Pair of millisecond timestamp and reported price |
| `market_caps[]` | Pair of millisecond timestamp and market capitalization |
| `total_volumes[]` | Pair of millisecond timestamp and reported 24-hour volume |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "CoinGecko — Coin Historical Chart Data within Time Range by ID request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Coin ID. \n*refers to [`/coins/list`](/reference/coins-list)."
        }
      },
      "required": [
        "id"
      ]
    },
    "query": {
      "type": "object",
      "properties": {
        "vs_currency": {
          "type": "string",
          "description": "Target currency of market data. \n*refers to [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies)."
        },
        "from": {
          "type": "integer",
          "description": "Starting date in UNIX timestamp."
        },
        "to": {
          "type": "integer",
          "description": "Ending date in UNIX timestamp."
        },
        "interval": {
          "type": "string",
          "description": "Data interval, leave empty for auto granularity.",
          "enum": [
            "hourly",
            "daily"
          ]
        },
        "precision": {
          "type": "string",
          "description": "Decimal place for currency price value.",
          "enum": [
            "full",
            "0",
            "1",
            "2",
            "3",
            "4",
            "5",
            "6",
            "7",
            "8",
            "9",
            "10",
            "11",
            "12",
            "13",
            "14",
            "15",
            "16",
            "17",
            "18"
          ]
        }
      },
      "required": [
        "vs_currency",
        "from",
        "to"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "market_caps": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    },
    "prices": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    },
    "total_volumes": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    }
  }
}
```

## Request example
Scenario: Official example · Official response / contract request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/coingecko/api/v3/coins/bitcoin/market_chart/range?from=1792972800&to=1793059200&vs_currency=usd' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "market_caps": [
    [
      1779027899041,
      1560631481361.8042
    ],
    [
      1779028199661,
      1562027330524.267
    ]
  ],
  "prices": [
    [
      1779027899041,
      77953.82550382407
    ],
    [
      1779028199661,
      78052.87543398788
    ]
  ],
  "total_volumes": [
    [
      1779027899041,
      18688431751.857048
    ],
    [
      1779028199661,
      18974828816.446976
    ]
  ]
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### What units do from and to use?
Use integer Unix timestamps in seconds. Response array timestamps are in milliseconds, so do not copy them unchanged into from or to.

### Can I send days instead?
No. This selected range contract requires from and to. The separate lookback chart endpoint uses days.

### Does precision change sampling frequency?
No. precision controls price decimals. interval controls the supported hourly or daily sampling request, or can be omitted for automatic granularity.

### Can I use these points as OHLC candles?
No. The arrays contain sampled observations, not open/high/low/close rows. Use an OHLC endpoint and retain its candle aggregation when building candlestick charts.

### Which API key should I use?
Use your OpenAny API key as Bearer authentication on the documented OpenAny route.

### Where can I check the current request price?
Check the pricing area for the selected implementation. Follow its billing unit and any request-dependent rules before sending the request.

## Available implementations
- CoinGecko: https://openany.si/coingecko/coingecko-coin-historical-chart-data-within-time-range-by-id/6792afaa-3e05-40f1-961a-d85aaca96348/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
