Skip to content

Token URI Resolver

The token URI endpoint returns ERC-721-compatible JSON metadata built from onchain ERC-8048 entries. It is public — no authentication required.

Endpoint

GET /tokenURI/:address/:tokenId?
ParameterRequiredDescription
addressYesToken contract address
tokenIdERC-721 onlyNFT token ID. Omit for ERC-20 (uses onchain token ID).

ERC-721 example

bash
curl https://api-rho-gold-msx2gnbkee.vercel.app/tokenURI/0xADDRESS/1

Success response (200):

json
{
  "name": "Moon Drop #1",
  "description": "First edition",
  "image": "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi",
  "attributes": {
    "rarity": "legendary",
    "edition": 1
  }
}

ERC-20 example

For fungible tokens, omit tokenId — the API reads the onchain token ID automatically:

bash
curl https://api-rho-gold-msx2gnbkee.vercel.app/tokenURI/0xADDRESS

How it works

  1. Looks up the token in the database by address
  2. Reads all metadata key/value pairs from the contract
  3. Maps known keys (name, description, image) to top-level fields
  4. Remaining keys become attributes

Set metadata via the manage token guide before expecting a response. The image field echoes whatever URI was written on-chain (typically IPFS or an HTTP URL you hosted).

Common errors

StatusCodeCause
404NOT_FOUNDUnknown address, missing tokenId for ERC-721, or no metadata set
502CHAIN_ERRORRPC failure reading onchain data

Integration with wallets

Point your contract's tokenURI or metadata values at this endpoint:

https://api-rho-gold-msx2gnbkee.vercel.app/tokenURI/0xADDRESS/1