> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Market Chart

Get historical price, market cap, and volume data for a cryptocurrency as time series. Returns [timestamp, value] pairs from oldest to newest. Granularity: 5-min (1d), hourly (2-90d), daily (90d+). Set interval='daily' to force daily data. Range: 1 day to 'max'. Ideal for: price charts, trend analysis, return calculations, backtesting strategies.

![Get Market Chart logo](https://ai-icon.b3.fun/logo/coingecko)
Catalog action Blockchain Data

Get historical price, market cap, and volume data for a cryptocurrency as time series. Returns [timestamp, value] pairs from oldest to newest. Granularity: 5-min (1d), hourly (2-90d), daily (90d+). Set interval='daily' to force daily data. Range: 1 day to 'max'. Ideal for: price charts, trend analysis, return calculations, backtesting strategies.


## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `coingecko-get-market-chart` |
| Category | Blockchain Data |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `coingecko`, `chart`, `historical`, `price`, `time-series`, `analysis`, `trading`, `read` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `coinId` | `string` | Yes | CoinGecko coin ID \(e.g., 'bitcoin', 'ethereum'\). Use the search action to find coin IDs. |
| `vsCurrency` | `string` | Yes | Target currency for prices \(e.g., 'usd', 'eur', 'btc'\). |
| `days` | `number \| string` | Yes | Number of days of data. Options: 1, 7, 14, 30, 90, 180, 365, or 'max' for all history. Data granularity: 5-min for 1 day, hourly for 2-90 days, daily for 90+ days. |
| `interval` | `string` | No | Data interval. 'daily' for daily data, 'hourly' for hourly \(Pro only\). Auto-selected if not specified. |
| `precision` | `number` | No | Decimal precision for prices. Range: 0-18. Default: full precision |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `coinId` | `string` | Yes | Coin ID that was queried |
| `vsCurrency` | `string` | Yes | Target currency |
| `prices` | `array` | Yes | Array of price data points |
| `marketCaps` | `array` | Yes | Array of market cap data points |
| `totalVolumes` | `array` | Yes | Array of volume data points |

## Examples

**Workflow node**

```json
{
  "type": "coingecko-get-market-chart",
  "payload": {
    "coinId": "example-coinId",
    "vsCurrency": "example-vsCurrency",
    "days": 1
  },
  "children": []
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/coingecko-get-market-chart/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "coinId": "example-coinId",
    "vsCurrency": "example-vsCurrency",
    "days": 1
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.