[ API reference ]
Trader balances
Returns token balances, market information, cost basis, active trades, native balances, realized PnL and current equity for a trader.
GET
/api/users/{userId}/balancesThis endpoint requires an API key using X-API-Key or Bearer authorization.
01
Request
curl
curl "https://getfomoapi.fun/api/users/{userId}/balances" \
-H "X-API-Key: YOUR_API_KEY"02
Parameters
NameLocationTypeDescription
userIdpathUUIDUnique trader ID returned by the resolve trader endpoint.03
Response fields
FieldTypeDescription
successbooleanIndicates whether the request succeeded.responseObject.balancesarrayIndexed fungible token balances.responseObject.balances[].balanceobjectRaw and human-readable token balance.responseObject.balances[].tokenFilterResultobjectToken metadata and current market information.responseObject.balances[].userTokenobject | nullCost basis and realized PnL accounting.responseObject.balances[].activeTradeobject | nullCurrent active trade associated with the holding.responseObject.otherPnlnumberPnL not represented by indexed holdings.responseObject.nativeEvmBalancesarrayNative EVM balances grouped by network.responseObject.livePerpPnlnumberCurrent perpetual position PnL.responseObject.otherEquitynumberAdditional calculated account equity.statusCodeintegerHTTP status represented in the response.04
JSON response
A successful request returns the following response structure.
response.json
{
"success": true,
"message": "User balances found",
"responseObject": {
"balances": [
{
"balance": {
"tokenAddress": "6GmAFSYs4gk3FDao5FzzySQpPZaWsa4rUJHacpMpUNgx",
"balance": "35757500000000000",
"tokenId": "6GmAFSYs4gk3FDao5FzzySQpPZaWsa4rUJHacpMpUNgx:1399811149",
"shiftedBalance": 35757544.93
},
"tokenFilterResult": {
"change24": "0.6611539803633674",
"marketCap": "251398711",
"priceUSD": "0.294013730667",
"volume24": "75590486"
}
}
],
"otherPnl": -1544962.78,
"nativeEvmBalances": [],
"livePerpPnl": 0,
"otherEquity": 6978.73
},
"statusCode": 200
}Rate limits and retry
Pro keys allow 5 requests per second. On a 429 response, wait for the Retry-After value before retrying.