How to Get Events by Block Number

This tutorial explains the steps involved in getting a list of all events by any block number in the Ethereum Mainnet network.

Step 1. Use the events by block endpoint with the following details:

  • protocol: ethereum

  • network: mainnet

  • block number, e.g.: 14566898

    https://svc.blockdaemon.com/nft/v1/ethereum/mainnet/events/block/14566898
    

Step 2. Execute the query.

For example, in cURL, you should run the following code:

curl -X GET 'https://svc.blockdaemon.com/nft/v1/ethereum/mainnet/events/block/14566898' -H 'Authorization: Bearer YOUR_API_KEY'

📘

Note!

To authorize your request, you need to get an API key and use it as a bearer token or a query parameter. Learn more: Authentication Guide

Step 5. Your results will look something like this:

{
    "data": [
        {
            "id": "fe4b1f5e-690a-57c3-82c4-705a2da01325",
            "contract_address": "0xa3AEe8BcE55BEeA1951EF834b99f3Ac60d1ABeeB",
            "token_id": "7200",
            "event_type": "sale",
            "timestamp": "1649714022",
            "from_account": "0xFb406C694cAb94672bcF99dc176AE630d3C093ad",
            "to_account": "0x4AE51f105E4777Fd204e860594eB0880dB27e01b",
            "quantity": "1",
            "block_number": "14566898",
            "transaction_hash": "0x698f8e8cdfd9808f7e60d570c7dac6d8c6cbe630101227c770f05183fa9bd8c2"
        },
        { ...more events... }
    ],
    "meta": {
        "paging": {
            "next_page_token": ""
        }
    }
}