---
title: "Get historical candle data for a specific instrument"
method: GET
path: "/v4/user/accounts/{server}/{accountId}/candles/{instrumentId}"
tags: ["Candles (v4)"]
---

# Get historical candle data for a specific instrument

`GET /v4/user/accounts/{server}/{accountId}/candles/{instrumentId}`

## Request

- Base URL: `https://trading-api.oanda.com` (the document declares no server; this is the origin it was published from)
- URL: `https://trading-api.oanda.com/v4/user/accounts/{server}/{accountId}/candles/{instrumentId}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/oanda/apis/up-gateway-v1/docs/v4/user/accounts/:server/:accountId/candles/:instrumentId/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves historical candle data for a specific instrument.

## Path parameters

- `server` 'oanda' | 'oanda-demo' | 'otms' | 'v20' | 'v20-demo' | 'oj' | 'oj-demo' | 'opt' | 'ftmo-1', required
- `accountId` string, required
- `instrumentId` string, required

## Query parameters

- `from` string
- `to` string, required
- `granularity` 'M1' | 'M5' | 'M15' | 'H1' | 'H4' | 'D1', required
- `countBack` integer

## Response `200`

Success response

- object
  - `data` object[], required
    - `open` number, required
    - `close` number, required
    - `low` number, required
    - `high` number, required
    - `time` number, required
    - `complete` boolean, required
    - `volume` number, required

---

[API](https://skmtc.dev/oanda/apis/up-gateway-v1.md) - [All operations](https://skmtc.dev/oanda/apis/up-gateway-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/oanda/apis/up-gateway-v1/revisions/395d645513bf?raw)
