---
name: Get Token Chart
description: Fetches historical price/market cap data for a token (OHLCV).
---

# Get Token Chart

Fetch historical chart data for a token. Useful for technical analysis, detecting trends, or visualizing price movement.

## API Endpoint
`GET https://api.nadapp.net/trade/chart/:tokenAddress`

## Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| `resolution` | `number` | Yes | Candle duration in minutes. | `15` (15m), `60` (1h), `240` (4h), `D` (1d) |
| `from` | `number` | Yes | Start timestamp (Unix seconds). | `1770416559` |
| `to` | `number` | Yes | End timestamp (Unix seconds). | `1770712659` |
| `countback` | `number` | No | Number of candles to fetch backwards from `to`. | `329` |
| `chart_type` | `string` | No | Type of data. Default `market_cap_usd`. | `market_cap_usd`, `price_usd` (if supported) |

## Response Format
```json
{
  "s": "ok",
  "t": [1770701400, 1770704100], // Timestamps
  "o": ["3.7", "3.7"],           // Open
  "h": ["3.7", "3.5"],           // High
  "l": ["3.7", "3.5"],           // Low
  "c": ["3.7", "3.5"],           // Close
  "v": ["1749.99", "1722.53"]    // Volume
}
```

## Example Usage
```typescript
const token = "0xBF5A6c6295d04914cD8651A45eDE7B4A78e57777";
const now = Math.floor(Date.now() / 1000);
const from = now - (24 * 60 * 60); // 24 hours ago
const resolution = 15;

const url = `https://api.nadapp.net/trade/chart/${token}?resolution=${resolution}&from=${from}&to=${now}&chart_type=market_cap_usd`;
const res = await fetch(url);
const data = await res.json();

if (data.s === "ok") {
    console.log(`Open: ${data.o[data.o.length-1]}, Close: ${data.c[data.c.length-1]}`);
}
```
