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 to webhook by block

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

Send webhook based on a specific block number using stream config and addresses.

PATH PARAMS
chainIdstringrequired
blockNumbernumberrequired
streamIdstringrequired
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',
'X-API-Key': 'YOUR_API_KEY'
},
};

fetch('https://api.moralis-streams.com/streams/evm/%3AchainId/block-to-webhook/%3AblockNumber/%3AstreamId', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response Example
Empty