> For the complete documentation index, see [llms.txt](https://docs.nexus.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexus.xyz/api-reference/candles/fetch-o-h-l-c-v.md).

# GET /markets/{market\_id}/candles

Get OHLCV candles.

`operationId`: `fetchOHLCV` · CCXT method: `fetchOHLCV`

**Authentication:** none — this operation is public.

Returns candlestick data as arrays: \[timestamp, open, high, low, close, volume], ascending by timestamp. Optionally bounded by `startTime` / `endTime`; unbounded, it returns the latest `limit` bars.

**`startTime` sets the paging direction.** With `startTime` given, the **earliest** `limit` bars at or after it are returned, so the standard `ccxt.fetchOHLCV` loop that advances `since` progresses: each request starts where the last one ended. Without `startTime` — the unbounded or `endTime`-only case — the **most recent** `limit` bars in the window are returned, which is what "the latest bars" means above and is unchanged. To reconstruct a long history, pass `startTime` and advance it by the timestamp after the last bar received. This operation has no pagination cursor.

## Parameters

| Name        | In    | Type                         | Required | Description                                                                                                                                                                                                                                                                                                                                                                                    |
| ----------- | ----- | ---------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `None`      | None  | —                            | No       | —                                                                                                                                                                                                                                                                                                                                                                                              |
| `timeframe` | query | `1s` \| `1m` \| `5m` \| `1h` | No       | —                                                                                                                                                                                                                                                                                                                                                                                              |
| `None`      | None  | —                            | No       | —                                                                                                                                                                                                                                                                                                                                                                                              |
| `None`      | None  | —                            | No       | —                                                                                                                                                                                                                                                                                                                                                                                              |
| `limit`     | query | `integer`                    | No       | Maximum number of bars to return. A value above the maximum is clamped rather than rejected. The maximum is what the server accepts, not a promise of how many bars exist: the effective ceiling depends on the history available for that market and timeframe, so a response may hold fewer bars than requested. Read `x-nexus-candles-truncated` to tell a capped page from a complete one. |

## Responses

| Status | Body                     | Meaning                       |
| ------ | ------------------------ | ----------------------------- |
| `200`  | array of array of —      | OHLCV candles for the market. |
| `400`  | — *(no schema declared)* | —                             |
| `429`  | — *(no schema declared)* | —                             |

## Example

```bash
curl -X GET 'https://exchange.nexus.xyz/api/exchange/markets/{market_id}/candles'
```

***

<sub>Generated from</sub> <sub></sub><sub>`eng/apps/exchange/api/openapi.json`</sub> <sub></sub><sub>(spec</sub> <sub></sub><sub>`0.9.27`</sub><sub>). Do not edit by hand — regenerate with</sub> <sub></sub><sub>`python3 product/docs/tools/api-reference/generate.py`</sub><sub>. Hand-authored context lives in the Guides pages.</sub>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.nexus.xyz/api-reference/candles/fetch-o-h-l-c-v.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
