NFT Information Retrieval
NFT Data APIs
NFT APIs allow you to read NFT metadata and ownership information. These API's include:
More APIs will be added in the near future.
- Ethereum Mainnet
- Goerli
- Polygon
- Rinkeby (deprecated)
- Optimism/Arbitrum (under evaluation)
Most APIs take in an array of filters and attribute filters, in the following format:
/**
* 1. Filter for specific tokens by passing in a tokenId
* 2. Filter for a set of tokens by passing in an array of tokenIds
* 3. Filter for a range of tokens by passing in the minTokenId and maxTokenId
* You can use either 1, 2 or 3, but not all of them together.
*/
interface Filter {
contractAddress: string;
tokenId?: string;
tokenIds?: Array<string>
minTokenId?: string;
maxTokenId?: string;
}
/**
* Filter tokens by attribute
*
* An empty attributes array is equivalent to saying
* just filter tokens for the contractAddress and allow
* any attribute.
*/
interface AttributeFilter {
contractAddress: string;
attributes: Array<Attribute>;
}
interface Attribute {
traitType?: string;
value: string;
}
Each filter is treated as an 'or' statement.
client.getNFTsOfOwner({
filters: [
{
contractAddress: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'
},
{
contractAddress: '0x60e4d786628fea6478f785a6d7e704777c86a7c6'
}
]
})
client.getNFTs({
attributeFilters: [
{
contractAddress: '0x8a90cab2b38dba80c64b7734e58ee1db38b8992e',
attributes: [
{
traitType: 'body',
value: 'navy sweater'
},
{
traitType: 'face',
value: '3d glasses'
},
]
},
]
})
client.getNFTs({
attributeFilters: [
{
contractAddress: '0x8a90cab2b38dba80c64b7734e58ee1db38b8992e',
attributes: [
{
traitType: 'face',
value: '3d glasses'
},
]
},
{
contractAddress: '0x8a90cab2b38dba80c64b7734e58ee1db38b8992e',
attributes: [
{
traitType: 'body',
value: 'navy sweater'
}
]
}
]
})
client.getNFTs({
filters: [
{
contractAddress: '0x4ac3d17fd6c2db18ec619fe2d68d2c22b18378ff',
minTokenId: '11600030001',
maxTokenId: '11600030050',
},
]
})
Last modified 2mo ago