Skip to content

aabdullah29/getBlockNumberByDate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

getBlock-etherScan.js

A Node.js script retrieves the starting and ending Ethereum block numbers for a given UTC date by querying the Etherscan API endpoint getblocknobytime.

Features

  • Fetch the first block at or after 00:00:00 UTC of a specified date
  • Fetch the last block at or before 23:59:59 UTC of a specified date
  • Uses axios for HTTP requests and moment for date handling

Prerequisites

Installation

  1. Clone or download this repository.
  2. Install dependencies:
    npm install
    

Usage

Run the script with three arguments: the start date, end date in YYYY-MM-DD format and your Etherscan API key.

node script/getBlock-etherScan.js

About

Node.js script retrieves the starting and ending Ethereum block number

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published