Execute a Tool
curl --request POST \
--url https://pro-api.nikiwa.com/api/tools/{tool_name} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"tool inputs": {}
}
'import requests
url = "https://pro-api.nikiwa.com/api/tools/{tool_name}"
payload = { "tool inputs": {} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({'tool inputs': {}})
};
fetch('https://pro-api.nikiwa.com/api/tools/{tool_name}', 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/{tool_name}",
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([
'tool inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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/{tool_name}"
payload := strings.NewReader("{\n \"tool inputs\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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/{tool_name}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"tool inputs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pro-api.nikiwa.com/api/tools/{tool_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tool inputs\": {}\n}"
response = http.request(request)
puts response.read_bodyPublic Tools API
Execute a Tool
Call a Nikiwa tool and get its structured result.
POST
/
api
/
tools
/
{tool_name}
Execute a Tool
curl --request POST \
--url https://pro-api.nikiwa.com/api/tools/{tool_name} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"tool inputs": {}
}
'import requests
url = "https://pro-api.nikiwa.com/api/tools/{tool_name}"
payload = { "tool inputs": {} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({'tool inputs': {}})
};
fetch('https://pro-api.nikiwa.com/api/tools/{tool_name}', 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/{tool_name}",
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([
'tool inputs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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/{tool_name}"
payload := strings.NewReader("{\n \"tool inputs\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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/{tool_name}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"tool inputs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pro-api.nikiwa.com/api/tools/{tool_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tool inputs\": {}\n}"
response = http.request(request)
puts response.read_bodyExecution runs a single tool and returns its structured data. Pass the tool’s inputs as a JSON body.
string
required
Your developer key as a Bearer token.
string
required
The tool to run, for example
get_wallet_portfolio_breakdown. It must be a public tool (see the catalog). Unknown or non-public names return 404.object
The tool’s inputs. Most tools take an entity (a wallet as
wallet_address or address, a token as token_address, a contract as contract_address, a tx_hash, or an ens_name) and often a network. The exact parameter names vary per tool; read each tool’s schema from discovery or its page under Endpoints.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_ens to turn an ENS name into an address.
Result
On success you receive the tool’s data object. Invalid arguments return422 Unprocessable Entity, 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.Was this page helpful?