B
BattleMetrics•2y ago
East

battle metrics api

hello im wondering if theres a way to use the battlemetrics api to search for servers and find the population of it and make that into a discord bot ive been struggling to get mine to work 😄
20 Replies
East
EastOP•2y ago
this is for ark^
Hordicus
Hordicus•2y ago
If you have a specific server in mind you can make a simple request like this: https://api.battlemetrics.com/servers/2522768 If you need to actually search for the server, then use the search filter like so: https://api.battlemetrics.com/servers?filter[game]=ark&filter[search]=genesis
East
EastOP•2y ago
is there a wat to get all servers online for ark? instead of searching them server by server?
[MIG] EOC LongBarrel
Not at once, you would have to use the next page. This can take alot of time due to the amount of servers. Just remove the search filter. & run game filter only
East
EastOP•2y ago
There's a official ark json file for xbox and PlayStation I've been trying to find something similar for pc but bm is the closest I've got to finding servers then extracting the server names and such Another question I want to ask is there somewhere I can search for a user using a gamertag and pull the servers they have played and the playtime of each server?
[MIG] EOC LongBarrel
Have you reviewed the API Documentation?
East
EastOP•2y ago
Yes but I find it confusing It goes on about banning players ect
[MIG] EOC LongBarrel
Yeah that's part of the RCON Stuff. https://www.battlemetrics.com/developers/documentation The top section has lists, like player list, player Info, player sessions.
East
EastOP•2y ago
Ahh okay thank you!
[MIG] EOC LongBarrel
Possibly cause PC servers are slightly different. They use what Is known as a master server list, which just contains server IPs & query ports. Then you have to manually query every server (this is what BM does for most games)
East
EastOP•2y ago
So there's no way to get every server and info into 1 json or into 1 file? Withought having to go page by page
[MIG] EOC LongBarrel
No, you need to use pages
East
EastOP•2y ago
Ahh okay
[MIG] EOC LongBarrel
Battlemetrics isn't designed for commercial use, API is designed for personal use.
East
EastOP•2y ago
Ah I'm just makeing a fun little project
[MIG] EOC LongBarrel
If you use it for commercial & charge for it. Battlemetrics can take legal actions under terms of use/service.
East
EastOP•2y ago
Nah I'm not paying people to use it
[MIG] EOC LongBarrel
You will have to live with the same constraints everyone else has.
East
EastOP•2y ago
Just seeing my capabilities of coding goes Yeah
Want results from more Discord servers?
Add your server