Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.2

Get NFT Traits by Collection (With Pagination)

GEThttps://deep-index.moralis.io/api/v2.2/nft/:address/traits/paginate

Get NFT traits for a given collection

PATH PARAMS
addressstringrequired
The address of the NFT contract
QUERY PARAMS
chainstring
The chain to query
cursorstring
The cursor returned in the previous response (used for getting the next page). Learn more on cursor pagination here.
limitnumber
The desired page size of the result.
orderstring
The order of the result, in ascending (ASC) or descending (DESC)
Responses
API KEY
import Moralis from 'moralis';

try {
await Moralis.start({
apiKey: "YOUR_API_KEY"
});

const response = await Moralis.EvmApi.nft.getNFTTraitsByCollectionPaginate({
"chain": "0x1",
"order": "DESC",
"address": "0x524cab2ec69124574082676e6f654a18df49a048"
});

console.log(response.raw);
} catch (e) {
console.error(e);
}
Response Example
{
"cursor": "",
"page": 2,
"page_size": 100,
"result": [
{
"trait_type": "Background",
"trait_value": "Lavendar",
"count": 18593,
"percentage": 85.8,
"rarity_label": "Top 4% trait"
}
]
}