curl --request POST \
--url https://pro-api.nikiwa.com/api/tools/get_wallet_pnl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": "<string>",
"network": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"page": 1,
"records_per_page": 20
}
'import requests
url = "https://pro-api.nikiwa.com/api/tools/get_wallet_pnl"
payload = {
"address": "<string>",
"network": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"page": 1,
"records_per_page": 20
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
address: '<string>',
network: '<string>',
from_date: '<string>',
to_date: '<string>',
page: 1,
records_per_page: 20
})
};
fetch('https://pro-api.nikiwa.com/api/tools/get_wallet_pnl', 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://pro-api.nikiwa.com/api/tools/get_wallet_pnl",
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([
'address' => '<string>',
'network' => '<string>',
'from_date' => '<string>',
'to_date' => '<string>',
'page' => 1,
'records_per_page' => 20
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://pro-api.nikiwa.com/api/tools/get_wallet_pnl"
payload := strings.NewReader("{\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"page\": 1,\n \"records_per_page\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
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://pro-api.nikiwa.com/api/tools/get_wallet_pnl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"page\": 1,\n \"records_per_page\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pro-api.nikiwa.com/api/tools/get_wallet_pnl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"page\": 1,\n \"records_per_page\": 20\n}"
response = http.request(request)
puts response.read_body{
"type": "pnl_detailed",
"summary": {
"total_tokens": 1,
"total_realized_pnl_usd": 50,
"total_unrealized_pnl_usd": 25,
"total_pnl_usd": 75,
"profitable_tokens": 1,
"losing_tokens": 0,
"neutral_tokens": 0
},
"data": [
{
"token_symbol": "EXM",
"token_address": "0x3333333333333333333333333333333333333333",
"chain": "ethereum",
"pnl": {
"realized_usd": 50,
"unrealized_usd": 25,
"total_usd": 75,
"realized_roi_percent": 20,
"unrealized_roi_percent": 10
},
"holdings": {
"current_amount": 100,
"current_value_usd": 250
}
}
],
"metadata": {
"address": "0x1111111111111111111111111111111111111111"
}
}get_wallet_pnl
Detailed realized/unrealized PnL for a wallet (per-token, with totals).
curl --request POST \
--url https://pro-api.nikiwa.com/api/tools/get_wallet_pnl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": "<string>",
"network": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"page": 1,
"records_per_page": 20
}
'import requests
url = "https://pro-api.nikiwa.com/api/tools/get_wallet_pnl"
payload = {
"address": "<string>",
"network": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"page": 1,
"records_per_page": 20
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
address: '<string>',
network: '<string>',
from_date: '<string>',
to_date: '<string>',
page: 1,
records_per_page: 20
})
};
fetch('https://pro-api.nikiwa.com/api/tools/get_wallet_pnl', 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://pro-api.nikiwa.com/api/tools/get_wallet_pnl",
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([
'address' => '<string>',
'network' => '<string>',
'from_date' => '<string>',
'to_date' => '<string>',
'page' => 1,
'records_per_page' => 20
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://pro-api.nikiwa.com/api/tools/get_wallet_pnl"
payload := strings.NewReader("{\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"page\": 1,\n \"records_per_page\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
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://pro-api.nikiwa.com/api/tools/get_wallet_pnl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"page\": 1,\n \"records_per_page\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pro-api.nikiwa.com/api/tools/get_wallet_pnl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"<string>\",\n \"network\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"page\": 1,\n \"records_per_page\": 20\n}"
response = http.request(request)
puts response.read_body{
"type": "pnl_detailed",
"summary": {
"total_tokens": 1,
"total_realized_pnl_usd": 50,
"total_unrealized_pnl_usd": 25,
"total_pnl_usd": 75,
"profitable_tokens": 1,
"losing_tokens": 0,
"neutral_tokens": 0
},
"data": [
{
"token_symbol": "EXM",
"token_address": "0x3333333333333333333333333333333333333333",
"chain": "ethereum",
"pnl": {
"realized_usd": 50,
"unrealized_usd": 25,
"total_usd": 75,
"realized_roi_percent": 20,
"unrealized_roi_percent": 10
},
"holdings": {
"current_amount": 100,
"current_value_usd": 250
}
}
],
"metadata": {
"address": "0x1111111111111111111111111111111111111111"
}
}Reading the result
The response example uses made-up values and shows selected fields. Fields vary by network and available data.-
databreaks profit and loss down by token.pnlseparates realized and unrealized USD amounts and ROI percentages. -
tradingcontains purchase, sale, and cost-basis statistics;holdingsdescribes the remaining position. -
summarytotals the returned token rows. Pagination and date-range details vary by result. Tron returns an availability note instead of PnL data.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Wallet address to analyze on the selected network.
Network to query, for example ethereum. See Supported Networks for coverage.
Start of the requested date range, in YYYY-MM-DD format. Omit to use the default date range.
End of the requested date range, in YYYY-MM-DD format. Omit to use the default date range.
Page number to retrieve, starting at 1.
Number of records to request per page.
Response
Detailed realized/unrealized PnL for a wallet (per-token, with totals). Fields vary by network and available data. Check for status: no_data, status: error, or an error field even when HTTP status is 200. See Errors & status.
Response fields depend on the network and available data. The example shows selected fields; see Reading the result for details.
Was this page helpful?