Post
Topic
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)

sorry, that was my bad. i always make the same mistake with pages in API calls. Roll Eyes
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"