> For the complete documentation index, see [llms.txt](https://docs.42.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.42.space/for-developers/rest-api-alpha/markets/get-ohlc-candlestick-data.md).

# Get OHLC candlestick data

GET /api/v1/market-data/ohlc

## Get OHLC candlestick data

> Returns OHLC (open/high/low/close) candlestick data for a specific outcome token over a given time range and bucket interval. Provide token ID or outcome index (not both). Payout fields are included for resolved markets.

```json
{"openapi":"3.1.1","info":{"title":"FortyTwo Read API","version":"1.0"},"tags":[{"description":"GET /api/v1/market-data/ohlc","name":"get-ohlc"}],"servers":[{"url":"https://rest.ft.42.space/"}],"paths":{"/api/v1/market-data/ohlc":{"get":{"description":"Returns OHLC (open/high/low/close) candlestick data for a specific outcome token over a given time range and bucket interval. Provide token ID or outcome index (not both). Payout fields are included for resolved markets.","tags":["get-ohlc"],"summary":"Get OHLC candlestick data","parameters":[{"schema":{"type":"string"},"description":"Market contract address","name":"market","in":"query","required":true},{"schema":{"type":"string"},"description":"Outcome token ID (provide token_id or outcome_index, not both)","name":"token_id","in":"query"},{"schema":{"type":"integer"},"description":"Outcome index, 0-based (provide token_id or outcome_index, not both)","name":"outcome_index","in":"query"},{"schema":{"type":"string","enum":["1s","10s","1m","3m","30m","2h","6h","12h","1d"]},"description":"Candle bucket interval","name":"interval","in":"query","required":true},{"schema":{"type":"integer"},"description":"Start unix timestamp (default: 24h before end_ts)","name":"start_ts","in":"query"},{"schema":{"type":"integer"},"description":"End unix timestamp (default: now)","name":"end_ts","in":"query"},{"schema":{"type":"integer"},"description":"Max data points returned (default 500, max 5000)","name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/internal_handler.OHLCResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ft_market-service-v2_pkg_api.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ft_market-service-v2_pkg_api.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ft_market-service-v2_pkg_api.ErrorResponse"}}}}}}}},"components":{"schemas":{"internal_handler.OHLCResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/internal_handler.OHLCDataPoint"}}}},"internal_handler.OHLCDataPoint":{"type":"object","properties":{"c":{"type":"number"},"closeCollateral":{"type":"number"},"closeMintedQuantity":{"type":"number"},"h":{"type":"number"},"l":{"type":"number"},"o":{"type":"number"},"openCollateral":{"type":"number"},"openMintedQuantity":{"type":"number"},"payoutClose":{"type":"number"},"payoutHigh":{"type":"number"},"payoutLow":{"type":"number"},"payoutMid":{"type":"number"},"payoutOpen":{"type":"number"},"t":{"type":"integer"},"v":{"type":"number"}}},"ft_market-service-v2_pkg_api.ErrorResponse":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"}}}}}}
```


---

# 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.42.space/for-developers/rest-api-alpha/markets/get-ohlc-candlestick-data.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.
