eth_getBalance
Polygon / https://triport.io/polygon
Minimum tier: Free
Last updated:
eth_getBalance returns the amount of wei held by a Polygon address at a
specific point in the chain's history. On Polygon this is the native MATIC
balance — it does not include ERC-20 token balances (including wrapped MATIC,
WMATIC), which live in their respective token contracts.
Use this method to display an account's spendable MATIC, to check a contract's treasury, or to confirm a deposit has landed. By varying the second parameter (the block tag) you can read the balance as of the latest block, a pending block, the genesis block, or any historical block height.
The result is a hex-encoded u256 string measured in wei (1 MATIC = 10¹⁸ wei).
For example, 0x21e19e0c9bab2400000 is 10000000000000000000000 wei =
10,000 MATIC. You are responsible for converting the hex value to a decimal
and dividing by 10¹⁸ when presenting it to users.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://triport.io/polygon \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":[]}'const res = await fetch("https://triport.io/polygon", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBalance",
"params": []
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/polygon",
headers={"Authorization": "Bearer <api-key>"},
json={"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":[]},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Chain: Polygon.
- Clusters: mainnet.
- Credit cost: 1 per call.
FAQ
- What does eth_getBalance do?
- Returns the native MATIC balance of an address, in wei, at a given block.
- How many credits does eth_getBalance cost?
- eth_getBalance costs 1 credit(s) per call on Triport by default.
- Is eth_getBalance available over WebSocket?
- eth_getBalance is an HTTP JSON-RPC method.