Onchain
Token balance
Farcaster API V2
- User
- Signer
- Cast
- Feed
- Reaction
- Notifications
- Channel
- Follows
- Storage
- Frame
- Agents
- Fname
- Webhook
- Action
- Mute
- Block
- Ban
- Onchain
- GETToken balance
- GETRelevant owners
- Subscribers
- GET
- Login
- Metrics
Onchain
Farcaster Hub API
- Info
- Casts
- Reactions
- Links
- UserData
- Fids
- Storage
- Usernames
- Verifications
- OnChainEvents
- Message
- HubEvents
Neynar SDK
- Getting Started with Neynar NodeJS SDK
- SDK v1 to v2 migration guide
Onchain
Token balance
Fetches the token balances of a user given their FID
GET
/
farcaster
/
user
/
balance
curl --request GET \
--url https://api.neynar.com/v2/farcaster/user/balance \
--header 'x-api-key: <api-key>'
{
"user_balance": {
"object": "user_balance",
"user": {
"object": "user_dehydrated",
"fid": 3,
"username": "<string>",
"display_name": "<string>",
"pfp_url": "<string>",
"custody_address": "0x5a927ac639636e534b678e81768ca19e2c6280b7"
},
"address_balances": [
{
"object": "address_balance",
"verified_address": {
"address": "<string>",
"network": "base"
},
"token_balances": [
{
"object": "token_balance",
"token": {
"object": "token",
"name": "<string>",
"symbol": "<string>",
"address": "<string>",
"decimals": 123
},
"balance": {
"in_token": "<string>",
"in_usdc": "<string>"
}
}
]
}
]
}
}
Related tutorial: User balances directly w/ FID
Authorizations
API key to authorize requests
Query Parameters
FID of the user to fetch
Example:
3
Comma separated list of networks to fetch balances for. Currently, only "base" is supported.
A blockchain network e.g. "base"
Available options:
base
Response
200
application/json
Successful operation.
Available options:
user_balance
Available options:
user_dehydrated
The unique identifier of a farcaster user (unsigned integer)
Example:
3
Ethereum address
Example:
"0x5a927ac639636e534b678e81768ca19e2c6280b7"
The token balances associated with a wallet address
Available options:
address_balance
The token balance associated with a wallet address and a network
Available options:
token_balance
Available options:
token
The token name e.g. "Ethereum"
The token symbol e.g. "ETH"
The contract address of the token (omitted for native token)
The number of decimals the token uses
Was this page helpful?
curl --request GET \
--url https://api.neynar.com/v2/farcaster/user/balance \
--header 'x-api-key: <api-key>'
{
"user_balance": {
"object": "user_balance",
"user": {
"object": "user_dehydrated",
"fid": 3,
"username": "<string>",
"display_name": "<string>",
"pfp_url": "<string>",
"custody_address": "0x5a927ac639636e534b678e81768ca19e2c6280b7"
},
"address_balances": [
{
"object": "address_balance",
"verified_address": {
"address": "<string>",
"network": "base"
},
"token_balances": [
{
"object": "token_balance",
"token": {
"object": "token",
"name": "<string>",
"symbol": "<string>",
"address": "<string>",
"decimals": 123
},
"balance": {
"in_token": "<string>",
"in_usdc": "<string>"
}
}
]
}
]
}
}