eth_getBalance
curl --request POST \
--url https://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x71F0cDb17454ad7EeB7e26242292fe0E0189645a",
"pending"
]
}
'import requests
url = "https://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e"
payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0x71F0cDb17454ad7EeB7e26242292fe0E0189645a", "pending"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
jsonrpc: '2.0',
method: 'eth_getBalance',
params: ['0x71F0cDb17454ad7EeB7e26242292fe0E0189645a', 'pending']
})
};
fetch('https://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e', 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://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e",
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([
'id' => 1,
'jsonrpc' => '2.0',
'method' => 'eth_getBalance',
'params' => [
'0x71F0cDb17454ad7EeB7e26242292fe0E0189645a',
'pending'
]
]),
CURLOPT_HTTPHEADER => [
"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://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e"
payload := strings.NewReader("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getBalance\",\n \"params\": [\n \"0x71F0cDb17454ad7EeB7e26242292fe0E0189645a\",\n \"pending\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getBalance\",\n \"params\": [\n \"0x71F0cDb17454ad7EeB7e26242292fe0E0189645a\",\n \"pending\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getBalance\",\n \"params\": [\n \"0x71F0cDb17454ad7EeB7e26242292fe0E0189645a\",\n \"pending\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}Cronos node API
eth_getBalance | Cronos
Cronos API method that returns the balance of a specific account in Wei, the smallest unit of ether. Use it on Cronos via Chainstack.
POST
/
mt_c524ad9781ae5dccd9ac6f5b0370e
eth_getBalance
curl --request POST \
--url https://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x71F0cDb17454ad7EeB7e26242292fe0E0189645a",
"pending"
]
}
'import requests
url = "https://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e"
payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0x71F0cDb17454ad7EeB7e26242292fe0E0189645a", "pending"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
jsonrpc: '2.0',
method: 'eth_getBalance',
params: ['0x71F0cDb17454ad7EeB7e26242292fe0E0189645a', 'pending']
})
};
fetch('https://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e', 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://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e",
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([
'id' => 1,
'jsonrpc' => '2.0',
'method' => 'eth_getBalance',
'params' => [
'0x71F0cDb17454ad7EeB7e26242292fe0E0189645a',
'pending'
]
]),
CURLOPT_HTTPHEADER => [
"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://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e"
payload := strings.NewReader("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getBalance\",\n \"params\": [\n \"0x71F0cDb17454ad7EeB7e26242292fe0E0189645a\",\n \"pending\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getBalance\",\n \"params\": [\n \"0x71F0cDb17454ad7EeB7e26242292fe0E0189645a\",\n \"pending\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cronos-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getBalance\",\n \"params\": [\n \"0x71F0cDb17454ad7EeB7e26242292fe0E0189645a\",\n \"pending\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}Cronos API method that returns the balance of a specific account in Wei, the smallest unit of ether. This method allows developers to retrieve the current balance of a Cronos account for various purposes, such as checking available funds or displaying balance information.
When called against a block older than the latest ~128 blocks, this method is treated as an archive request (2 RUs instead of 1 RU). See request units.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
-
address— the address to check the balance of. -
quantity or tag— the integer of a block encoded as hexadecimal or the string with:latest— the most recent block in the blockchain and the current state of the blockchain at the most recent block.safe— on Cronos, the same block aslatest. Cronos uses CometBFT consensus, which commits a block only after validators with more than two-thirds of the voting power sign it, so committed blocks aren’t reorganized.finalized— on Cronos, the same block aslatest, for the same reason.earliest— the earliest available or genesis blockpending— the pending state and transactions block. This is the current state of transactions that have been broadcast to the network but have not yet been included in a block.
See the default block parameter.
Response
quantity— the integer value of the current balance in Wei
eth_getBalance code examples
const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);
const getBalance = async (address, block) => {
const balance = await provider.send("eth_getBalance", [address, block]);
console.log(balance);
};
getBalance("0xeB32dab5d38FF953Cc323ACe8Efbdf4F897f1b1F", "latest")
from web3 import Web3
node_url = "CHAINSTACK_NODE_URL"
web3 = Web3(Web3.HTTPProvider(node_url))
address = web3.to_checksum_address("0xeB32dab5d38FF953Cc323ACe8Efbdf4F897f1b1F")
balance = web3.eth.get_balance(address, "latest")
print(balance)
Use case
One practical use case foreth_getBalance is to check the balance of an account for a program that scans the balance periodically and fills up the account when the balance drops below a certain value.Last modified on November 13, 2026
Was this page helpful?