Broker API HubMenu

OANDA API GET /v3/accounts/{accountID}/pricing/stream

GET/v3/accounts/{accountID}/pricing/streamversion v3Pricing

Streaming prices over one long lived HTTP connection. Newline delimited JSON: PRICE and HEARTBEAT objects.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Independent and unofficialdeveloper.oanda.comchecked

Confirmed on the official pricing endpoints page. Method, path and request parameters were re-read on that page on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field. Served by the stream host (stream-fxpractice.oanda.com or stream-fxtrade.oanda.com), not the REST host. At most 4 prices per second per instrument (every 250 ms); heartbeats every 5 seconds. Mock shows stream lines as an array for display only.

Parameters

NameInTypeDescription
Accept-Datetime-FormatheaderstringOptional. RFC3339 (default) or UNIX for epoch seconds in datetime fields.
accountIDrequiredpathstringAccount ID from GET /v3/accounts. Mock value shown.
instrumentsrequiredquerystringComma separated instrument names.
snapshotquerybooleanSend the current price for each instrument first. Default true.
includeHomeConversionsquerybooleanInclude home currency conversion updates.

Authentication headers

NameTypeDescription
AuthorizationrequiredstringSend Bearer followed by your personal access token. Placeholder only: never paste a real token into this site.

Request

Written from the method, path and parameters recorded on this page, against the demo host. Not executed against a live or demo account. Credentials are read from environment variables on your own machine and are never entered on this site. The request builder writes these same snippets, from the same record.

Python
# Set OANDA_TOKEN, OANDA_ACCOUNT_ID as environment variables first. Never paste real values into code.
# Replace each {placeholder}, "..." and 0 with a real value before running.
# Optional and not shown: headers Accept-Datetime-Format; query parameters snapshot, includeHomeConversions.
# This endpoint streams. Read the response line by line instead of as one JSON document.
import os
import requests

BASE_URL = "https://stream-fxpractice.oanda.com"  # the demo host
headers = {
    "Authorization": "Bearer " + os.environ["OANDA_TOKEN"],
}
params = {"instruments": "{instruments}"}
resp = requests.get(BASE_URL + "/v3/accounts/" + os.environ["OANDA_ACCOUNT_ID"] + "/pricing/stream", headers=headers, params=params, timeout=10)
resp.raise_for_status()
print(resp.text)
JavaScript
// Set OANDA_TOKEN, OANDA_ACCOUNT_ID as environment variables first. Never paste real values into code.
// Replace each {placeholder}, "..." and 0 with a real value before running.
// Optional and not shown: headers Accept-Datetime-Format; query parameters snapshot, includeHomeConversions.
// This endpoint streams. Read the response line by line instead of as one JSON document.
// Run as a module, for example a .mjs file, on a Node version that has fetch built in.
const BASE_URL = "https://stream-fxpractice.oanda.com"; // the demo host
const res = await fetch(BASE_URL + "/v3/accounts/" + process.env.OANDA_ACCOUNT_ID + "/pricing/stream" + "?instruments={instruments}", {
  method: "GET",
  headers: {
    "Authorization": "Bearer " + process.env.OANDA_TOKEN,
  },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.text());
curl
# Set OANDA_TOKEN, OANDA_ACCOUNT_ID as environment variables first. Never paste real values into code.
# Replace each {placeholder}, "..." and 0 with a real value before running.
# Optional and not shown: headers Accept-Datetime-Format; query parameters snapshot, includeHomeConversions.
# This endpoint streams. Read the response line by line instead of as one JSON document.
curl -X GET "https://stream-fxpractice.oanda.com/v3/accounts/$OANDA_ACCOUNT_ID/pricing/stream?instruments={instruments}" \
  -H "Authorization: Bearer $OANDA_TOKEN"

Response

A mock response. The values are invented, so check field names against the official reference.

{
  "_mock": true,
  "stream_lines": [
    {
      "type": "PRICE",
      "instrument": "EUR_USD",
      "time": "2026-09-18T08:00:00.250000000Z",
      "tradeable": true,
      "bids": [
        {
          "price": "1.10010",
          "liquidity": 1000000
        }
      ],
      "asks": [
        {
          "price": "1.10020",
          "liquidity": 1000000
        }
      ]
    },
    {
      "type": "HEARTBEAT",
      "time": "2026-09-18T08:00:05.000000000Z"
    }
  ]
}

Response schema, HTTP 200

Every field this site's OpenAPI file for OANDA declares for this response.

FieldTypeDescription
stream_linesarray of objectsNot recorded
typestringNot recorded
instrumentstringNot recorded
timestringNot recorded
tradeablebooleanNot recorded
bidsarray of objectsNot recorded
pricestringNot recorded
liquiditynumberNot recorded
asksarray of objectsNot recorded
pricestringNot recorded
liquiditynumberNot recorded

Unverifiedno source opened This schema is not sourced to a page of the provider's own that we opened, so check field names against the official reference.

Limits that apply at OANDA

LimitValueScopeSource
Headline limit120/s per IP address, HTTP 429 above itipdeveloper.oanda.comchecked

OANDA API errors you may meet

All OANDA API error codes, including 236 more not listed here.