Jump to content

Retrieving DST server data no longer works


Recommended Posts

Where can I find the documentation? I make a request like this:

curl -X POST 'https://lobby-v2.klei.com/lobby/read' --data-raw '{"__token":"MY_TOKEN","query":{}}'


But I get an error:
 

{"Error":{"Code":"E_INVALID_INPUT"}}

In this case:
 

curl -k -X POST -d '{"__gameId":"DontStarveTogether","__token":"MY_TOKEN","query":{}}' https://lobby-v2.klei.com/lobby/read

OR

curl -k -X POST 'https://lobby-v2.klei.com/lobby/read' --data-raw '{"__gameId":"DontStarveTogether","__token":"MYTOKEN","query":{}}'

OR

curl -X POST 'https://lobby-v2.klei.com/lobby/read' --data-raw '{"__gameId":"DontStarveTogether","__token":"MYTOKEN","query":{}}'

I get an error:

{"Error":{"Code":"E_INVALID_INPUT"}}

 

How to request the whole list of servers?

Link to comment
Share on other sites

On 7/12/2023 at 11:36 PM, vincent.ker.adm said:

Hi,
You have been calling deprecated servers.
Here is the new address:
 

curl  -X POST 'https://lobby-v2.klei.com/lobby/read' \
  --data-raw '{"__token":"LobbyListings_[redacted]","query":{"__rowId":"KU_[redacted]"}}'


Have a good day

See my previous post, how to use this with and without "query"? Can I filter by IP? Can I get all servers? How to get servers for China, EU, US?

Link to comment
Share on other sites

I'm not too well versed in CURL, but after a little tinkering, I found the following:

The Region codes can be queried using this command:

https://lobby-v2-cdn.klei.com/regioncapabilities-v2.json

Luckily (If one decides to hardcode them manually, otherwise you can probably put the output of the above in a foreach) currently we seemingly only have to condider 4 Regions: us-east-1, eu-central-1, ap-southeast-1, ap-east-1.

According to PeterA there's currently these 5 Platforms: Steam, PSN, Rail, XBone, Switch.

Adding these parameters to this URL https://lobby-v2-cdn.klei.com/{aws_region}-{platform}.json.gz

gives you a result as such: https://lobby-v2-cdn.klei.com/eu-central-1-Steam.json.gz

Which returns a JSON file with all the specified servers. (When entered in the Browser URL field.)

image.thumb.png.ff384d5b4032b2f10d2009666d97fd53.png

You'll just need to use a CURL or whatever command to get the JSON file(s) and then use a JSON parser/crawler to get what you want. You can also just append the results of such to have a full list of servers I guess.

Information taken from here:

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...