Get P&L time series
curl --request GET \
--url https://carboncopy.inc/api/v1/portfolio/pnl-history \
--header 'Authorization: Bearer <token>'import requests
url = "https://carboncopy.inc/api/v1/portfolio/pnl-history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://carboncopy.inc/api/v1/portfolio/pnl-history', 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://carboncopy.inc/api/v1/portfolio/pnl-history",
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://carboncopy.inc/api/v1/portfolio/pnl-history"
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://carboncopy.inc/api/v1/portfolio/pnl-history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://carboncopy.inc/api/v1/portfolio/pnl-history")
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{
"data": {
"items": [
{
"date": "2026-03-01T12:00:00.000Z",
"timestamp": 1772400000000,
"value": 12.5,
"realizedPnl": 8,
"unrealizedPnl": 4.5
}
]
},
"meta": {
"requestId": "cf7301af-0c1e-4354-85a8-9153db69ae6d",
"timestamp": 1741600000000
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}{
"error": {
"code": "forbidden",
"message": "This key does not have the required scope."
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded. Retry after 30 seconds."
}
}Portfolio
Get P&L time series
Returns time-series portfolio P&L snapshots (captured every 15 minutes) for charting performance over time. Includes realized and unrealized P&L breakdown.
GET
/
api
/
v1
/
portfolio
/
pnl-history
Get P&L time series
curl --request GET \
--url https://carboncopy.inc/api/v1/portfolio/pnl-history \
--header 'Authorization: Bearer <token>'import requests
url = "https://carboncopy.inc/api/v1/portfolio/pnl-history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://carboncopy.inc/api/v1/portfolio/pnl-history', 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://carboncopy.inc/api/v1/portfolio/pnl-history",
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://carboncopy.inc/api/v1/portfolio/pnl-history"
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://carboncopy.inc/api/v1/portfolio/pnl-history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://carboncopy.inc/api/v1/portfolio/pnl-history")
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{
"data": {
"items": [
{
"date": "2026-03-01T12:00:00.000Z",
"timestamp": 1772400000000,
"value": 12.5,
"realizedPnl": 8,
"unrealizedPnl": 4.5
}
]
},
"meta": {
"requestId": "cf7301af-0c1e-4354-85a8-9153db69ae6d",
"timestamp": 1741600000000
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}{
"error": {
"code": "forbidden",
"message": "This key does not have the required scope."
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded. Retry after 30 seconds."
}
}Authorizations
API key in the format cc_<64 hex characters>. Obtain from the Dashboard under Settings → API Keys.
Query Parameters
Number of days of history to return.
Required range:
1 <= x <= 90Aggregation interval — returns the last snapshot per bucket. Use 1h or 4h for more granularity.
Available options:
1h, 4h, 1d Was this page helpful?
⌘I

