AoE 2 DE - API?

Keep in mind that when you make a request to an API, you are just going to get a big dump of numbers. In this case, they are all stored in a JSON document. Here is a tutorial for how to get to this data in Python: https://rapidapi.com/blog/how-to-use-an-api-with-python/

The page you have linked pulls its stats from the API: stats.ageofempires.com/api/AgeII

The civilization data can be found by making a GET request to: (API)/GetGlobalStats

-Edited to fix API location

Doubling up due to link limit:

I am not sure what the reason is for the problem you have pointed out, but it is possible that you are correct. For that reason, and because it is likely in a cleaner format, I think this API may be a better source to use: https://aoe2.net/#api

I managed to get things working. I can get some data and make it readable (convert text string to some tables). I just notice something: Player Match History in aoe2.net contains lots of statistics about the players, lobby settings, civs, … It seems like it does not contain info about how win and how lose?!

This page does not exist?!

Full link: stats.ageofempires.com/api/AgeII/GetGlobalStats

Not sure about aoe2.net data. Might want to check leaderboard statistics. There might not be anything that tracks whether individual matches are won. That might be on AoE’s side, I have no idea.

-Edited to fix API location

Still getting “Sorry, But that page doesn’t Exist!” message…

@AgeInsiders: could you provide a link to some documentation of said API or a full example request? Is any additional authentication data in the header required?

As WoodsierCorn696 mentioned, the /GET https://ageofempires.com/api/AgeII/GetGlobalStats leads to “Sorry, but that page doesn’t exist”!
Nor the other one works: /GET https://www.ageofempires.com/api/ageiide/GetGlobalStats

My error - use: https://stats.ageofempires.com/api/AgeII/GetGlobalStats

I’m not aware of any documentation for the API. These are the only API locations I know:

GetRLLeaderboard
GetGlobalStats

For the ranked leaderboards, query parameters are available to specify the match type, and page number. Example:

GetRLLeaderboard?board=1&page=1

Board=1 - 1v1 Deathmatch
Board=2 - Team Deathmatch
Board=3 - 1v1 RandomMap
Board=4 - Team RandomMap

I’ve been using no Auth headers and so far have been successful.

1 Like

So i have been doing some research on this. aoe2.net must be using the steampowered apis.
https://developer.valvesoftware.com/wiki/Steam_Web_API
Not sure if they are a publisher partner. Some apis dont seem to work here.

also aoe.net apis dont seem to support cors, unable to develop apps on top of that data.

I assume that GetGameServerPlayerStatsForGame might be the one being used, but unfortunately I could not confirm it yet since I currently don’t have a publisher api key. Anybody has insight into this?
Also I could not find any example response and there is not enough documentation to find out what the API actually does.

I would really appriciate if the devs gives us some more easily accessable data to use.

Hey guys I found a few more endpoints:
https://stats.ageofempires.com/api/AgeII/GetMPMatchList
and
/GetRLLeaderboard
and
/GetMPFull

I’m trying to build something here with this: https://aoe.pira.dev
If you put your profile ID in that page you will get some stats (your profile ID can be obtained from aoe2 .net, I’m still trying to get some sort of search functionality).
Any more info on more endpoints or where does aoe2 .net get’s it’s data would be awesome, thanks!

These 3 endpoints do not work anymore.

Hey! Is there currently a way to fetch the information aoe2.net provides, from the same source aoe2.net uses?

And another question: Does anybody now, how to interface with the game in order to join a lobby?
On aoe2.net you have the join match button, so it is possible somehow…

The Endpoints listed above still work; also to join the lobby you can just use the “copy ID” button in a lobby to get the link you can paste into a browser.

They are working, just change “stats” for “api”. For example:
https://api.ageofempires.com/api/v2/AgeII/GetMPMatchDetail

Sorry but can you elaborate a bit? I try to postman it but don’t know what paramter can I input there

Do I need a sort of auth to get access to the api? It seems to work for some and for some not. Would be nice to have access to it so people can build more tools, since aoe2.net is already down for several days.

2 Likes

https://api.ageofempires.com/api/v2/AgeII/GetMPMatchList
is also working but the match history it got is up to 18/9/2022