Skip to main content
POST
/
v1
/
wallets
/
{walletId}
/
addresses
/
{addressId}
/
contracts
/
read
Child Address Read
curl --request POST \
  --url https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/contracts/read \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "calls": [
    {
      "abi": [
        {
          "constant": true,
          "inputs": [
            {
              "name": "account",
              "type": "address"
            }
          ],
          "name": "balanceOf",
          "outputs": [
            {
              "name": "",
              "type": "uint256"
            }
          ],
          "stateMutability": "view",
          "type": "function"
        }
      ],
      "address": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
      "method": "balanceOf",
      "parameters": [
        "0x947514e4B803e312C312da0F1B41fEDdbe15ae7a"
      ]
    },
    {
      "abi": [
        {
          "constant": true,
          "inputs": [
            {
              "name": "owner",
              "type": "address"
            },
            {
              "name": "spender",
              "type": "address"
            }
          ],
          "name": "allowance",
          "outputs": [
            {
              "name": "",
              "type": "uint256"
            }
          ],
          "stateMutability": "view",
          "type": "function"
        }
      ],
      "address": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
      "method": "allowance",
      "parameters": [
        "0x947514e4B803e312C312da0F1B41fEDdbe15ae7a",
        "0xSpenderAddress"
      ]
    }
  ]
}
'
import requests

url = "https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/contracts/read"

payload = { "calls": [
{
"abi": [
{
"constant": True,
"inputs": [
{
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"address": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
"method": "balanceOf",
"parameters": ["0x947514e4B803e312C312da0F1B41fEDdbe15ae7a"]
},
{
"abi": [
{
"constant": True,
"inputs": [
{
"name": "owner",
"type": "address"
},
{
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"address": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
"method": "allowance",
"parameters": ["0x947514e4B803e312C312da0F1B41fEDdbe15ae7a", "0xSpenderAddress"]
}
] }
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({
calls: [
{
abi: [
{
constant: true,
inputs: [{name: 'account', type: 'address'}],
name: 'balanceOf',
outputs: [{name: '', type: 'uint256'}],
stateMutability: 'view',
type: 'function'
}
],
address: '0x337610d27c682E347C9cD60BD4b3b107C9d34dDd',
method: 'balanceOf',
parameters: ['0x947514e4B803e312C312da0F1B41fEDdbe15ae7a']
},
{
abi: [
{
constant: true,
inputs: [{name: 'owner', type: 'address'}, {name: 'spender', type: 'address'}],
name: 'allowance',
outputs: [{name: '', type: 'uint256'}],
stateMutability: 'view',
type: 'function'
}
],
address: '0x337610d27c682E347C9cD60BD4b3b107C9d34dDd',
method: 'allowance',
parameters: ['0x947514e4B803e312C312da0F1B41fEDdbe15ae7a', '0xSpenderAddress']
}
]
})
};

fetch('https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/contracts/read', 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.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/contracts/read",
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([
'calls' => [
[
'abi' => [
[
'constant' => true,
'inputs' => [
[
'name' => 'account',
'type' => 'address'
]
],
'name' => 'balanceOf',
'outputs' => [
[
'name' => '',
'type' => 'uint256'
]
],
'stateMutability' => 'view',
'type' => 'function'
]
],
'address' => '0x337610d27c682E347C9cD60BD4b3b107C9d34dDd',
'method' => 'balanceOf',
'parameters' => [
'0x947514e4B803e312C312da0F1B41fEDdbe15ae7a'
]
],
[
'abi' => [
[
'constant' => true,
'inputs' => [
[
'name' => 'owner',
'type' => 'address'
],
[
'name' => 'spender',
'type' => 'address'
]
],
'name' => 'allowance',
'outputs' => [
[
'name' => '',
'type' => 'uint256'
]
],
'stateMutability' => 'view',
'type' => 'function'
]
],
'address' => '0x337610d27c682E347C9cD60BD4b3b107C9d34dDd',
'method' => 'allowance',
'parameters' => [
'0x947514e4B803e312C312da0F1B41fEDdbe15ae7a',
'0xSpenderAddress'
]
]
]
]),
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.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/contracts/read"

payload := strings.NewReader("{\n \"calls\": [\n {\n \"abi\": [\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"account\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"balanceOf\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n }\n ],\n \"address\": \"0x337610d27c682E347C9cD60BD4b3b107C9d34dDd\",\n \"method\": \"balanceOf\",\n \"parameters\": [\n \"0x947514e4B803e312C312da0F1B41fEDdbe15ae7a\"\n ]\n },\n {\n \"abi\": [\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"name\": \"spender\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"allowance\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n }\n ],\n \"address\": \"0x337610d27c682E347C9cD60BD4b3b107C9d34dDd\",\n \"method\": \"allowance\",\n \"parameters\": [\n \"0x947514e4B803e312C312da0F1B41fEDdbe15ae7a\",\n \"0xSpenderAddress\"\n ]\n }\n ]\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.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/contracts/read")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"calls\": [\n {\n \"abi\": [\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"account\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"balanceOf\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n }\n ],\n \"address\": \"0x337610d27c682E347C9cD60BD4b3b107C9d34dDd\",\n \"method\": \"balanceOf\",\n \"parameters\": [\n \"0x947514e4B803e312C312da0F1B41fEDdbe15ae7a\"\n ]\n },\n {\n \"abi\": [\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"name\": \"spender\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"allowance\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n }\n ],\n \"address\": \"0x337610d27c682E347C9cD60BD4b3b107C9d34dDd\",\n \"method\": \"allowance\",\n \"parameters\": [\n \"0x947514e4B803e312C312da0F1B41fEDdbe15ae7a\",\n \"0xSpenderAddress\"\n ]\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/contracts/read")

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 \"calls\": [\n {\n \"abi\": [\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"account\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"balanceOf\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n }\n ],\n \"address\": \"0x337610d27c682E347C9cD60BD4b3b107C9d34dDd\",\n \"method\": \"balanceOf\",\n \"parameters\": [\n \"0x947514e4B803e312C312da0F1B41fEDdbe15ae7a\"\n ]\n },\n {\n \"abi\": [\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"name\": \"spender\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"allowance\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n }\n ],\n \"address\": \"0x337610d27c682E347C9cD60BD4b3b107C9d34dDd\",\n \"method\": \"allowance\",\n \"parameters\": [\n \"0x947514e4B803e312C312da0F1B41fEDdbe15ae7a\",\n \"0xSpenderAddress\"\n ]\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "data": "10052335235393043",
  "message": "Contract read successfully",
  "statusCode": 200
}

Batch Operations

This endpoint supports batch operations, allowing you to read multiple contract methods in a single API call from a specific child address.

Batch Request Format

To execute multiple reads, use the calls array:
{
  "calls": [
    {
      "address": "0x1234...",
      "method": "balanceOf",
      "parameters": ["0xabcd..."],
      "abi": [...]
    },
    {
      "address": "0x5678...",
      "method": "totalSupply",
      "parameters": [],
      "abi": [...]
    }
  ]
}

Batch Response Format

Batch responses include success and errors arrays:
{
  "message": "Batch contract read completed (2/2 successful)",
  "statusCode": 200,
  "data": {
    "success": [
      { "index": 0, "method": "balanceOf", "data": "1000000" },
      { "index": 1, "method": "totalSupply", "data": "50000000" }
    ],
    "errors": []
  }
}

Validation Rules

RuleValue
Max batch size20 operations
Min batch size1 operation

Use Cases

  • Bulk reads: Read multiple contract states efficiently
  • Multi-asset balances: Query balances across multiple assets in one call
  • Protocol state: Read multiple protocol parameters simultaneously

Authorizations

x-api-key
string
header
required

Path Parameters

walletId
string
required
Example:

"YOUR_WALLET_ID"

addressId
string
required
Example:

"ADDRESS_ID"

Body

application/json
calls
object[]
Example:
[
{
"abi": [
{
"constant": true,
"inputs": [{ "name": "account", "type": "address" }],
"name": "balanceOf",
"outputs": [{ "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
}
],
"address": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
"method": "balanceOf",
"parameters": [
"0x947514e4B803e312C312da0F1B41fEDdbe15ae7a"
]
},
{
"abi": [
{
"constant": true,
"inputs": [
{ "name": "owner", "type": "address" },
{ "name": "spender", "type": "address" }
],
"name": "allowance",
"outputs": [{ "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
}
],
"address": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
"method": "allowance",
"parameters": [
"0x947514e4B803e312C312da0F1B41fEDdbe15ae7a",
"0xSpenderAddress"
]
}
]

Response

200 - application/json

Ethereum / Tron / Ethereum (Batch) / Tron (Batch)

data
Example:

"10052335235393043"

message
string
Example:

"Contract read successfully"

statusCode
number
Example:

200