Skip to main content

getnftevents


description: Get NFT events (mint, burn, transfer) associated with a single NFT.

getNFTEvents

How to use getNFTEvents method ?

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

Parameters

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

ParameterTypeDescription

contractAddress*

stringThe contract address of the NFT
tokenIdstringThe token Id (hex or number)
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
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 getNFTEvents

In this section, you can find an illustrative example of a request made to retrieve the count of the NFTEvents and the events objects using the getNFTEvents 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 and the array of NFTEvent objects.

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

Query Parameters

NameTypeValue
contractAddressstring

0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1

tokenIdstring
3095038
{
"count": 1,
"events": [
{
"contractAddress": "0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1",
"contractName": "Spok",
"contractSymbol": "SPOK",
"contractType": "erc721",
"tokenId": "3095038",
"eventType": "Mint",
"amount": "1",
"fromAddress": "0x0000000000000000000000000000000000000000000000000000000000000000",
"toAddress": "0x0500bfd99cca3525caf7e2757b160cd0fa097c5736def17c484f45f436f0e07a",
"blockHash": "0x07d939d2a29da4388477864f12e52b678d1e82d5ad6b2d39f6b5edfff4b6b9b6",
"blockNumber": 623016,
"blockTimestamp": "2024-03-19T18:16:48.000Z",
"transactionHash": "0x06d9a4b33ad6bb76ea5782919de4507865f295ae5e78e0f381b66528128e85a3"
}
]
}
curl -X GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getNFTEvents?contractAddress=0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1&tokenId=3095038 \
-H 'Content-Type: application/json' \