Skip to main content
POST
/
v1
/
portfolio
/
wallet
Connect a wallet to your account and create a tracked portfolio
curl --request POST \
  --url https://api.coinstats.app/v1/portfolio/wallet \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "connectionId": "ethereum",
  "name": "My Ethereum Wallet"
}
'
import requests

url = "https://api.coinstats.app/v1/portfolio/wallet"

payload = {
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"connectionId": "ethereum",
"name": "My Ethereum Wallet"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
connectionId: 'ethereum',
name: 'My Ethereum Wallet'
})
};

fetch('https://api.coinstats.app/v1/portfolio/wallet', 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/wallet",
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' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'connectionId' => 'ethereum',
'name' => 'My Ethereum Wallet'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.coinstats.app/v1/portfolio/wallet"

payload := strings.NewReader("{\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"connectionId\": \"ethereum\",\n \"name\": \"My Ethereum Wallet\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-API-KEY", "<api-key>")
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://api.coinstats.app/v1/portfolio/wallet")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"connectionId\": \"ethereum\",\n \"name\": \"My Ethereum Wallet\"\n}")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"connectionId\": \"ethereum\",\n \"name\": \"My Ethereum Wallet\"\n}"

response = http.request(request)
puts response.read_body
{
  "portfolioId": "a1b2c3d4e5f6...",
  "connectionId": "ethereum",
  "status": "connected"
}
{
"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"
}
40 credits per request
  • A portfolioId you can use to query portfolio data (value, coins, chart, transactions, defi, snapshot)
  • Automatic portfolio creation with visibility set to API
  • Background transaction sync initiated
  • address: Wallet address to connect
  • connectionId: Blockchain network identifier (e.g., “ethereum”). Use GET /wallet/blockchains for supported networks.
  • name: Custom display name for the portfolio

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.

Body

application/json
address
string
required

Wallet address to connect.

Example:

"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

connectionId
string
required

Blockchain network identifier (e.g., "ethereum", "polygon"). Use GET /wallet/blockchains to get the list of supported blockchains.

Example:

"ethereum"

name
string

Optional display name for the portfolio.

Example:

"My Ethereum Wallet"

Response

Connect Wallet Portfolio

portfolioId
string
required

The unique identifier of the connected portfolio.

Example:

"a1b2c3d4e5f6..."

connectionId
string
required

The connectionId used to connect the portfolio.

Example:

"ethereum"

status
enum<string>
required

"connected" if a new portfolio was created, "existing" if the portfolio already exists.

Available options:
connected,
existing
Example:

"connected"