Arkanic / Dredbot2

dredbot, re-written
0 stars 0 forks source link

can you teach me how to use drednot.io leaderboard api in nodejs? #2

Open ThePolishCat opened 2 years ago

ThePolishCat commented 2 years ago

can you teach me how to use drednot.io leaderboard api in nodejs?

Arkanic commented 2 years ago

sorry for replying so late, i was busy

the endpoint is at https://drednot.io/api/scoreboard

you can use count= to get a certain amount of ships (max 1000) you can use offset_score= to get ships below that score e.g. to get 500 ships that have below 100k points: https://drednot.io/api/scoreboard?count=500&offset_score=100000

you can use a npm package like needle or something to do the request, then you can JSON.parse the result

if you want to get all the ships like dredbot does, you need to start by getting the top 1k ships with the command ?count=1000 after that you need to send the command ?count=1000&offset_score=<insert the score of the last ship in the previous "page" here> to get the next "page" of results

and just keep on doing that until a certain point (say, like, 10k points)

if you need any more help just comment here best of luck