Skip to main content

listnftcollections


description: Get a list of NFT collections matching the given filters.

listNFTCollections

How to use listNFTCollections method ?

Below, you'll find an in-depth guide that provides a comprehensive explanation of how to utilize the listNFTCollections method effectively using Blast.

Parameters

Below, you can find the query parameters accepted by the method.

ParameterTypeDescription

contractType*

stringThe contract type of the NFT collections to be retrieved
fromBlockstringStarting block for querying
toBlockstringEnding block for querying
sortBystring

The parameter by which the retrieved NFT collections should be sorted (one of: deployBlockNumber, totalSupply, numberOfOwners, numberOfTransfers, default: deployBlockNumber)

pageSizenumber

Maximum number of records to be retrieved in one page (max 100, default 25)

pageKeystring

Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response

Returns

ParameterTypeDescription
countnumber

The total number of NFT collections that match the specified filters

nextPageKeystringKey to get the next page of results if more are available.
collectionsarray<object>

array of NFTCollection objects (see the getNFTCollection method for more details)

info

This API is paginated, response items are ordered descending by sortBy field value.

Example Request and Result for listNFTCollections

In this section, you can find an illustrative example of a request made to retrieve the total count of NFT sets that satisfy the required filters and the NFTCollection objects using the listNFTCollections method.

info

The example in this section uses a non-existing project id.

Make sure you replace it with your Starknet endpoint when issuing the Builder API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Returns the total number of NFT collections that match the specified filters.

GET https://starknet-mainnet.blastapi.io/<project_id>/builder/listNFTCollection?

Query Parameters

NameTypeValue
contractTypestring
erc721_1155
sortBystring
totalSupply
{
"count": 25,
"next_page_key": "ZDY0ZmY3OWJjZjVkOjE3MTExMjEwMTQ6MjA3MDc6MHgwMjM4ZDBkNzRiYjZhNzg1MzRhYTMwZjY0ZjE1MDc2NTViMGQ1OWU5ZWRmZDU4ZDA4ZmE3NmRhOWY4MTUyYmVl",
"result": [
{
"contractAddress": "0x04310198758a4849cd7578c2401308b228df29cc5ab6be1d6193a18f1a2f2c5c",
"contractName": null,
"contractSymbol": null,
"contractType": "erc1155",
"deployBlockNumber": 23967,
"totalSupply": "16333553612205046246241981156724874154952",
"numberOfDistinctTokens": 5,
"numberOfOwners": 1,
"numberOfTransfers": 19,
"description": null,
"website": null,
"cachedBanner": null,
"cachedLogo": null
},
{
"contractAddress": "0x0122a48ed9384ba2b2888d2ca8b254fcb7e7e818d6ffce7eec34790ca605aee4",
"contractName": null,
"contractSymbol": null,
"contractType": "erc1155",
"deployBlockNumber": 23969,
"totalSupply": "680564733841876926926749214863552118397",
"numberOfDistinctTokens": 2,
"numberOfOwners": 1,
"numberOfTransfers": 20,
"description": null,
"website": null,
"cachedBanner": null,
"cachedLogo": null
},
{
"contractAddress": "0x07e5810cbfa94467eb6cd7b3403678e61e6bf028bbcfb1ef3ef8eb5d0245b3e2",
"contractName": null,
"contractSymbol": null,
"contractType": "erc1155",
"deployBlockNumber": 20709,
"totalSupply": "48804716",
"numberOfDistinctTokens": 1,
"numberOfOwners": 1,
"numberOfTransfers": 22,
"description": null,
"website": null,
"cachedBanner": null,
"cachedLogo": null
},
```
]}
url -X GET https://starknet-mainnet.blastapi.io/<project-id>/builder/listNFTCollections?contractType=erc721_1155&sortBy=totalSupply \
-H 'Content-Type: application/json' \