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.
Parameter | Type | Description |
---|---|---|
contractAddress* | string | The contract address of the NFT collection |
startTokenId | string | The starting token ID for retrieving NFTs within the given collection (hex or number). |
endTokenId | string | The ending token ID for retrieving NFTs within the given collection (hex or number). |
pageSize | number | Maximum number of records to be retrieved in one page (max 100, default 25) |
pageKey | string | Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response |
Returns
Parameter | Type | Description |
---|---|---|
count | number | The total number of NFTs belonging to the given collection |
nextPageKey | string | Key to get the next page of results if more are available. |
nfts | array<object> | array of NFT objects (see the getNFT method for more details) |
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.
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
Name | Type | Value |
---|---|---|
contractAddress | string |
|
startTokenId | string |
|
endTokenId | string |
|
pageSize | number |
|
- 200: OK
{
"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' \