Skip to main content
GET
/
v1
/
portfolio
/
chart
cURL
curl --request GET \
  --url 'https://api.coinstats.app/v1/portfolio/chart?type=24h' \
  --header 'X-API-KEY: <api-key>'
import requests

url = "https://api.coinstats.app/v1/portfolio/chart?type=24h"

headers = {"X-API-KEY": "<api-key>"}

response = requests.request("GET", url, headers=headers)

print(response.json())
const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};

fetch('https://api.coinstats.app/v1/portfolio/chart?type=24h', options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coinstats.app/v1/portfolio/chart?type=24h",
CURLOPT_RETURNTRANSFER => true,
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"
"io"
"net/http"
)

func main() {

url := "https://api.coinstats.app/v1/portfolio/chart?type=24h"

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/chart?type=24h")
.header("X-API-KEY", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.coinstats.app/v1/portfolio/chart")

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": [
    [
      1755864000000,
      297711.24614580005,
      2.65026183,
      69.53175117
    ],
    [
      1755864000000,
      297711.24614580005,
      2.65026183,
      69.53175117
    ]
  ]
}
{
"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"
}
10 credits per request
  • Total portfolio value at different time points
  • Performance metrics for various time ranges
  • Historical Profit/Loss (PnL) data
This endpoint is only available for users with a Degen plan subscription (when using shareToken).
  • 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 chart for all API-connected portfolios
  • type: Specify the time range for the chart data (e.g., “24h”, “1w”, “1m”, “1y”)
  • passcode: Passcode for accessing protected portfolio data (can be passed in header or query parameter)

Authorizations

X-API-KEY
string
header
required

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

sharetoken
string
passcode
string

Passcode for accessing protected portfolio data

Example:

"123456"

Query Parameters

type
enum<string>
required

One of time periods.

Available options:
24h,
1w,
1m,
3m,
6m,
1y,
all
Example:

"24h"

portfolioId
string

Portfolio ID for accessing a specific API-connected portfolio. Required if shareToken is not provided.

Example:

"abc123def456"

Response

Portfolio Chart

result
number[][]
required

Array of historical price data points. Each data point is an array containing:

  1. TIMESTAMP - Unix timestamp in seconds
  2. USD - Price in USD
  3. BTC - Price in Bitcoin
  4. ETH - Price in Ethereum
Example:
[
[
1755864000000,
297711.24614580005,
2.65026183,
69.53175117
],
[
1755864000000,
297711.24614580005,
2.65026183,
69.53175117
]
]