Home

Returns information about a block by number or tag.

POST
wss://bsc.nownodes.io/wss/{apiKey}

Returns block information for a block number (hex) or tag (latest, earliest, pending, finalized, safe). The second parameter controls whether full transaction objects (true) or only hashes (false) are returned.

Body

application/json

JSON-RPC 2.0 request for eth_getBlockByNumber, sent as a text message over the WebSocket connection.

jsonrpcstringrequired
idintegerrequired

Request identifier echoed back in the response.

methodstringrequired
paramsArray<any>required

Parameters

apiKeystringrequiredpath

NOWNodes API key. Connect to wss://bsc.nownodes.io/wss/{apiKey}. The WebSocket handshake returns HTTP 403 when the key is missing or invalid.

Response

200OK

JSON-RPC response delivered over the WebSocket connection. Errors are reported inside the same envelope in the error field; see RpcError (live: code -32602 Invalid params for malformed arguments).

403Forbidden

Forbidden. The WebSocket handshake was rejected: the API key is missing or invalid (verified live: wrong and missing keys both return HTTP 403).