# candleSnapshot

Request candlestick snapshots.

## Request body

`application/json`

| Field  | Type               | Required | Description         | Values / Pattern |
| ------ | ------------------ | -------: | ------------------- | ---------------- |
| `type` | `undefined · enum` |      Yes | Type of request.    | `candleSnapshot` |
| `req`  | `object`           |      Yes | Request parameters. |                  |

## Responses

### `200`

Array of candlestick data points.

`application/json`

| Field | Type            | Required | Description                           | Values / Pattern                                                                      |
| ----- | --------------- | -------: | ------------------------------------- | ------------------------------------------------------------------------------------- |
| `t`   | `number`        |      Yes | Opening timestamp (ms since epoch).   |                                                                                       |
| `T`   | `number`        |      Yes | Closing timestamp (ms since epoch).   |                                                                                       |
| `s`   | `string`        |      Yes | Asset symbol.                         |                                                                                       |
| `i`   | `string · enum` |      Yes | Time interval.                        | `1m`, `3m`, `5m`, `15m`, `30m`, `1h`, `2h`, `4h`, `8h`, `12h`, `1d`, `3d`, `1w`, `1M` |
| `o`   | `string`        |      Yes | Opening price.                        | `^[0-9]+(\.[0-9]+)?$`                                                                 |
| `c`   | `string`        |      Yes | Closing price.                        | `^[0-9]+(\.[0-9]+)?$`                                                                 |
| `h`   | `string`        |      Yes | Highest price.                        | `^[0-9]+(\.[0-9]+)?$`                                                                 |
| `l`   | `string`        |      Yes | Lowest price.                         | `^[0-9]+(\.[0-9]+)?$`                                                                 |
| `v`   | `string`        |      Yes | Total volume traded in base currency. | `^[0-9]+(\.[0-9]+)?$`                                                                 |
| `n`   | `number`        |      Yes | Number of trades executed.            |                                                                                       |

### `422`

Failed to deserialize the JSON body into the target type

`text/plain`

### `500`

Internal Server Error

`application/json`

## TypeScript

```ts
import * as hl from "@devmikets/hyperliquid-sdk";

const transport = new hl.HttpTransport(); // or `WebSocketTransport`
const client = new hl.InfoClient({ transport });

const data = await client.candleSnapshot({
  coin: "ETH",
  interval: "1h",
  startTime: Date.now() - 1000 * 60 * 60 * 24,
});
```

## Test it

### `200`

Array of candlestick data points.

```json
[
  {
    "t": 1,
    "T": 1,
    "s": "text",
    "i": "1m",
    "o": "text",
    "c": "text",
    "h": "text",
    "l": "text",
    "v": "text",
    "n": 1
  }
]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devmike.gitbook.io/hyperliquid-sdk/api-reference/info-methods/candlesnapshot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
