Skip to main content

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.

ParameterTypeDescription

contractAddress*

stringThe contract address of the NFT collection
fromBlocknumberStarting block for querying
toBlocknumberEnding block for querying
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 number of NFT events associated with given collection
nextPageKeystringKey to get the next page of results if more are available.
eventsarray<object>array of NFTEvent objects
contractAddressstringThe address of the NFT contract
contractNamestringThe name of the NFT contract
contractSymbolstringThe symbol of the NFT contract
contractTypestringThe type of the NFT contract ('erc721' or 'erc1155')
tokenIdstringThe token ID of the NFT
eventTypestringThe event type (Mint, Transfer, Burn)
amountstringThe quantity of tokens transferred
toAddressstringThe destination address for the NFT Event
blockHashstringThe block hash of the NFT Event Occurrence
blockNumbernumberThe height of the block of the NFT Event Occurrence
blockTimestampstringThe block timestamp of the NFT Event Occurrence
transactionHashstringTransaction Hash of the NFT Event Occurrence
info

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.

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 events associated with given collection and the array of NFTEvent objects.

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

Query Parameters

NameTypeValue
contractAddressstring

0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1

fromBlocknumber
625758
pageSizenumber
3
{
"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' \