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>', }, })
SDK coming soon...
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.utiliti.ai/tokens/1?contract_address=0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4&network_id=1"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "accept: application/json"); headers = curl_slist_append(headers, "X-API-key: <YOUR_API_KEY_HERE>"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
curl --request GET \ --url 'https://api.utiliti.ai/tokens/1?contract_address=0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4&network_id=1' \ --header 'X-API-key: <YOUR_API_KEY_HERE>' \ --header 'accept: application/json'
$python -m pip install requests --- import requests url = "https://api.utiliti.ai/tokens/1?contract_address=0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4&network_id=1" headers = { "accept": "application/json", "X-API-key": "<YOUR_API_KEY_HERE>" } response = requests.get(url, headers=headers) print(response.text)
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>', }, })
SDK coming soon...
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.utiliti.ai/nfts/1?contract_address=0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4&network_id=1"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "accept: application/json"); headers = curl_slist_append(headers, "X-API-key: <YOUR_API_KEY_HERE>"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
curl --request GET \ --url 'https://api.utiliti.ai/nfts/1?contract_address=0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4&network_id=1' \ --header 'X-API-key: <YOUR_API_KEY_HERE>' \ --header 'accept: application/json'
$python -m pip install requests --- import requests url = "https://api.utiliti.ai/nfts/1?contract_address=0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4&network_id=1" headers = { "accept": "application/json", "X-API-key": "<YOUR_API_KEY_HERE>" } response = requests.get(url, headers=headers) print(response.text)
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>', }, })
SDK coming soon...
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.utiliti.ai/sfts/1?contract_address=0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4&network_id=1"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "accept: application/json"); headers = curl_slist_append(headers, "X-API-key: <YOUR_API_KEY_HERE>"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
curl --request GET \ --url 'https://api.utiliti.ai/sfts/1?contract_address=0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4&network_id=1' \ --header 'X-API-key: <YOUR_API_KEY_HERE>' \ --header 'accept: application/json'
$python -m pip install requests --- import requests url = "https://api.utiliti.ai/sfts/1?contract_address=0xD77e17Ecc3942B6E83F67c56999C5230c70A85a4&network_id=1" headers = { "accept": "application/json", "X-API-key": "<YOUR_API_KEY_HERE>" } response = requests.get(url, headers=headers) print(response.text)