Get ETH wallet balance
https://api.triport.io/v1/eth/wallet/balance/0x742d35Cc6634C0532925a3b844Bc9e7595f06b8bReturns the native ETH balance of an Ethereum address, as both raw wei and a decimal ETH amount, at a given block.
GET /v1/eth/wallet/balance/{address} returns the native ETH balance held by an
Ethereum address. The balance is returned twice: as wei — the exact u256
amount encoded as a decimal string so it never loses precision — and as eth, a
convenience floating-point value already divided by 10¹⁸. The response also
echoes the resolved block height the balance was read at.
This is the simplest way to display an account's spendable ETH, check a contract's treasury, or confirm a deposit. It is available on the free tier, so it is a good first call when integrating. The native balance does not include ERC-20 token balances — those live in their token contracts; use Get ERC-20 token balances for those.
By default the balance is read at the latest block. Pass the optional block
query parameter to read a historical or pending balance — it accepts a tag
(latest, pending, safe, finalized) or a block number in hex or decimal.
Parameters
Path parameters
addressstring (0x-prefixed, 40 hex chars)required^0x[0-9a-fA-F]{40}$.Query parametersobjectblockstringoptionallatest, pending, safe, finalized, or a block number in hex (0x...) or decimal. Defaults to latest.Response
Response fields
| Field | Type | Description |
|---|---|---|
address | string | The queried address, echoed back. Always present. |
wei | string | Exact balance in wei (u256) as a decimal string. Always present. Parse with a big-integer type to avoid precision loss. |
eth | number (double) | Convenience balance in ETH (wei ÷ 10¹⁸), ≥ 0. Always present. May lose precision for very large balances — prefer wei for accounting. |
block | integer (int64) | The resolved block height the balance was read at, ≥ 0. |
Errors
Errors use the shared Triport REST envelope (error, message, request_id).
See Errors for the full envelope and every code.
| Code | HTTP | Meaning | When it happens |
|---|---|---|---|
unauthorized | 401 | No or invalid credentials | The Authorization header is missing, malformed, or the key is revoked. |
trial_expired | 401 | Free trial ended | The free 7-day trial period has lapsed; upgrade to continue. |
subscription_expired | 401 | Subscription lapsed | A previously active paid subscription has expired. |
tier_insufficient | 403 | Tier too low | The API key's tier is below what the eth_read_rpc category requires (not expected on free tier for this endpoint). |
rate_limited | 429 | RPS exceeded | Sustained + burst RPS exceeded for your tier. Honor Retry-After (always 1) and retry. |
Examples
JavaScript (fetch)
const address = "0x742d35Cc6634C0532925a3b844Bc9e7595f06b8b";
const res = await fetch(
`https://api.triport.io/v1/eth/wallet/balance/${address}`,
{ headers: { Authorization: `Bearer ${process.env.TRIPORT_API_KEY}` } },
);
const { wei, eth, block } = await res.json();
console.log(`${eth} ETH (${BigInt(wei)} wei) at block ${block}`);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const balance = await client.eth.wallet.balance(
"0x742d35Cc6634C0532925a3b844Bc9e7595f06b8b",
{ block: "latest" },
);
console.log(BigInt(balance.wei)); // 2000000000000000000n
console.log(balance.eth); // 2.0Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
balance = client.eth.wallet.balance(
"0x742d35Cc6634C0532925a3b844Bc9e7595f06b8b",
block="latest",
)
print(int(balance["wei"])) # 2000000000000000000
print(balance["eth"]) # 2.0
print(balance["block"]) # 18000000Notes
- Prefer
weifor accounting.weiis an exact decimal string; theethdouble is a convenience that can lose precision on large balances. ParseweiwithBigInt/ Pythonint. - Native balance only. ERC-20 holdings are not included — see Get ERC-20 token balances. For NFTs see Get NFT holdings, and for transaction history see Get wallet history.
- Block selection.
pendingreflects not-yet-mined state and may change;latestis the safe default for confirmed balances. The returnedblockfield tells you exactly which height was resolved. - Rate limits are enforced per second per tier — there is no daily cap.
On
429, back offRetry-Afterseconds (always1) and retry; it is normal backpressure. See Rate Limits and Tiers. - Authentication can also be supplied via the
X-API-Keyheader or a legacy?api-key=query parameter — see Authentication.