Metadata API Reference & Usage
The Sequence Metadata API service offers a simple and fast API to query token & NFT metadata for Ethereum-compatible chains.
Quite simply, the Metadata API allows you to query the token metadata of any ERC20, ERC721 or ERC1155 contract on a number of supported Ethereum chains.
Please note, for your dev convenience, the Sequence Metadata service is automatically integrated in the Sequence Indexer. But as we demonstrate below, it's also useful to be able to query the token/contract metadata directly too :)
Let's say you'd like to query the metadata of a Skyweaver 1155 card on the Polygon network. Of course, the below example will work for any network / contract / token combination as well.
First, the Skyweaver 1155 assets contract is located at address
on the Polygon network. Second, let's build the metadata lookup endpoint to query Skyweaver's contract
for token ID
"name": "Unstoppable Chop",
"description": "Attach Silence to target unit. Do 4 damage to it.",
If you'd like to query a number of tokens at the same time, you can include more token ids comma-separated:
https://metadata.sequence.app/tokens/polygon/0x631998e91476DA5B870D741192fc5Cbc55F5a52E/20,21,22 -- click
to see the JSON response to query token ids
22 in a single batched request.
Feel free to try tweaking the metadata.sequence.app URL above for your own contract, or another popular project to see how the responses come back. You can change the network to one of our supported networks and specify any contract and/or token id.
In addition to easily querying token-level metadata like in the above example, you can also query contract-level metadata. Contract-level metadata provides you more information about a contract address such as a name, contract type, logo, and description. Simply change the metadata URL above to just query the contract address: https://metadata.sequence.app/tokens/polygon/0x631998e91476DA5B870D741192fc5Cbc55F5a52E
and see result:
"description": "Skyweaver is a Free-to-Play, trading card game powered by Polygon and Ethereum.",
The Metadata API service is accessible either with a simple REST interface, or a RPC client. For the RPC client, we offer Web browser, node and Go clients. We recommend the RPC client for most integrations, but make the REST interface available for convenience.
As mentioned in the example above. The general format of the REST endpoint is:
<network> must be one of the
Chain ID or
Chain Handle of the supported networks.
Fetch contract-level metadata:
Fetch token-level metadata:
The Metadata RPC interface offers the full capabilities of the Metadata service.
We provide SDKs for Web / node.js and Go. Or if you'd like to integrate the Metadata service with another language target, simply follow the API reference below to implement the HTTP requests. Additionally, read the Typescript client source code as reference implementation of the Metadata RPC client as well.
Metadata RPC Methods
Metadata API endpoint: https://metadata.sequence.app
Metadata RPC methods:
GetTokenMetadata- fetch token metadata of ERC721 or ERC1155 tokens from a single contract
GetTokenMetadataBatch- fetch token metadata of ERC721 or ERC1155 token from a batch of contracts
GetContractInfo- fetch contract metadata of an ERC20, ERC721 or ERC1155 contract address
GetContractInfoBatch- fetch contract metadata of a batch of ERC20, ERC721 or ERC1155 contract addresses