events - Flow

Returns events of a given type within a block-height range, or across a set of block IDs. Event type strings follow the A.{address}.{contract}.{event} format. Use it to index on-chain activity such as token transfers.

Endpoint

httpGET /v1/events

Query Parameters

ParameterTypeDescription
typestringEvent type, e.g. A.1654653399040a61.FlowToken.TokensDeposited (required)
start_heightstringStart block height of the range
end_heightstringEnd block height of the range
block_idsstringComma-separated block IDs instead of a range

Example

bashexport FLOW_REST=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

curl "${FLOW_REST}v1/events?type=A.1654653399040a61.FlowToken.TokensDeposited&start_height=88226300&end_height=88226301"

example.js

javascriptconst axios = require('axios');

const response = await axios.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/v1/events', {
    params: {
        type: 'A.1654653399040a61.FlowToken.TokensDeposited',
        start_height: '88226300',
        end_height: '88226301'
    },
    headers: { 'Content-Type': 'application/json' }
});

console.log(response.data);

example.py

pythonimport requests

response = requests.get(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/v1/events',
    headers={'Content-Type': 'application/json'},
    params={
        'type': 'A.1654653399040a61.FlowToken.TokensDeposited',
        'start_height': '88226300',
        'end_height': '88226301'
    }
)

print(response.json())

example.rs

rustuse reqwest::Client;
use serde_json::Value;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    let response = client
        .get("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/v1/events")
        .query(&[
            ("type", "A.1654653399040a61.FlowToken.TokensDeposited"),
            ("start_height", "88226300"),
            ("end_height", "88226301"),
        ])
        .header("Content-Type", "application/json")
        .send()
        .await?
        .json::<Value>()
        .await?;

    println!("Result: {}", response);
    Ok(())
}

Response

json[
    {
        "block_id": "3b5f...",
        "block_height": "88226300",
        "block_timestamp": "2025-01-15T12:00:00Z",
        "events": [
            {
                "type": "A.1654653399040a61.FlowToken.TokensDeposited",
                "transaction_id": "a1b2...",
                "transaction_index": "0",
                "event_index": "0",
                "payload": "eyJ0eXBlIjoi..."
            }
        ]
    }
]

Response Fields

FieldTypeDescription
block_heightstringHeight the events were emitted at
eventsarrayEvents with type, transaction id, and base64 payload

Use Cases

  • Activity Indexing: Track token transfers and NFT events
  • Analytics: Aggregate contract events over a height range

Error Handling

ErrorMessageDescription
400 / Bad requestBad requestA path, query, or body parameter was invalid
404 / Not foundNot foundThe block, account, transaction, or resource does not exist
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect