curl --request GET \
--url https://api.coinstats.app/v1/portfolio/coins \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.coinstats.app/v1/portfolio/coins"
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://api.coinstats.app/v1/portfolio/coins', 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.coinstats.app/v1/portfolio/coins",
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://api.coinstats.app/v1/portfolio/coins"
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://api.coinstats.app/v1/portfolio/coins")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinstats.app/v1/portfolio/coins")
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{
"result": [
{
"count": 44.4987,
"coin": {
"rank": 2,
"identifier": "ethereum",
"symbol": "ETH",
"name": "Ethereum",
"icon": "https://static.coinstats.app/coins/1650455629727.png",
"priceChange24h": -5.74,
"priceChange1h": 0.1,
"priceChange7d": 1.12,
"priceChange1m": 8.42,
"volume": 61315198931.43572,
"isFake": false,
"isFiat": false
},
"price": {
"USD": 4343.564311034,
"BTC": 0.039479708,
"ETH": 1
},
"profitPercent": {
"allTime": {
"USD": 83720.75297372,
"BTC": 0.054246576,
"ETH": -0.0008427712028833412
},
"hour24": {
"USD": -11770.04265107636,
"BTC": -0.055726915608058335,
"ETH": 0
},
"lastTrade": {
"USD": -0.0011652685976688212,
"BTC": -8.325768295004658e-9,
"ETH": 8.470329472543003e-22
},
"unrealized": {
"USD": 64875.375139922,
"BTC": 0.516615331,
"ETH": -0.000013421973257266018
},
"realized": {
"USD": 18844.785945298,
"BTC": -0.46237401135664413,
"ETH": -0.0008426785167330308
}
},
"profit": {
"allTime": {
"USD": 83720.75297372,
"BTC": 0.054246576,
"ETH": -0.0008427712028833412
},
"hour24": {
"USD": -11770.04265107636,
"BTC": -0.055726915608058335,
"ETH": 0
},
"lastTrade": {
"USD": -0.0011652685976688212,
"BTC": -8.325768295004658e-9,
"ETH": 8.470329472543003e-22
},
"unrealized": {
"USD": 64875.375139922,
"BTC": 0.516615331,
"ETH": -0.000013421973257266018
},
"realized": {
"USD": 18844.785945298,
"BTC": -0.46237401135664413,
"ETH": -0.0008426785167330308
}
},
"averageBuy": {
"allTime": {
"USD": 83720.75297372,
"BTC": 0.054246576,
"ETH": -0.0008427712028833412
},
"hour24": {
"USD": -11770.04265107636,
"BTC": -0.055726915608058335,
"ETH": 0
},
"lastTrade": {
"USD": -0.0011652685976688212,
"BTC": -8.325768295004658e-9,
"ETH": 8.470329472543003e-22
},
"unrealized": {
"USD": 64875.375139922,
"BTC": 0.516615331,
"ETH": -0.000013421973257266018
},
"realized": {
"USD": 18844.785945298,
"BTC": -0.46237401135664413,
"ETH": -0.0008426785167330308
}
},
"averageSell": {
"allTime": {
"USD": 83720.75297372,
"BTC": 0.054246576,
"ETH": -0.0008427712028833412
},
"hour24": {
"USD": -11770.04265107636,
"BTC": -0.055726915608058335,
"ETH": 0
},
"lastTrade": {
"USD": -0.0011652685976688212,
"BTC": -8.325768295004658e-9,
"ETH": 8.470329472543003e-22
},
"unrealized": {
"USD": 64875.375139922,
"BTC": 0.516615331,
"ETH": -0.000013421973257266018
},
"realized": {
"USD": 18844.785945298,
"BTC": -0.46237401135664413,
"ETH": -0.0008426785167330308
}
},
"liquidityScore": 94.44676177373067,
"volatilityScore": 6.823477152064536,
"marketCapScore": 90.15554879029162,
"riskScore": 7.407055529347417,
"avgChange": 2.631321607022045,
"totalCost": {
"USD": 160,
"BTC": 0.0016,
"ETH": 0.032
}
}
]
}{
"statusCode": 400,
"message": "Bad Request",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 401,
"message": "Unauthorized",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 403,
"message": "Forbidden",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 404,
"message": "Not Found",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 409,
"message": "Transactions not synced",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 503,
"message": "Service Unavailable. Please Contact Support"
}Get Portfolio Coins
Get detailed information about all coins in your portfolio
curl --request GET \
--url https://api.coinstats.app/v1/portfolio/coins \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.coinstats.app/v1/portfolio/coins"
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://api.coinstats.app/v1/portfolio/coins', 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.coinstats.app/v1/portfolio/coins",
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://api.coinstats.app/v1/portfolio/coins"
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://api.coinstats.app/v1/portfolio/coins")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinstats.app/v1/portfolio/coins")
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{
"result": [
{
"count": 44.4987,
"coin": {
"rank": 2,
"identifier": "ethereum",
"symbol": "ETH",
"name": "Ethereum",
"icon": "https://static.coinstats.app/coins/1650455629727.png",
"priceChange24h": -5.74,
"priceChange1h": 0.1,
"priceChange7d": 1.12,
"priceChange1m": 8.42,
"volume": 61315198931.43572,
"isFake": false,
"isFiat": false
},
"price": {
"USD": 4343.564311034,
"BTC": 0.039479708,
"ETH": 1
},
"profitPercent": {
"allTime": {
"USD": 83720.75297372,
"BTC": 0.054246576,
"ETH": -0.0008427712028833412
},
"hour24": {
"USD": -11770.04265107636,
"BTC": -0.055726915608058335,
"ETH": 0
},
"lastTrade": {
"USD": -0.0011652685976688212,
"BTC": -8.325768295004658e-9,
"ETH": 8.470329472543003e-22
},
"unrealized": {
"USD": 64875.375139922,
"BTC": 0.516615331,
"ETH": -0.000013421973257266018
},
"realized": {
"USD": 18844.785945298,
"BTC": -0.46237401135664413,
"ETH": -0.0008426785167330308
}
},
"profit": {
"allTime": {
"USD": 83720.75297372,
"BTC": 0.054246576,
"ETH": -0.0008427712028833412
},
"hour24": {
"USD": -11770.04265107636,
"BTC": -0.055726915608058335,
"ETH": 0
},
"lastTrade": {
"USD": -0.0011652685976688212,
"BTC": -8.325768295004658e-9,
"ETH": 8.470329472543003e-22
},
"unrealized": {
"USD": 64875.375139922,
"BTC": 0.516615331,
"ETH": -0.000013421973257266018
},
"realized": {
"USD": 18844.785945298,
"BTC": -0.46237401135664413,
"ETH": -0.0008426785167330308
}
},
"averageBuy": {
"allTime": {
"USD": 83720.75297372,
"BTC": 0.054246576,
"ETH": -0.0008427712028833412
},
"hour24": {
"USD": -11770.04265107636,
"BTC": -0.055726915608058335,
"ETH": 0
},
"lastTrade": {
"USD": -0.0011652685976688212,
"BTC": -8.325768295004658e-9,
"ETH": 8.470329472543003e-22
},
"unrealized": {
"USD": 64875.375139922,
"BTC": 0.516615331,
"ETH": -0.000013421973257266018
},
"realized": {
"USD": 18844.785945298,
"BTC": -0.46237401135664413,
"ETH": -0.0008426785167330308
}
},
"averageSell": {
"allTime": {
"USD": 83720.75297372,
"BTC": 0.054246576,
"ETH": -0.0008427712028833412
},
"hour24": {
"USD": -11770.04265107636,
"BTC": -0.055726915608058335,
"ETH": 0
},
"lastTrade": {
"USD": -0.0011652685976688212,
"BTC": -8.325768295004658e-9,
"ETH": 8.470329472543003e-22
},
"unrealized": {
"USD": 64875.375139922,
"BTC": 0.516615331,
"ETH": -0.000013421973257266018
},
"realized": {
"USD": 18844.785945298,
"BTC": -0.46237401135664413,
"ETH": -0.0008426785167330308
}
},
"liquidityScore": 94.44676177373067,
"volatilityScore": 6.823477152064536,
"marketCapScore": 90.15554879029162,
"riskScore": 7.407055529347417,
"avgChange": 2.631321607022045,
"totalCost": {
"USD": 160,
"BTC": 0.0016,
"ETH": 0.032
}
}
]
}{
"statusCode": 400,
"message": "Bad Request",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 401,
"message": "Unauthorized",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 403,
"message": "Forbidden",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 404,
"message": "Not Found",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 409,
"message": "Transactions not synced",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 503,
"message": "Service Unavailable. Please Contact Support"
}You will get
You will get
- Current holdings and their USD value
- Profit/Loss (PnL) information
- Performance metrics and statistics
- Risk assessment scores (optional)
Required
Required
- shareToken OR portfolioId: Provide one of these to identify the portfolio.
- shareToken: Get this from your CoinStats portfolio page by clicking “Share”
- portfolioId: Use a portfolio connected via POST /portfolio/wallet or POST /portfolio/exchange
- If neither is provided, returns aggregated coins from all API-connected portfolios
Optional
Optional
- page & limit: Control the number of results per page
- includeRiskScore: Set to “true” to include risk metrics
- passcode: Passcode for accessing protected portfolio data (can be passed in header or query parameter)
Authorizations
API key required to access the endpoints. Generate one from your dashboard at https://openapi.coinstats.app and pass it in the X-API-KEY request header. Never expose your key in client-side code.
Headers
Passcode for accessing protected portfolio data
"123456"
Query Parameters
Page number to retrieve (1-based indexing)
1
Number of items to return per page
20
Include Risk Score Information
true, false "true"
Portfolio ID for accessing a specific API-connected portfolio. Required if shareToken is not provided.
"abc123def456"
Response
Portfolio coins
Array of portfolio items containing detailed information about each held cryptocurrency including prices, profits, averages, and risk metrics
Show child attributes
Show child attributes
Was this page helpful?