curl --request GET \
--url https://api.engine.usesophic.com/accounts/{account_id}/earnings \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.engine.usesophic.com/accounts/{account_id}/earnings"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.engine.usesophic.com/accounts/{account_id}/earnings', 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://api.engine.usesophic.com/accounts/{account_id}/earnings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.engine.usesophic.com/accounts/{account_id}/earnings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.engine.usesophic.com/accounts/{account_id}/earnings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engine.usesophic.com/accounts/{account_id}/earnings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"account": "<string>",
"cash": {
"attribution": {
"currency": {
"total": "<string>"
}
},
"gross": "<string>"
},
"currency": "EUR",
"fees": "<string>",
"gross": "<string>",
"net": "<string>",
"period_end": "2026-03-31T23:59:59Z",
"period_start": "2026-01-01T00:00:00Z",
"positions": {
"attribution": {
"currency": {
"realized": {
"capital": "<string>",
"income": "<string>"
},
"total": "<string>",
"unrealized": {
"capital": "<string>",
"income": "<string>"
}
},
"investment": {
"realized": {
"capital": "<string>",
"income": "<string>"
},
"total": "<string>",
"unrealized": {
"capital": "<string>",
"income": "<string>"
}
}
},
"gross": "<string>"
}
}{
"code": "<string>",
"detail": "<string>",
"context": {},
"docs": "<string>",
"params": [
{
"code": "<string>",
"detail": "<string>",
"path": [
123
]
}
]
}Retrieve account earnings (P&L)
Retrieve an account’s earnings (P&L) for the requested period. Note the period supports full date-times, with timezone information.
curl --request GET \
--url https://api.engine.usesophic.com/accounts/{account_id}/earnings \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.engine.usesophic.com/accounts/{account_id}/earnings"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.engine.usesophic.com/accounts/{account_id}/earnings', 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://api.engine.usesophic.com/accounts/{account_id}/earnings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.engine.usesophic.com/accounts/{account_id}/earnings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.engine.usesophic.com/accounts/{account_id}/earnings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engine.usesophic.com/accounts/{account_id}/earnings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"account": "<string>",
"cash": {
"attribution": {
"currency": {
"total": "<string>"
}
},
"gross": "<string>"
},
"currency": "EUR",
"fees": "<string>",
"gross": "<string>",
"net": "<string>",
"period_end": "2026-03-31T23:59:59Z",
"period_start": "2026-01-01T00:00:00Z",
"positions": {
"attribution": {
"currency": {
"realized": {
"capital": "<string>",
"income": "<string>"
},
"total": "<string>",
"unrealized": {
"capital": "<string>",
"income": "<string>"
}
},
"investment": {
"realized": {
"capital": "<string>",
"income": "<string>"
},
"total": "<string>",
"unrealized": {
"capital": "<string>",
"income": "<string>"
}
}
},
"gross": "<string>"
}
}{
"code": "<string>",
"detail": "<string>",
"context": {},
"docs": "<string>",
"params": [
{
"code": "<string>",
"detail": "<string>",
"path": [
123
]
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Predefined period over which earnings are computed. Takes precedence over period_start/period_end when provided.
1d, 1w, 1m, this-month, 3m, 6m, ytd, 1y, all The period start (in ISO 8601 format). If omitted, it defaults to the account opening date/time. Note that the period is interpreted as a half-open interval with period_start included and period_end excluded.
"period_start=2025-11-12T00:00:00Z"
"period_start=2025-11-12"
Response
Successful Response
ID of the account the earnings were computed for.
What uninvested foreign-currency cash gained or lost from exchange-rate movements.
Show child attributes
Show child attributes
Reporting currency of the earnings amounts.
EUR, USD, GBP Fees deducted from gross earnings.
Everything the account earned before fees: today's value minus the net money paid in, with fees added back. Also equals the positions' gross plus the cash gross.
Everything the account earned after fees: gross minus fees.
End date and time of the earnings period.
"2026-03-31T23:59:59Z"
Start date and time of the earnings period.
"2026-01-01T00:00:00Z"
What the account's positions earned, with a breakdown of where it came from.
Show child attributes
Show child attributes