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"
}Connect 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"
}You will get
You will get
- 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
Required
Required
- address: Wallet address to connect
- connectionId: Blockchain network identifier (e.g., “ethereum”). Use GET /wallet/blockchains for supported networks.
Optional
Optional
- name: Custom display name for the portfolio
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.
Body
Wallet address to connect.
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Blockchain network identifier (e.g., "ethereum", "polygon"). Use GET /wallet/blockchains to get the list of supported blockchains.
"ethereum"
Optional display name for the portfolio.
"My Ethereum Wallet"
Response
Connect Wallet Portfolio
The unique identifier of the connected portfolio.
"a1b2c3d4e5f6..."
The connectionId used to connect the portfolio.
"ethereum"
"connected" if a new portfolio was created, "existing" if the portfolio already exists.
connected, existing "connected"
Was this page helpful?