Blocks API
Standard endpoints
- class blockscan.modules.blocks.Blocks[source]
- static get_block_number_by_timestamp(timestamp: int, closest: str)[source]
Get block number given a specific timestamp.
Note
Supports UNIX timestamps in seconds.
- Parameters
timestamp (int) – Target timestamp.
closest (str) – Closest block “before” or “after” target timestamp.
- Returns
Block number for requested timestamp.
- Return type
str
Pro endpoints
- class blockscan.modules.blocks.ProBlocks[source]
- static get_daily_average_block_size(start_date: str, end_date: str, sort: str) str[source]
Note
Pro API token required
Returns the daily average block size within a date range
- Parameters
start_date (str) – the starting date in yyyy-MM-dd
end_date (str) – the end date in yyyy-MM-dd
sort (str) – the sorting preference (asc or desc)
- Returns
Daily average block size
- Return type
str
- static get_daily_average_block_time(start_date: str, end_date: str, sort: str) str[source]
Note
Pro API token required
Returns the daily average of time needed for a block to be successfully mined within a date range
- Parameters
start_date (str) – the starting date in yyyy-MM-dd
end_date (str) – the end date in yyyy-MM-dd
sort (str) – the sorting preference (asc or desc)
- Returns
Daily average mining time
- Return type
str
- static get_daily_block_count_and_rewards(start_date: str, end_date: str, sort: str) str[source]
Note
Pro API token required
Returns the number of blocks mined daily and the amount of block rewards within a date range
- Parameters
start_date (str) – the starting date in yyyy-MM-dd
end_date (str) – the end date in yyyy-MM-dd
sort (str) – the sorting preference (asc or desc)
- Returns
daily mined block and reward
- Return type
str
- static get_daily_block_rewards(start_date: str, end_date: str, sort: str) str[source]
Note
Pro API token required
Returns the amount of block rewards distributed to miners daily within a date range
- Parameters
start_date (str) – the starting date in yyyy-MM-dd
end_date (str) – the end date in yyyy-MM-dd
sort (str) – the sorting preference (asc or desc)
- Returns
daily block rewards
- Return type
str
- static get_daily_uncle_block_count_and_rewards(start_date: str, end_date: str, sort: str) str[source]
Note
Pro API token required
Returns the number of ‘Uncle’ blocks mined daily and the amount of ‘Uncle’ block rewards within a date range
- Parameters
start_date (str) – the starting date in yyyy-MM-dd
end_date (str) – the end date in yyyy-MM-dd
sort (str) – the sorting preference (asc or desc)
- Returns
daily uncle blocks
- Return type
str