π΅ Get a single TRC20 balance
Code samples
GET /api/v1/trx/account/balance/trc20/{address}/{contractAddress}
curl 'https://settla.net/api/v1/trx/account/balance/trc20/TMuA6YqfCeX8EhbfYEg5y7S4DqzSJireY9/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t' \
-H 'X-API-Key: $SETTLA_API_KEY' \
-H 'Accept: application/json'
Returns one address's balance of one TRC20 contract, with the token's metadata resolved. Unlike /account/{address}/balance, this endpoint is not limited to the curated whitelist: the balance is read straight off the contract, so any TRC20 address works. The metadata, however, still comes from the whitelist β for a contract outside it symbol, name and decimals all come back as null while balance is correct. In that case you have to know the token's precision yourself. balance is always the raw integer unit as a decimal string; divide by 10 ** decimals to display it. Both path segments are checksum-validated before the node is called, so a malformed address fails fast with 400.
π οΈ Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| address | path | string | true | Base58 address whose balance is being read. |
| contractAddress | path | string | true | Base58 address of the TRC20 contract. |
Example responses
200 Response β USDT β metadata resolved
{
"address": "TMuA6YqfCeX8EhbfYEg5y7S4DqzSJireY9",
"contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"balance": "3100000",
"symbol": "USDT",
"decimals": 6,
"name": "Tether USD"
}
200 Response β JST β balance only, metadata null
{
"address": "TMuA6YqfCeX8EhbfYEg5y7S4DqzSJireY9",
"contract_address": "TCFLL5dx5ZJdKnWuesXxi1VPwjLVmWZZy9",
"balance": "0",
"symbol": null,
"decimals": null,
"name": null
}
400 Response β badAddress
{
"error": "Invalid address."
}
400 Response β badContract
{
"error": "Invalid contract address."
}
500 Response β nodeUnreachable
{
"error": "Could not connect to TRX node."
}
500 Response β Node answered but the constant call produced no value
{
"error": "Failed to fetch TRC20 balance from node."
}
π Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Token balance | Inline |
| 400 | Bad Request | One of the path segments is not a valid Tron address | Inline |
| 500 | Internal Server Error | The node could not be reached, or returned no balance | Inline |
π Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Β» address | string | false | none | none |
| Β» contract_address | string | false | none | none |
| Β» balance | string | false | none | Raw balance as a decimal string, in the token's smallest unit. "3100000" with decimals: 6 is 3.1 USDT. |
| » symbol | string¦null | false | none | null for contracts outside the whitelist. |
| » decimals | integer¦null | false | none | null for contracts outside the whitelist. |
| » name | string¦null | false | none | null for contracts outside the whitelist. |
Status Code 400
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Β» error | string | false | none | none |
| Β» details | object | false | none | Present only on a few validation errors. |
Status Code 500
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Β» error | string | false | none | none |
| Β» details | object | false | none | Present only on a few validation errors. |