curl --request GET \
--url https://api.zerion.io/v1/{ecosystem}/wallets/{address}/positions/ \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.zerion.io/v1/{ecosystem}/wallets/{address}/positions/"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.zerion.io/v1/{ecosystem}/wallets/{address}/positions/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zerion.io/v1/{ecosystem}/wallets/{address}/positions/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"links": {
"self": "https://api.zerion.io/v1/wallets/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/positions/"
},
"data": [
{
"type": "positions",
"id": "0x111c47865ade3b172a928df8f990bc7f2a3b9aaa-polygon-asset-none-",
"attributes": {
"name": "Asset",
"quantity": {
"int": "12345678",
"decimals": 5,
"float": 123.45678,
"numeric": "123.45678"
},
"encrypted_quantity": {
"handle": "<string>"
},
"parent": "0x111c47865ade3b172a928df8f990bc7f2a3b9aaa-polygon-asset-none-",
"protocol": "<string>",
"protocol_module": "lending",
"pool_address": "0x109830a1aaad605bbf02a9dfa7b0b92ec2fb7daa",
"group_id": "0a771a0064dad468045899032c7fb01a971f973f7dff0a5cdc3ce199f45e94d7",
"market_id": "0xb323495f7e4148be5643a4ea4a8221eef163e4bccfdedc2a6f4696baacbc86cc",
"position_type": "deposit",
"value": 5.384656557642683,
"health_factor": 1.85,
"price": 0.043615722,
"changes": {
"absolute_1d": 0.272309794,
"percent_1d": 5.326512552079021
},
"fungible_info": {
"name": "Bankless BED Index",
"symbol": "BED",
"icon": {
"url": "https://token-icons.s3.amazonaws.com/0x0391d2021f89dc339f60fff84546ea23e337750f.png"
},
"flags": {
"verified": true,
"is_trash": false
},
"implementations": [
{
"chain_id": "ethereum",
"decimals": 18,
"address": "0x2af1df3ab0ab157e1e2ad8f88a7d04fbea0c7dc6"
}
],
"id": "0230395c-2b01-46d8-b2d6-ce8121d51f9e",
"asset_class": "commodity",
"issuer": {
"name": "xStocks"
},
"description": "The BED index is meant to track crypto’s top 3 investab.",
"market_data": {
"price": 106.87952669793131,
"total_supply": 29905.762448515918,
"circulating_supply": 29905.762448515918,
"fully_diluted_valuation": 3196313.736038149,
"market_cap": 3196313.736038149,
"changes": {
"percent_1d": -0.7379066649086338,
"percent_30d": -2.499465618806962,
"percent_90d": 11.316340269371775,
"percent_365d": null
},
"trading_volumes": {
"volume_1d": 40096375.69294812
}
}
},
"flags": {
"displayable": true,
"is_trash": true
},
"updated_at": "2023-11-10T23:00:00Z",
"updated_at_block": 123,
"application_metadata": {
"name": "AAVE",
"icon": {
"url": "https://token-icons.s3.amazonaws.com/0x0391d2021f89dc339f60fff84546ea23e337750f.png"
},
"url": "https://app.aave.com/"
},
"receipt": {
"fungible_info": {
"name": "Bankless BED Index",
"symbol": "BED",
"icon": {
"url": "https://token-icons.s3.amazonaws.com/0x0391d2021f89dc339f60fff84546ea23e337750f.png"
},
"flags": {
"verified": true,
"is_trash": false
},
"implementations": [
{
"chain_id": "ethereum",
"decimals": 18,
"address": "0x2af1df3ab0ab157e1e2ad8f88a7d04fbea0c7dc6"
}
],
"id": "0230395c-2b01-46d8-b2d6-ce8121d51f9e",
"asset_class": "commodity",
"issuer": {
"name": "xStocks"
},
"description": "The BED index is meant to track crypto’s top 3 investab.",
"market_data": {
"price": 106.87952669793131,
"total_supply": 29905.762448515918,
"circulating_supply": 29905.762448515918,
"fully_diluted_valuation": 3196313.736038149,
"market_cap": 3196313.736038149,
"changes": {
"percent_1d": -0.7379066649086338,
"percent_30d": -2.499465618806962,
"percent_90d": 11.316340269371775,
"percent_365d": null
},
"trading_volumes": {
"volume_1d": 40096375.69294812
}
}
},
"nft_info": {
"chain_id": "ethereum",
"contract_address": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
"token_id": "1303743"
},
"quantity": {
"int": "12345678",
"decimals": 5,
"float": 123.45678,
"numeric": "123.45678"
}
},
"proxy": {
"address": "0x1111111111111111111111111111111111111111"
}
},
"relationships": {
"chain": {
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
},
"fungible": {
"links": {
"related": "https://api.zerion.io/v1/fungibles/0x111c47865ade3b172a928df8f990bc7f2a3b9aaa"
},
"data": {
"type": "fungibles",
"id": "0x111c47865ade3b172a928df8f990bc7f2a3b9aaa"
}
},
"dapp": {
"data": {
"type": "dapps",
"id": "aave-v3"
}
}
}
}
]
}{
"errors": [
{
"title": "Parameter is malformed",
"detail": "Some validation errors will be described here"
}
]
}{
"errors": [
{
"title": "Unauthorized Error",
"detail": "The API key is invalid, please, make sure that you are using a valid key"
}
]
}{
"errors": [
{
"title": "Too many requests",
"detail": "Your request had been throttled"
}
]
}{
"errors": [
{
"title": "Service is temporarily unavailable",
"detail": "Please, retry later (check the Retry-After header)"
}
]
}Get wallet fungible positions by ecosystem
A wallet’s token balances and DeFi positions on the chains of one ecosystem.
curl --request GET \
--url https://api.zerion.io/v1/{ecosystem}/wallets/{address}/positions/ \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.zerion.io/v1/{ecosystem}/wallets/{address}/positions/"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.zerion.io/v1/{ecosystem}/wallets/{address}/positions/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zerion.io/v1/{ecosystem}/wallets/{address}/positions/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"links": {
"self": "https://api.zerion.io/v1/wallets/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/positions/"
},
"data": [
{
"type": "positions",
"id": "0x111c47865ade3b172a928df8f990bc7f2a3b9aaa-polygon-asset-none-",
"attributes": {
"name": "Asset",
"quantity": {
"int": "12345678",
"decimals": 5,
"float": 123.45678,
"numeric": "123.45678"
},
"encrypted_quantity": {
"handle": "<string>"
},
"parent": "0x111c47865ade3b172a928df8f990bc7f2a3b9aaa-polygon-asset-none-",
"protocol": "<string>",
"protocol_module": "lending",
"pool_address": "0x109830a1aaad605bbf02a9dfa7b0b92ec2fb7daa",
"group_id": "0a771a0064dad468045899032c7fb01a971f973f7dff0a5cdc3ce199f45e94d7",
"market_id": "0xb323495f7e4148be5643a4ea4a8221eef163e4bccfdedc2a6f4696baacbc86cc",
"position_type": "deposit",
"value": 5.384656557642683,
"health_factor": 1.85,
"price": 0.043615722,
"changes": {
"absolute_1d": 0.272309794,
"percent_1d": 5.326512552079021
},
"fungible_info": {
"name": "Bankless BED Index",
"symbol": "BED",
"icon": {
"url": "https://token-icons.s3.amazonaws.com/0x0391d2021f89dc339f60fff84546ea23e337750f.png"
},
"flags": {
"verified": true,
"is_trash": false
},
"implementations": [
{
"chain_id": "ethereum",
"decimals": 18,
"address": "0x2af1df3ab0ab157e1e2ad8f88a7d04fbea0c7dc6"
}
],
"id": "0230395c-2b01-46d8-b2d6-ce8121d51f9e",
"asset_class": "commodity",
"issuer": {
"name": "xStocks"
},
"description": "The BED index is meant to track crypto’s top 3 investab.",
"market_data": {
"price": 106.87952669793131,
"total_supply": 29905.762448515918,
"circulating_supply": 29905.762448515918,
"fully_diluted_valuation": 3196313.736038149,
"market_cap": 3196313.736038149,
"changes": {
"percent_1d": -0.7379066649086338,
"percent_30d": -2.499465618806962,
"percent_90d": 11.316340269371775,
"percent_365d": null
},
"trading_volumes": {
"volume_1d": 40096375.69294812
}
}
},
"flags": {
"displayable": true,
"is_trash": true
},
"updated_at": "2023-11-10T23:00:00Z",
"updated_at_block": 123,
"application_metadata": {
"name": "AAVE",
"icon": {
"url": "https://token-icons.s3.amazonaws.com/0x0391d2021f89dc339f60fff84546ea23e337750f.png"
},
"url": "https://app.aave.com/"
},
"receipt": {
"fungible_info": {
"name": "Bankless BED Index",
"symbol": "BED",
"icon": {
"url": "https://token-icons.s3.amazonaws.com/0x0391d2021f89dc339f60fff84546ea23e337750f.png"
},
"flags": {
"verified": true,
"is_trash": false
},
"implementations": [
{
"chain_id": "ethereum",
"decimals": 18,
"address": "0x2af1df3ab0ab157e1e2ad8f88a7d04fbea0c7dc6"
}
],
"id": "0230395c-2b01-46d8-b2d6-ce8121d51f9e",
"asset_class": "commodity",
"issuer": {
"name": "xStocks"
},
"description": "The BED index is meant to track crypto’s top 3 investab.",
"market_data": {
"price": 106.87952669793131,
"total_supply": 29905.762448515918,
"circulating_supply": 29905.762448515918,
"fully_diluted_valuation": 3196313.736038149,
"market_cap": 3196313.736038149,
"changes": {
"percent_1d": -0.7379066649086338,
"percent_30d": -2.499465618806962,
"percent_90d": 11.316340269371775,
"percent_365d": null
},
"trading_volumes": {
"volume_1d": 40096375.69294812
}
}
},
"nft_info": {
"chain_id": "ethereum",
"contract_address": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
"token_id": "1303743"
},
"quantity": {
"int": "12345678",
"decimals": 5,
"float": 123.45678,
"numeric": "123.45678"
}
},
"proxy": {
"address": "0x1111111111111111111111111111111111111111"
}
},
"relationships": {
"chain": {
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
},
"fungible": {
"links": {
"related": "https://api.zerion.io/v1/fungibles/0x111c47865ade3b172a928df8f990bc7f2a3b9aaa"
},
"data": {
"type": "fungibles",
"id": "0x111c47865ade3b172a928df8f990bc7f2a3b9aaa"
}
},
"dapp": {
"data": {
"type": "dapps",
"id": "aave-v3"
}
}
}
}
]
}{
"errors": [
{
"title": "Parameter is malformed",
"detail": "Some validation errors will be described here"
}
]
}{
"errors": [
{
"title": "Unauthorized Error",
"detail": "The API key is invalid, please, make sure that you are using a valid key"
}
]
}{
"errors": [
{
"title": "Too many requests",
"detail": "Your request had been throttled"
}
]
}{
"errors": [
{
"title": "Service is temporarily unavailable",
"detail": "Please, retry later (check the Retry-After header)"
}
]
}Authorizations
To test endpoints here, paste your API key from the Dashboard into the username field and leave the password empty.
Headers
Path Parameters
The wallet address, valid for the ecosystem in the path: a 0x EVM address for eip155 or evm, a Solana address for solana. The ecosystem is not inferred from the address, so an address of another ecosystem returns 400, for example wallet address must be a valid Solana address. Under eip155 and evm the zero address returns 400. The transactions, balance chart and PnL endpoints additionally require an address Zerion tracks, as they do on /v1/wallets/{address}/ paths. An EVM address that is not tracked, such as a token contract, router or exchange hot wallet, returns 400, with detail reading untrackable wallet address on transactions and balance charts. Solana addresses always count as tracked.
Ethereum-compatible address (EVM).
^0x[a-fA-F0-9]{40}$"0x42b9df65b219b3dd36ff330a4dd8f327a6ada990"
Query Parameters
Exclude these token IDs from positions and portfolio calculations (comma-separated list). Defaults to no exclusions. For example, eth,usd-coin excludes ETH and USDC contributions represented in the positions. An opaque receipt token does not identify its underlying assets.
Repeated parameters are combined. The maximum is 500 entries before removing empty entries and duplicates; both count toward the limit. An empty value has no effect. Unknown valid IDs have no effect. Nonempty IDs must contain 3 to 100 letters, digits, dots, underscores or hyphens. Invalid IDs, malformed URL encoding or more than 500 entries return 400.
On positions endpoints, filter[fungible_ids] can be combined with this filter: a token must be included and not excluded to remain. Chart endpoints retain their separate 25-ID limit and reject combining inclusion and exclusion.
500100^([A-Za-z0-9._-]{3,100})?$["eth", "usd-coin"]
Which positions to return. Defaults to only_simple.
only_simple- tokens and native coins held directly in the wallet. DeFi protocol positions are left out.only_complex- DeFi protocol positions only, such as staked assets and liquidity pools (for example Uniswap or Aave).no_filter- both simple and protocol positions. A share token that a returned protocol position carries asreceiptcan be left out as its ownwalletrow. Sono_filtercan return fewer rows thanonly_simpleandonly_complexcombined, and some share tokens still appear twice. See Deduplicating share tokens.
Note:
only_complexandno_filtercount as advanced requests. Advanced requests have their own, smaller quota within your plan, and once it's used up these requests return429even if your overall quota has room. Check your plan's advanced quota in the Dashboard, or contactapi@zerion.iofor a different plan.
only_simple, only_complex, no_filter Keep only positions with these types (comma-separated list).
Possible values:
deposit- Assets deposited into a DeFi protocol (e.g., supplied to lending pools, deposited in vaults, or provided as liquidity)loan- Borrowed assets representing a debt position that needs to be repaidlocked- Assets locked for a specific period or purpose (e.g., vote-escrowed tokens, time-locked tokens)staked- Assets staked in a protocol to earn rewards, participate in consensus, or for governance purposesreward- Earned rewards that are claimable or have been distributed but not yet withdrawnwallet- Regular assets held directly in the wallet, not actively deposited in any protocolinvestment- Investment positions such as tokenized funds, indices, or structured products
8Position's type indicating how the assets are being used or their current state.
deposit, loan, locked, staked, reward, wallet, investment Keep only positions from these chains (comma-separated list). A listed chain is used only when it reports supports_positions in the flags of GET /v1/chains/ and belongs to the network family of the wallet address; on /v1/{ecosystem}/wallets/ paths that family is the path's ecosystem. A listed chain that fails either rule is ignored when the list also names a chain that passes both. When no listed chain passes, the request returns 400 rather than an empty result, and detail names the first chain in the list, as chain <id> does not support positions (for example chain bob does not support positions), or chain <id> does not support this wallet address type when that chain reports that flag but is of another network family. When the filter is omitted, chains that fail either rule are left out of data silently, with no error and no meta signal.
25["polygon"]
Was this page helpful?