Scan to Download ios&Android APP

API Documentation

Request examples

POST ​/session

Login to the account and start the session.

Request:
curl -L -X POST 'https://api-capital.backend-capital.com/api/v1/session' \
-H 'X-CAP-API-KEY: evSlp0fTjsk2S26P' \
-H 'Content-Type: application/json' \
--data-raw '{
"encryptedPassword": "false" 
"identifier": "test@gmail.com",
 "password": "Xxxx9999_"
}'
Request parameters
Parameter Format Mandatory? Description
encryptedPassword boolean NO Shows whether the mentioned password is encrypted with the AES encryption method.
This parameter value = FALSE by default.
identifier string YES Login value.
password string YES Password value.
Response:
{
 "accountType": "CFD",
 "accountInfo": {
 "balance": 602.63,
 "deposit": 602.35,
 "profitLoss": -7.72,
 "available": 600.78
 },
 "currencyIsoCode": "USD",
 "currencySymbol": "$",
 "currentAccountId": "23116495826791396",
 "streamingHost": "wss://api-streaming-capital.backend-capital.com/",
 "accounts": [
 {
 "accountId": "23116495826791396",
 "accountName": "USD",
 "preferred": true,
 "accountType": "CFD"
 },
 {
 "accountId": "24550935676066052",
 "accountName": "secondAcc",
 "preferred": false,
 "accountType": "CFD"
 }
],
 "clientId": "1111111",
 "timezoneOffset": 3,
 "hasActiveDemoAccounts": false,
 "hasActiveLiveAccounts": true,
 "trailingStopsEnabled": false
}
POST ​/positions

Open a position.

Response:
curl -L -X POST 'https://api-capital.backend-capital.com/api/v1/positions' \
-H 'X-SECURITY-TOKEN: Flg82t6hAesdMULfp4M8MdKnLkk9313' \
-H 'CST: Lp3e5WLALdkfsfN2MNdr7vk5' \
-H 'Content-Type: application/json' \
--data-raw '{
 "epic": "NATURALGAS",
 "direction": "BUY",
 "size": 100
}'
Request parameters
Parameter Format Mandatory? Description
direction enum YES Direction of the trade: BUY or SELL.
epic string YES The market in which the trade should take place.
guaranteedStop boolean NO Guaranteed or normal stop loss.
limitAmount number NO Take profit amount.
limitDistance number NO Take profit distance from the current asset price.
limitLevel number NO Take profit price.
size number YES Size of the trade.
stopAmount number NO Stop loss amount.
stopDistance number NO Stop loss distance from the current asset price.
stopLevel number NO Stop loss price.
Response:
{
 "dealReference": "o_43839486-f53j-478o-8162-193j7kcd509i"
}
POST ​/workingorders

Create a limit/stop order.

Response:
curl -L -X POST 'https://api-capital.backend-capital.com/api/v1/workingorders' \
-H 'X-SECURITY-TOKEN: Flg82t6hAesdMULfp4M8MdKnLkk9313' \
-H 'CST: Lp3e5WLALdkfsfN2MNdr7vk5'\
-H 'Content-Type: application/json' \
--data-raw '{
 "epic": "NATURALGAS",
 "direction": "BUY",
 "size": 1,
 "level": 2300,
 "type": "LIMIT",
 "stopLevel": 2000
}'
Parameter Format Mandatory? Description
direction enum YES Direction of the trade: BUY or SELL.
epic string YES The market in which the trade should take place.
goodTillDate string NO Order expiration date. Format: YYYY-MM-DDTHH:MM:SS (e.g. 2022-04-01T01:01:00)
guaranteedStop boolean NO Guaranteed or normal stop loss.
Set to normal by default.
level number YES Order price level.
limitAmount number NO Take profit amount.
limitDistance number NO Take profit distance from the current asset price.
limitLevel number NO Take profit price.
size number YES Size of the trade.
stopAmount number NO Stop loss amount.
stopDistance number NO Stop loss distance from the current asset price.
stopLevel number NO Stop loss price.
type enum YES Order type: LIMIT or STOP.
Response:
{
 "dealReference": "o_da3727b2-eafb-4efa-a05a-63f8a632ab58"
}

Still looking for a broker you can trust?


Join the 400.000+ traders worldwide that chose to trade with Capital.com

1. Create & verify your account

2. Make your first deposit

3. You’re all set. Start trading