---
title: "Query event stream"
method: GET
path: "/v1/cryptos/{cryptoCode}/events"
tags: ["Events"]
---

# Query event stream

`GET /v1/cryptos/{cryptoCode}/events`

Retrieves a stream of events for the specified cryptocurrency.

## Query parameters

- `lastEventId` integer
- `longPolling` boolean
- `limit` integer

## Response `200`

Event stream retrieved successfully.

- object[]
  - `eventId` integer, required — Unique identifier of the event.
  - `type` 'newblock' | 'newtransaction', required — Type of the event (e.g., 'newblock', 'newtransaction').
  - `data` union, required — Details of the event, depending on the type.
    - NewBlockEvent
      - `height` integer, required — Height of the new block.
      - `hash` string, required — Hash of the new block.
      - `previousBlockHash` string, required — Hash of the previous block.
      - `cryptoCode` string, required — Cryptocurrency code (e.g., 'BTC').
      - `confirmations` integer, required — Number of confirmations (typically 1 for a new block).
    - NewTransactionEvent
      - `blockId` string, nullable — Hash of the block containing the transaction, or null if unconfirmed.
      - `trackedSource` string, required — The tracked source identifier (e.g., derivation scheme).
      - `derivationStrategy` string, required — The derivation strategy used.
      - `transactionData` TransactionResponse, required
        - `blockHash` string — The hash of the block containing this transaction. Will be `null` if the transaction is unconfirmed.
        - `confirmations` integer, required — Number of confirmations the transaction has.
        - `height` integer — The block height. Will be `null` if the transaction is unconfirmed.
        - `transactionId` string, required — The transaction ID.
        - `transaction` string — Raw transaction in hex format. Included only if `includeTransaction` is `true`.
        - `outputs` TransactionOutput[], required — List of outputs related to the tracked source.
          - `scriptPubKey` string — The scriptPubKey of the output in hexadecimal format.
          - `index` integer — The index of the output in the transaction.
          - `value` integer — The amount of the output in satoshis.
          - `keyPath` string — The derivation path if the output is associated with the wallet.
        - `inputs` TransactionInput[], required — List of inputs related to the tracked source.
          - `inputIndex` integer, required — The index of this input within the transaction's list of inputs.
          - `transactionId` string, required — The transaction ID (hash) of the previous transaction whose output is being spent.
          - `index` integer, required — The index of the output in the previous transaction being referenced.
          - `scriptPubKey` string — The scriptPubKey of the output being spent, in hexadecimal format.
          - `value` integer — The amount of the output being spent, in satoshis.
          - `address` string — The Bitcoin address corresponding to the scriptPubKey of the output being spent.
        - `timestamp` integer — Transaction timestamp.
        - `balanceChange` integer — Net balance change for the wallet due to this transaction.
        - `replaceable` boolean — `true` if the transaction can be replaced (the transaction has RBF activated, is unconfirmed, and is not an intermediate transaction in a chain of unconfirmed transactions).
        - `replacing` string, nullable — If present, indicates the transaction ID that this transaction is replacing via RBF.
        - `replacedBy` string, nullable — If present, indicates the transaction ID that replaced this transaction via RBF.
      - `outputs` TransactionOutput[], required — List of outputs related to the transaction.
        - `scriptPubKey` string — The scriptPubKey of the output in hexadecimal format.
        - `index` integer — The index of the output in the transaction.
        - `value` integer — The amount of the output in satoshis.
        - `keyPath` string — The derivation path if the output is associated with the wallet.
      - `cryptoCode` string, required — Cryptocurrency code (e.g., 'BTC').

## Other responses

- `400` — Bad Request. Invalid parameters.

## Changes

- **2024-11-28** `6bfc5768516c` — 2 breaking, 3 warning, 4 info
  - added `#/components/schemas/NewBlockEvent, #/components/schemas/NewTransactionEvent` to the `items/data` response property `oneOf` list for the response status `200`
  - the `items/data` response's property type changed from `object` to no type for status `200`
  - deleted the `path` request parameter `cryptoCode`
  - added the new `newblock` enum value to the `items/type` response property for the response status `200`
  - …5 more
- **2024-11-25** `72a2dfa26976` — 1 info
  - endpoint added
- **2024-11-18** `b5092f204599` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/btcpayserver/apis/nbxplorer-api/changes/v1/cryptos/:cryptoCode/events/get.md)

---

[API](https://skmtc.dev/btcpayserver/apis/nbxplorer-api.md) · [All operations](https://skmtc.dev/btcpayserver/apis/nbxplorer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/btcpayserver/apis/nbxplorer-api/revisions/6bfc5768516c?raw)
