CraftySalamander / RTS_Overlay

Overlay for RTS, with build orders, match data...
GNU General Public License v3.0
68 stars 5 forks source link

aoe4guides REST API is now available for integration #18

Open jensbuehl opened 8 months ago

jensbuehl commented 8 months ago

https://aoe4guides.com/api/api-docs/

Feel free to pull BOs per user without exporting or copy/paste. If you run into issues or you have questions: Just reach out to me.

CraftySalamander commented 8 months ago

Nice work!

So, if I understand properly, the purpose would be to suggest 10 BOs per civ using a command like https://aoe4guides.com/api/builds?civ=BYZ&orderBy=score&overlay=true.

What is the meaning of the overlay option? It gives the same result with true and false.

What is the meaning of score in the aforementioned command (I understand what are timeCreated, views and likes).

Also, where can I find the author's user id? For instance, this command does not provide any result: https://aoe4guides.com/api/builds?author=FitzBro&civ=BYZ&orderBy=score&overlay=true

I do not know when I will have time to take advantage of it in the overlay (other things to implement first), but I keep it in mind 🙂

jensbuehl commented 8 months ago

overlay option, if defined, enforced the overlay json format. if you remove the overlay option, then it will return the internal format.

score is an internal property which is used to get the "popular" builds. with this option you can get these. Having the same result with "false" might be a bug. Just remove the entire option if you are interested in the native format.

author's id can be found on the account page on aoe4guides: image

Maybe I can take a look into your code - but also lacking time. No worries, at least we are prepared for e.g. automatic pull of BOs instead of manually copy/pasting.

CraftySalamander commented 2 months ago

Hi @jensbuehl

FYI, I released a web-based version of RTS Overlay: https://rts-overlay.github.io/ (see YouTube demo for more info).

In the From external website of Age of Empires IV, there is a link to aoe4guides.com. I could potentially update it later to use your API calls.

jensbuehl commented 2 months ago

Sounds great. I can support with that as well. When time and family permits. ;)

CraftySalamander commented 2 months ago

This is great, but it is as you want. I can also take care of it. If at some point you want to start this task, just send me a message to be sure we are not doing the same thing at the same time ;-)

FYI, I first plan to extend RTS Overlay to support Age of Mythology Retold, and later Stormgate.

CraftySalamander commented 1 week ago

Hi @jensbuehl

Small question about the API. For the command https://aoe4guides.com/api/builds/{buildID}, how can I know what is the build ID of a BO. For instance, how can I get the build ID of this BO?

jensbuehl commented 1 week ago

From the browser URL.

https://aoe4guides.com/builds/TUl77gWBVBqtsY8yNuMe

The long string after builds is the ID.

CraftySalamander commented 1 week ago

Thank you for the quick answer.

I can indeed get it from https://aoe4guides.com/api/builds/TUl77gWBVBqtsY8yNuMe?overlay=true.