Ninjastic
Home
Search
Users
Boards
Addresses
Ctrl + K
Toggle theme
Open menu
Post
Edited versions
Quotes to this post
Post
45317392
Topic
5023337
Board
Development & Technical Discussion
Merits
1 from 1 user
Re: Data history for mined blocks
by
pooya87
on
07/09/2018, 06:00:17 UTC
⭐ Merited by
bomberb17
(1)
Quote from: bomberb17 on September 07, 2018, 05:24:45 AM
Still however it looks like
https://api.smartbit.com.au/v1/blockchain/pool/AntPool?limit=1000&sort=height&next=1
and
https://api.smartbit.com.au/v1/blockchain/pool/AntPool?limit=1000&sort=height&next=2
return the same data..
sorry, that was my bad. i always make the same mistake with pages in API calls.
basically you make the first call:
https://api.smartbit.com.au/v1/blockchain/pool/AntPool?limit=20&sort=height
(used 20 so it opens up fast)
then you look for this key in the JSON:
[pool][block_paging][next_link]
which contains the link to next page:
https://api.smartbit.com.au/v1/blockchain/pool/AntPool?next=NTQwMjA2&limit=20
in case you are wondering what the heck "NTQwMjA2" is, it is base64 encoding of the last block height in previous page. in this case the block at index 19 of the array result of the first call which is "540206"