Broker API HubMenu

Capital.com API GET /api/v1/positions/{dealId}

GET/api/v1/positions/{dealId}version v1Positions

One open position by its dealId.

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 unofficialopen-api.capital.comchecked

Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.

Parameters

NameInTypeDescription
dealIdrequiredpathstringPermanent deal ID of the position, from GET /api/v1/positions or the affectedDeals in a confirm. Mock value shown.

Authentication headers

NameTypeDescription
CSTrequiredstringAccess token returned in the CST response header of POST /session. Valid for 10 minutes after last use. Placeholder only.
X-SECURITY-TOKENrequiredstringAccount token returned in the X-SECURITY-TOKEN response header of POST /session. It selects the financial account. Placeholder only.

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 CAPITAL_CST, CAPITAL_SECURITY_TOKEN as environment variables first. Never paste real values into code.
# CAPITAL_CST and CAPITAL_SECURITY_TOKEN hold the CST and X-SECURITY-TOKEN headers that POST /api/v1/session returns: step 3 of the quickstart (/brokers/capital-com/quickstart#step-3) captures them and this sample reads them back.
# Replace each {placeholder}, "..." and 0 with a real value before running.
import os
import requests

BASE_URL = "https://demo-api-capital.backend-capital.com"  # the demo host
headers = {
    "CST": os.environ["CAPITAL_CST"],
    "X-SECURITY-TOKEN": os.environ["CAPITAL_SECURITY_TOKEN"],
}
resp = requests.get(BASE_URL + "/api/v1/positions/{dealId}", headers=headers, timeout=10)
resp.raise_for_status()
print(resp.json())
JavaScript
// Set CAPITAL_CST, CAPITAL_SECURITY_TOKEN as environment variables first. Never paste real values into code.
// CAPITAL_CST and CAPITAL_SECURITY_TOKEN hold the CST and X-SECURITY-TOKEN headers that POST /api/v1/session returns: step 3 of the quickstart (/brokers/capital-com/quickstart#step-3) captures them and this sample reads them back.
// Replace each {placeholder}, "..." and 0 with a real value before running.
// Run as a module, for example a .mjs file, on a Node version that has fetch built in.
const BASE_URL = "https://demo-api-capital.backend-capital.com"; // the demo host
const res = await fetch(BASE_URL + "/api/v1/positions/{dealId}", {
  method: "GET",
  headers: {
    "CST": process.env.CAPITAL_CST,
    "X-SECURITY-TOKEN": process.env.CAPITAL_SECURITY_TOKEN,
  },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
curl
# Set CAPITAL_CST, CAPITAL_SECURITY_TOKEN as environment variables first. Never paste real values into code.
# CAPITAL_CST and CAPITAL_SECURITY_TOKEN hold the CST and X-SECURITY-TOKEN headers that POST /api/v1/session returns: step 3 of the quickstart (/brokers/capital-com/quickstart#step-3) captures them and this sample reads them back.
# Replace each {placeholder}, "..." and 0 with a real value before running.
curl -X GET "https://demo-api-capital.backend-capital.com/api/v1/positions/{dealId}" \
  -H "CST: $CAPITAL_CST" \
  -H "X-SECURITY-TOKEN: $CAPITAL_SECURITY_TOKEN"

Response

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

{
  "_mock": true,
  "position": {
    "contractSize": 1,
    "createdDate": "2026-09-18T10:00:00.000",
    "createdDateUTC": "2026-09-18T09:00:00.000",
    "dealId": "MOCK-DEAL-0001",
    "dealReference": "p_MOCK-DEAL-0001",
    "size": 1,
    "leverage": 10,
    "upl": -0.05,
    "direction": "BUY",
    "level": 30.14,
    "currency": "USD",
    "guaranteedStop": false
  },
  "market": {
    "instrumentName": "Silver",
    "expiry": "-",
    "epic": "SILVER",
    "instrumentType": "COMMODITIES",
    "marketStatus": "TRADEABLE",
    "lotSize": 1,
    "high": 30.5,
    "low": 29.8,
    "percentageChange": 0.51,
    "netChange": 0.15,
    "bid": 30.12,
    "offer": 30.14,
    "updateTime": "2026-09-18T10:15:00.000",
    "updateTimeUTC": "2026-09-18T09:15:00.000",
    "delayTime": 0,
    "streamingPricesAvailable": true,
    "scalingFactor": 1
  }
}

Response schema, HTTP 200

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

FieldTypeDescription
positionobjectNot recorded
contractSizenumberNot recorded
createdDatestringNot recorded
createdDateUTCstringNot recorded
dealIdstringNot recorded
dealReferencestringNot recorded
sizenumberNot recorded
leveragenumberNot recorded
uplnumberNot recorded
directionstringNot recorded
levelnumberNot recorded
currencystringNot recorded
guaranteedStopbooleanNot recorded
marketobjectNot recorded
instrumentNamestringNot recorded
expirystringNot recorded
epicstringNot recorded
instrumentTypestringNot recorded
marketStatusstringNot recorded
lotSizenumberNot recorded
highnumberNot recorded
lownumberNot recorded
percentageChangenumberNot recorded
netChangenumberNot recorded
bidnumberNot recorded
offernumberNot recorded
updateTimestringNot recorded
updateTimeUTCstringNot recorded
delayTimenumberNot recorded
streamingPricesAvailablebooleanNot recorded
scalingFactornumberNot 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 Capital.com

LimitValueScopeSource
Headline limit10/s per useruseropen-api.capital.comchecked

Capital.com API errors you may meet

All Capital.com API error codes, including 18 more not listed here.