Skip to main content

getcollectionnfts


description: Get all NFTs that belong to the given collection.

getCollectionNFTs

How to use getCollectionNFTs method ?

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

Parameters

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

ParameterTypeDescription

contractAddress*

stringThe contract address of the NFT collection
startTokenIdstring

The starting token ID for retrieving NFTs within the given collection (hex or number).

endTokenIdstring

The ending token ID for retrieving NFTs within the given collection (hex or number).

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
countnumberThe total number of NFTs belonging to the given collection
nextPageKeystringKey to get the next page of results if more are available.
nftsarray<object>

array of NFT objects (see the getNFT method for more details)

info

This API is paginated, response items are ordered ascending by tokenId.

Example Request and Result for getCollectionNFTs

In this section, you can find an illustrative example of a request made to retrieve the total number of NFTs belonging to the given collection and the list of NFT objects using the getCollectionNFTs 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 NFTs belonging to the given collection and the array of NFT objects.

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

Query Parameters

NameTypeValue
contractAddressstring

0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1

startTokenIdstring
3093485
endTokenIdstring
3094973
pageSizenumber
2
{
"count": 2,
"nextPageKey": "NzBhYTRjMjhmOTUxOjE3MTExMjUxMDM6MzA5NDk3Mg",
"nfts": [
{
"contractAddress": "0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1",
"contractName": "Spok",
"contractSymbol": "SPOK",
"contractType": "erc721",
"tokenId": "3094973",
"minterAddress": "0x03efc2b63bf04a09b3dabc0cdbf4c51858a96349bb06008b7c866d85f4f5c394",
"mintBlockNumber": 622943,
"mintTimestamp": 1710865283,
"mintTransactionHash": "0x029496c985649a0bc3f2b04be8fa45520901bf12ad3ba8cabeb0afa5e247781b",
"numberOfTokens": "1",
"numberOfOwners": "1",
"ownerAddress": "0x03efc2b63bf04a09b3dabc0cdbf4c51858a96349bb06008b7c866d85f4f5c394",
"tokenUri": "https://cloud.argent-api.com/v1/moments/metadata/3/3094973",
"tokenMetadata": null,
"name": null,
"description": null,
"attributes": [],
"externalLink": null,
"imageUrl": null,
"animationUrl": null,
"cachedImage": null,
"cachedThumbnail": null
},
{
"contractAddress": "0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1",
"contractName": "Spok",
"contractSymbol": "SPOK",
"contractType": "erc721",
"tokenId": "3094972",
"minterAddress": "0x0559b02909dadd22ccfcd741ab1be159c64eb4903b1215efe66b179bc7b64a91",
"mintBlockNumber": 622942,
"mintTimestamp": 1710865179,
"mintTransactionHash": "0x05e27a9fc12bfc526c065444558c253055bef9c9107b91d265db9896a80cc4e3",
"numberOfTokens": "1",
"numberOfOwners": "1",
"ownerAddress": "0x0559b02909dadd22ccfcd741ab1be159c64eb4903b1215efe66b179bc7b64a91",
"tokenUri": "https://cloud.argent-api.com/v1/moments/metadata/3/3094972",
"tokenMetadata": null,
"name": null,
"description": null,
"attributes": [],
"externalLink": null,
"imageUrl": null,
"animationUrl": null,
"cachedImage": null,
"cachedThumbnail": null
}
]
}
curl -X GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getCollectionNFTs?pageSize=2&contractAddress=0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1&startTokenId=3093485&endTokenId=3094973 \
-H 'Content-Type: application/json' \