Query

Query Token, NFT & SFT Metadata

Retrieve token (ERC20), NFT (ERC721) or SFT (ERC1155) metadata for a specific token ID in a contract.


Depending on wether your contract is a token (ERC20), NFT (ERC721) or SFT (ERC1155) your query will change slightly.

Retrieve token metadata (ERC20)

Make a GET request to /tokens/{tokens_id} where {tokens_id} is replaced with the tokens id to return the token's metadata.


const url = 'https://api.utiliti.ai/tokens/' const address = '0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4' // contract address const tokens_id = '1' // token id const network_id = '1' // ethereum const query = `?contract_address=${address}&network_id=${network_id}` const response = await fetch(url + tokens_id + query, { method: 'GET', headers: { 'Content-Type': 'application/json', 'X-API-key': '<YOUR_API_KEY_HERE>', }, })

Retrieve NFT metadata (ERC720)

Make a GET request to /nfts/{tokens_id} where {tokens_id} is replaced with the tokens id to return the token's metadata.


const url = 'https://api.utiliti.ai/nfts/' const address = '0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4' // contract address const tokens_id = '1' // token id const network_id = '1' // ethereum const query = `?contract_address=${address}&network_id=${network_id}` const response = await fetch(url + tokens_id + query, { method: 'GET', headers: { 'Content-Type': 'application/json', 'X-API-key': '<YOUR_API_KEY_HERE>', }, })

Retrieve SFT metadata (ERC1155)

Make a GET request to /sfts/{tokens_id} where {tokens_id} is replaced with the tokens id to return the token's metadata.


const url = 'https://api.utiliti.ai/sfts/' const address = '0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4' // contract address const tokens_id = '1' // token id const network_id = '1' // ethereum const query = `?contract_address=${address}&network_id=${network_id}` const response = await fetch(url + tokens_id + query, { method: 'GET', headers: { 'Content-Type': 'application/json', 'X-API-key': '<YOUR_API_KEY_HERE>', }, })