getnftcollectionevents
description: >- Get NFT events (mint, burn, transfer) associated with the given NFT collection.
getNFTCollectionEvents
How to use getNFTCollectionEvents method ?
Below, you'll find an in-depth guide that provides a comprehensive explanation of how to utilize the getNFTCollectionEvents 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 |
fromBlock | number | Starting block for querying |
toBlock | number | Ending block for querying |
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 number of NFT events associated with given collection |
nextPageKey | string | Key to get the next page of results if more are available. |
events | array<object> | array of NFTEvent objects |
contractAddress | string | The address of the NFT contract |
contractName | string | The name of the NFT contract |
contractSymbol | string | The symbol of the NFT contract |
contractType | string | The type of the NFT contract ('erc721' or 'erc1155') |
tokenId | string | The token ID of the NFT |
eventType | string | The event type (Mint, Transfer, Burn) |
amount | string | The quantity of tokens transferred |
toAddress | string | The destination address for the NFT Event |
blockHash | string | The block hash of the NFT Event Occurrence |
blockNumber | number | The height of the block of the NFT Event Occurrence |
blockTimestamp | string | The block timestamp of the NFT Event Occurrence |
transactionHash | string | Transaction Hash of the NFT Event Occurrence |
This API is paginated, response items are ordered descending by:
- blockNumber
- transferIndex
Example Request and Result for getNFTCollectionEvents
In this section, you can find an illustrative example of a request made to retrieve the count of the NFTEvents associated with the collection and the events objects using the getNFTCollectionEvents 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 NFT events associated with given collection and the array of NFTEvent objects.
GET
https://starknet-mainnet.blastapi.io/<project_id>/builder/getNFTCollectionEvents?
Query Parameters
Name | Type | Value |
---|---|---|
contractAddress | string |
|
fromBlock | number |
|
pageSize | number |
|
- 200: OK
{
"count": 3,
"nextPageKey": "ZjRlY2ZhMzczMGViOjE3MTExNDk2NzE6NjI1ODA5OjMxMw",
"events": [
{
"contractAddress": "0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1",
"contractName": "Spok",
"contractSymbol": "SPOK",
"contractType": "erc721",
"tokenId": "2184301",
"eventType": "Transfer",
"amount": "1",
"fromAddress": "0x04f48d10ca537b4b09d1321c12188fcd397485ed722e0438c5db4670652c41b2",
"toAddress": "0x002b81fdcef1a016c401c50956e6d3a2389cb7eaf9ce2070536dacafd0092400",
"blockHash": "0x000b5f2172a5fb697b2d779e0db051fb9c4675230e451b430a994c1d97787446",
"blockNumber": 625869,
"blockTimestamp": "2024-03-22T21:58:17.000Z",
"transactionHash": "0x0218301c59210a5c97b84f15bfe5e1eb853213602e7f92f35b952d90fae7ba14"
},
{
"contractAddress": "0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1",
"contractName": "Spok",
"contractSymbol": "SPOK",
"contractType": "erc721",
"tokenId": "3010046",
"eventType": "Transfer",
"amount": "1",
"fromAddress": "0x051a4334186327f91cd49ec3f93fc716ea718b89cb7a21c4df9695723cc8f032",
"toAddress": "0x004b9160b6e6c0d06d19e987b31bb328e664e798c5329c1aedb4a88ce9a914fb",
"blockHash": "0x031d91b06a88c0c3a7c91962331251e10a264558241dffddbcd4c41dc5585cc3",
"blockNumber": 625868,
"blockTimestamp": "2024-03-22T21:55:17.000Z",
"transactionHash": "0x045dfc4a903e211407939b376a5bc0dcb76dcac343a1097020afeee6a8db675c"
},
{
"contractAddress": "0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1",
"contractName": "Spok",
"contractSymbol": "SPOK",
"contractType": "erc721",
"tokenId": "2233458",
"eventType": "Transfer",
"amount": "1",
"fromAddress": "0x052d0f01bc2674e48a9847694ce05ee0a18faa48479d0bedc8383f5270bf7b2a",
"toAddress": "0x01419e34e180ceba84744622bb48a0316ae93d0ab4ea8437ee4255bfbe21a417",
"blockHash": "0x07b7e31d67bd3d5157df4f3abc3871861c5226dff8fc637cbafcb77ed8360066",
"blockNumber": 625809,
"blockTimestamp": "2024-03-22T19:41:24.000Z",
"transactionHash": "0x042069db929453b6e116e02ec683bd4b77eef152ccc87243d01f5ec0315d602d"
}
]
}
curl -X GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getNFTCollectionEvents?pageSize=3&contractAddress=0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1&fromBlock=625758 \
-H 'Content-Type: application/json' \