/blocks/time-range

Endpoint returning simple data about blocks mined between the given timestamps

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
"use strict";
const Shards = require("web3-shards");

const shards = Shards.API.Ethereum.V1;
shards.configure({
    apiKey: "YOUR_API_KEY", // Join the discord to get your api key. https://discord.com/invite/kJd8W7Nh7e
    maxRequestsPerSecond:5, // client-side limiter to prevent accidental burning
    logger: 1               // 0=none,1=errors,2=verbose
});

const getBlocks = async function() {
    const resp = await shards.blocks.getBlocksInTimeRange(1644240971, 1644241350);
    console.log(resp)
}

getBlocks();
Query Params
int32
required
Defaults to 1644240971

The epoch seconds from which blocks will be searched.

int32
required
Defaults to 1644241350

The epoch seconds to which blocks will be searched.

string
enum
required
Defaults to eth

The target chain. One of eth | bsc | shibarium.

Allowed:
Headers
string
Defaults to db2f88b1-21cd-440b-9e8c-486a8688e34e
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
text/plain