curl --request POST \
--url https://public-api.etoro.com/api/v1/sub-accounts/me/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-request-id: <x-request-id>' \
--header 'x-user-key: <x-user-key>' \
--data '
{
"providerName": "etoro-trading",
"additionalParams": {
"username": "my-trading-account"
}
}
'import requests
url = "https://public-api.etoro.com/api/v1/sub-accounts/me/accounts"
payload = {
"providerName": "etoro-trading",
"additionalParams": { "username": "my-trading-account" }
}
headers = {
"x-request-id": "<x-request-id>",
"x-api-key": "<x-api-key>",
"x-user-key": "<x-user-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-request-id': '<x-request-id>',
'x-api-key': '<x-api-key>',
'x-user-key': '<x-user-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
providerName: 'etoro-trading',
additionalParams: {username: 'my-trading-account'}
})
};
fetch('https://public-api.etoro.com/api/v1/sub-accounts/me/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-api.etoro.com/api/v1/sub-accounts/me/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'providerName' => 'etoro-trading',
'additionalParams' => [
'username' => 'my-trading-account'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-api-key: <x-api-key>",
"x-request-id: <x-request-id>",
"x-user-key: <x-user-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.etoro.com/api/v1/sub-accounts/me/accounts"
payload := strings.NewReader("{\n \"providerName\": \"etoro-trading\",\n \"additionalParams\": {\n \"username\": \"my-trading-account\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-request-id", "<x-request-id>")
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-user-key", "<x-user-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public-api.etoro.com/api/v1/sub-accounts/me/accounts")
.header("x-request-id", "<x-request-id>")
.header("x-api-key", "<x-api-key>")
.header("x-user-key", "<x-user-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"providerName\": \"etoro-trading\",\n \"additionalParams\": {\n \"username\": \"my-trading-account\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.etoro.com/api/v1/sub-accounts/me/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-request-id"] = '<x-request-id>'
request["x-api-key"] = '<x-api-key>'
request["x-user-key"] = '<x-user-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providerName\": \"etoro-trading\",\n \"additionalParams\": {\n \"username\": \"my-trading-account\"\n }\n}"
response = http.request(request)
puts response.read_body{
"account": {
"subAccountId": "ZXRvcm8tdHJhZGluZw",
"providerName": "etoro-trading",
"accountId": "123456789",
"accountType": "Trading",
"accountVisibility": "Visible",
"accountCurrencies": [
"USD"
],
"status": "Approved",
"additionalData": {
"gcid": 123456789,
"realCid": 654321,
"demoCid": 111222,
"username": "my-trading-account"
}
},
"authorization": null
}{
"account": {
"subAccountId": "ZXRvcm8tdHJhZGluZw",
"providerName": "etoro-trading",
"accountId": "123456789",
"accountType": "Trading",
"accountVisibility": "Visible",
"accountCurrencies": [
"USD"
],
"status": "Pending",
"additionalData": {
"gcid": 123456789,
"realCid": 654321,
"demoCid": 111222,
"username": "my-trading-account"
}
},
"authorization": null
}Create My Sub-Account
Rate limit: 60 requests per 60 seconds. This is the default shared quota — it is shared with every other endpoint that has no dedicated limit, so requests across those endpoints all draw from the same budget.
Creates a sub-account for the authenticated user with the given provider. Currently the supported provider is etoro-trading (creates an eToro trading sub-account); additional sub-account providers will be added over time. For etoro-trading, additionalParams.username is required.
curl --request POST \
--url https://public-api.etoro.com/api/v1/sub-accounts/me/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-request-id: <x-request-id>' \
--header 'x-user-key: <x-user-key>' \
--data '
{
"providerName": "etoro-trading",
"additionalParams": {
"username": "my-trading-account"
}
}
'import requests
url = "https://public-api.etoro.com/api/v1/sub-accounts/me/accounts"
payload = {
"providerName": "etoro-trading",
"additionalParams": { "username": "my-trading-account" }
}
headers = {
"x-request-id": "<x-request-id>",
"x-api-key": "<x-api-key>",
"x-user-key": "<x-user-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-request-id': '<x-request-id>',
'x-api-key': '<x-api-key>',
'x-user-key': '<x-user-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
providerName: 'etoro-trading',
additionalParams: {username: 'my-trading-account'}
})
};
fetch('https://public-api.etoro.com/api/v1/sub-accounts/me/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-api.etoro.com/api/v1/sub-accounts/me/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'providerName' => 'etoro-trading',
'additionalParams' => [
'username' => 'my-trading-account'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-api-key: <x-api-key>",
"x-request-id: <x-request-id>",
"x-user-key: <x-user-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.etoro.com/api/v1/sub-accounts/me/accounts"
payload := strings.NewReader("{\n \"providerName\": \"etoro-trading\",\n \"additionalParams\": {\n \"username\": \"my-trading-account\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-request-id", "<x-request-id>")
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-user-key", "<x-user-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public-api.etoro.com/api/v1/sub-accounts/me/accounts")
.header("x-request-id", "<x-request-id>")
.header("x-api-key", "<x-api-key>")
.header("x-user-key", "<x-user-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"providerName\": \"etoro-trading\",\n \"additionalParams\": {\n \"username\": \"my-trading-account\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.etoro.com/api/v1/sub-accounts/me/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-request-id"] = '<x-request-id>'
request["x-api-key"] = '<x-api-key>'
request["x-user-key"] = '<x-user-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providerName\": \"etoro-trading\",\n \"additionalParams\": {\n \"username\": \"my-trading-account\"\n }\n}"
response = http.request(request)
puts response.read_body{
"account": {
"subAccountId": "ZXRvcm8tdHJhZGluZw",
"providerName": "etoro-trading",
"accountId": "123456789",
"accountType": "Trading",
"accountVisibility": "Visible",
"accountCurrencies": [
"USD"
],
"status": "Approved",
"additionalData": {
"gcid": 123456789,
"realCid": 654321,
"demoCid": 111222,
"username": "my-trading-account"
}
},
"authorization": null
}{
"account": {
"subAccountId": "ZXRvcm8tdHJhZGluZw",
"providerName": "etoro-trading",
"accountId": "123456789",
"accountType": "Trading",
"accountVisibility": "Visible",
"accountCurrencies": [
"USD"
],
"status": "Pending",
"additionalData": {
"gcid": 123456789,
"realCid": 654321,
"demoCid": 111222,
"username": "my-trading-account"
}
},
"authorization": null
}Authorizations
eToro OAuth2. Each operation lists the scopes that grant access as separate security requirements (OpenAPI OR semantics): the caller's token only needs ONE of them — you do NOT need all of them. The same scopes back the x-api-key/x-user-key credential pair.
Headers
A unique request identifier.
"a892a66d-a84a-43e0-a180-fec9ae5b970b"
API key for authentication.
"lhgfaslk21490FAScVPkdsb53F9dNkfHG4faZSG5vfjndfcfgdssdgsdHF4663"
User-specific authentication key.
"eyJlYW4iOiJVbnJlZ2lzdGVyZWRBcHBsaWNhdGlvbiIsImVrIjoiOE5sZ2cwcW5EUVdROUFNWGpXT2lmOWktZnpidG5KcUlqWGJ3WHJZZkpZcldrbG90ZEhvLVBjSWhQaU8xU1ZtMW84aU1WZGZqN2xWNzFjLXFxLmcybXE1dnh4Q1hUT25xaWRUaTFlcEhmVk1fIn0_"
Response
Sub-account created (etoro-trading).