Skip to main content
GET
/
portfolio
/
pnl-chart
Get portfolio PnL chart
curl --request GET \
  --url https://api.limitless.exchange/portfolio/pnl-chart \
  --header 'lmts-api-key: <api-key>'
import requests

url = "https://api.limitless.exchange/portfolio/pnl-chart"

headers = {"lmts-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'lmts-api-key': '<api-key>'}};

fetch('https://api.limitless.exchange/portfolio/pnl-chart', 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.limitless.exchange/portfolio/pnl-chart",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"lmts-api-key: <api-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"
"net/http"
"io"
)

func main() {

url := "https://api.limitless.exchange/portfolio/pnl-chart"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("lmts-api-key", "<api-key>")

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.limitless.exchange/portfolio/pnl-chart")
.header("lmts-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.limitless.exchange/portfolio/pnl-chart")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["lmts-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "timeframe": "7d",
  "data": [
    {
      "timestamp": 1700000000000,
      "value": 123.45
    }
  ],
  "currentValue": -7.04,
  "previousValue": -6.5,
  "percentChange": 8.24,
  "current": {}
}

Authorizations

lmts-api-key
string
header
required

Scoped API token with HMAC-SHA256 signing. Requires three headers: lmts-api-key (token ID), lmts-timestamp (ISO-8601), lmts-signature (Base64-encoded HMAC). See Authentication docs for details.

Query Parameters

timeframe
string

Timeframe window for percent change and chart series

Example:

"7d"

Response

PnL chart data

timeframe
string
required

Timeframe window used for previous/current comparison

Example:

"7d"

data
object[]
required

Realised PnL series (USD) for the selected timeframe

currentValue
number
required

Current realised PnL (USD)

Example:

-7.04

previousValue
number
required

Previous realised PnL (USD) at timeframe start

Example:

-6.5

percentChange
number
required

Percent change between previousValue and currentValue (realised PnL)

Example:

8.24

current
object | null

Current PnL snapshot (hybrid: realised + unrealized + total)