Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.2

Get stream block data by number

POSThttps://api.moralis-streams.com/streams/evm/:chainId/block/:blockNumber

Get webhook data returned on the block number with provided stream config.

PATH PARAMS
chainIdstringrequired
The chain ID, as a hexadecimal.
blockNumbernumberrequired
The block number
BODY PARAM
tagstring
A user-provided tag that will be send along the webhook, the user can use this tag to identify the specific stream if multiple streams are present
topic0array
An Array of topic0's in string-signature format ex: ['FunctionName(address,uint256)']
No items in the array
allAddressesboolean
Include events for all addresses (only applied when abi and topic0 is provided)
includeNativeTxsboolean
Include or not native transactions defaults to false
includeContractLogsboolean
Include or not logs of contract interactions defaults to false
includeInternalTxsboolean
Include or not include internal transactions defaults to false
includeAllTxLogsboolean
Include all logs if atleast one value in tx or log matches stream config
filterPossibleSpamAddressesboolean
abiobject
anonymousboolean
constantboolean
inputsobject
namestring
typestring
indexedboolean
componentsjson
internalTypestring
namestring
outputsobject
namestring
typestring
componentsjson
internalTypestring
payableboolean
stateMutabilitystring
typestring
gasnumber
advancedOptionsobject
topic0string
filterjson

The filter object for the topic0 https://docs.moralis.io/docs/filter-streams

includeNativeTxsboolean
addressesarrayrequired
addresses[0]
string
Responses
API KEY
// Dependencies to install:
// $ npm install node-fetch --save
// add "type": "module" to package.json

import fetch from 'node-fetch';

const options = {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
},
body: JSON.stringify({
"tag": "my-tag",
"allAddresses": false,
"includeNativeTxs": true,
"includeContractLogs": false,
"includeInternalTxs": false,
"includeAllTxLogs": true,
"addresses": [
"0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5"
]
})
};

fetch('https://api.moralis-streams.com/streams/evm/0x1/block/20226240', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response Example
Empty