curl --request POST \
--url https://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"wallet_address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"network": "ethereum"
}
'import requests
url = "https://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown"
payload = {
"wallet_address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"network": "ethereum"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
wallet_address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
network: 'ethereum'
})
};
fetch('https://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown', 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://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown",
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([
'wallet_address' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'network' => 'ethereum'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown"
payload := strings.NewReader("{\n \"wallet_address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"network\": \"ethereum\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"wallet_address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"network\": \"ethereum\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet_address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"network\": \"ethereum\"\n}"
response = http.request(request)
puts response.read_body{
"total_value_displayed": "$2,500.00",
"tokens_without_price": 0,
"major_holdings": [
{
"symbol": "ETH",
"usd_value": 2500
}
],
"composition_analysis": {
"diversification": "Highly concentrated (single token)",
"note": "Analysis based on Top 1 token holdings"
},
"top_holdings": [
{
"symbol": "ETH",
"usd_value": 2500,
"chain": "ethereum",
"logo_url": null
}
]
}Execute a Tool
Call a Nikiwa tool and get its structured result.
curl --request POST \
--url https://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"wallet_address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"network": "ethereum"
}
'import requests
url = "https://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown"
payload = {
"wallet_address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"network": "ethereum"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
wallet_address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
network: 'ethereum'
})
};
fetch('https://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown', 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://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown",
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([
'wallet_address' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'network' => 'ethereum'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown"
payload := strings.NewReader("{\n \"wallet_address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"network\": \"ethereum\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"wallet_address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"network\": \"ethereum\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet_address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"network\": \"ethereum\"\n}"
response = http.request(request)
puts response.read_body{
"total_value_displayed": "$2,500.00",
"tokens_without_price": 0,
"major_holdings": [
{
"symbol": "ETH",
"usd_value": 2500
}
],
"composition_analysis": {
"diversification": "Highly concentrated (single token)",
"note": "Analysis based on Top 1 token holdings"
},
"top_holdings": [
{
"symbol": "ETH",
"usd_value": 2500,
"chain": "ethereum",
"logo_url": null
}
]
}get_wallet_portfolio_breakdown, used below, costs 8.
The Try it panel runs get_wallet_portfolio_breakdown. Enter wallet_address and network directly in the JSON body, as shown below.
To run another tool, open its page in the Tools sidebar section and fill in its inputs.
Example: wallet portfolio
curl -X POST https://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown \
-H "Authorization: Bearer nkw_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"network": "ethereum"
}'
import requests
r = requests.post(
"https://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown",
headers={"Authorization": "Bearer nkw_live_YOUR_KEY"},
json={
"wallet_address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"network": "ethereum",
},
)
data = r.json()
const res = await fetch(
"https://pro-api.nikiwa.com/api/tools/get_wallet_portfolio_breakdown",
{
method: "POST",
headers: {
Authorization: "Bearer nkw_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
wallet_address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
network: "ethereum",
}),
},
);
const data = await res.json();
Providing exact entities
Tools are deterministic and expect precise inputs: an exact wallet, token, or contract address, a transaction hash, and a network. If you only have a symbol or a name, resolve it first. Callresolve_token_symbol to turn a symbol into an address, or resolve_name to turn an ENS or SNS name into an address.
Result
On success you receive the tool’s data object. Invalid arguments return422 Unprocessable Entity and are not charged, so check the tool’s input schema from discovery if you hit one. When a tool has nothing to return, or hits a problem, you receive a status marker instead. See Errors & status.
Reading the portfolio result
The example uses made-up amounts and omits some response fields.major_holdings lists displayed tokens worth more than $1,000; top_holdings includes up to five holdings by value. total_value_displayed is a formatted USD string, while holding-level usd_value values are numbers. tokens_without_price counts holdings without an available valuation.
composition_analysis covers only the returned holdings. The full response also includes a token table, summary, and metadata. Missing data and the limit parameter can leave holdings out of the result.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional. Your id for this logical request, 1 to 64 characters. A request is charged at most once per key; reusing a key whose request completed or is running returns 409 DUPLICATE_REQUEST without running the tool.
1 - 64Optional. The price version you expect to be charged at. If prices have changed, the call returns 409 PRICE_CHANGED and is not charged. Omit it to be charged at the current price.
1 - 32Body
Wallet address to analyze. Use the address format for the selected network.
Network to query, for example ethereum. See Supported Networks for coverage. Use all to query supported networks together.
Maximum number of holdings to include in the result.
Response
Portfolio breakdown: major/top holdings, total value, and composition analysis. Fields vary by network and available data. Check for status: no_data, status: error, or an error field even when HTTP status is 200. See Errors & status.
The response is of type object.
Was this page helpful?