Insight API Supports Block Queries

Toomas Oosalu

Insight API added support for querying block data.

Try it out on our playground

Or use it directly from code

const getBlock = async (blockNumber: number) => {
try {
const response = await fetch(
`https://1.insight.thirdweb.com/v1/blocks?filter_block_number=${blockNumber}&limit=1`,
{
headers: {
"x-client-id": <your-client-id>,
},
},
);
const blockResponse = await response.json();
return blockResponse.data[0];
} catch (error) {
console.error("Error:", error);
}
};

๐Ÿ“– Learn more about Insight - itโ€™s open source and ready to power your applications!