SDK
import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getTokenPnL('FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', '6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN');
curl --request GET \
--url https://data.solanatracker.io/pnl/{wallet}/{token} \
--header 'x-api-key: <api-key>'import requests
url = "https://data.solanatracker.io/pnl/{wallet}/{token}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://data.solanatracker.io/pnl/{wallet}/{token}', 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://data.solanatracker.io/pnl/{wallet}/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-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://data.solanatracker.io/pnl/{wallet}/{token}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-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://data.solanatracker.io/pnl/{wallet}/{token}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.solanatracker.io/pnl/{wallet}/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"holding": 34587.83040999995,
"held": 569619.4014500001,
"sold": 569619.4014500001,
"sold_usd": 8.848779535217,
"realized": 4.101715619389,
"unrealized": -0.696452596669,
"total": 3.40526302272,
"total_sold": 8.848779535217,
"total_invested": 5.919909387386,
"average_buy_amount": 0.227688822592,
"current_value": 0.476392874873,
"cost_basis": 0.000033909195,
"first_buy_time": 1750435283197,
"last_buy_time": 1753194281458,
"last_sell_time": 1754205433802,
"last_trade_time": 1754205433802,
"buy_transactions": 26,
"sell_transactions": 23,
"total_transactions": 49
}PnL
Deprecated: Get Token-Specific PnL
deprecated
Deprecated. Use PnL V2 instead: GET /v2/pnl/wallets/{wallet}/tokens/{token}.
Gets Profit and Loss data for a specific token in a wallet
GET
/
pnl
/
{wallet}
/
{token}
SDK
import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getTokenPnL('FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', '6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN');
curl --request GET \
--url https://data.solanatracker.io/pnl/{wallet}/{token} \
--header 'x-api-key: <api-key>'import requests
url = "https://data.solanatracker.io/pnl/{wallet}/{token}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://data.solanatracker.io/pnl/{wallet}/{token}', 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://data.solanatracker.io/pnl/{wallet}/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-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://data.solanatracker.io/pnl/{wallet}/{token}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-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://data.solanatracker.io/pnl/{wallet}/{token}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.solanatracker.io/pnl/{wallet}/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"holding": 34587.83040999995,
"held": 569619.4014500001,
"sold": 569619.4014500001,
"sold_usd": 8.848779535217,
"realized": 4.101715619389,
"unrealized": -0.696452596669,
"total": 3.40526302272,
"total_sold": 8.848779535217,
"total_invested": 5.919909387386,
"average_buy_amount": 0.227688822592,
"current_value": 0.476392874873,
"cost_basis": 0.000033909195,
"first_buy_time": 1750435283197,
"last_buy_time": 1753194281458,
"last_sell_time": 1754205433802,
"last_trade_time": 1754205433802,
"buy_transactions": 26,
"sell_transactions": 23,
"total_transactions": 49
}SDK Example
import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getTokenPnL('FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', '6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN');
Authorizations
API Key for authentication
Response
200 - application/json
Successful response
Was this page helpful?
⌘I