Jump to content

Skylords Reborn API


Recommended Posts

Hello everyone.

I'll keep it short. Past few months, I've been working on our web API that is completely public and available for everyone to use. I've also created simple, functional (but stylistically not very pretty) user interfaces that visualize and consume the said API.

User interface applications are open-sourced on my GitHub. The repository also contains complete instructions on how to consume the API yourselves, if you were to decide to create your own frontend applications. But, you have to be somewhat profficient in web development to understand and begin doing stuff on your own. 

Issues tab is to be used freely for any and all suggestions and bug reports.

Pull Requests that improve and extend the existing UIs are more than welcome. After manual review, they might get merged into the master branch and appear as a part of the next website update. 

Links:

All applications are caching data periodically, so you're actually "querying" the in-memory data, and not the database directly, which does not have any kind of impact on the game servers and database itself. Have in mind these applications are also the first version, they will definetly get improved and extended, as well as the API.

For some of you, these applications and the API open up whole lot of possibilities.

For example, now you could create an application that tracks the average price of every card and makes a nice graph. You could even extend the search options with card orbs, expansion, rarity, etc. 

Or you could create an application that tracks all auctions for a specific card and sends you a mail or push notification when a card appears on the auction house, but is equal or below the specified price.

Average concurrent players/matches graph could be visualized by querying the Statistics API every 2/5/X minutes.

Those of you who understood everything said and know what you're doing, will use this to its maximum potential.

Have fun! :)

Sebu, T1421, kYw and 10 others like this
Link to post
Share on other sites

In my log I noticed, that the total number of auctions in the API hasn't changed since 6 pm CET when the number first reached 5000 auctions, even though there are clear price fluctuations visible for most cards since then.

So I wanted to ask if the number of auctions that the api responds with is capped at 5000, or if this is just some extreme coincidence? Thanks. :)

Edited by Maze
Link to post
Share on other sites
18 hours ago, Maze said:

In my log I noticed, that the total number of auctions in the API hasn't changed since 6 pm CET when the number first reached 5000 auctions, even though there are clear price fluctuations visible for most cards since then.

So I wanted to ask if the number of auctions that the api responds with is capped at 5000, or if this is just some extreme coincidence? Thanks. :)

Unintentional cap, removed it.

Maze and Mynoduesp like this
Link to post
Share on other sites
17 minutes ago, ikke2902 said:

Is there a way to tell what the affinity of a card is? There are for axample two card ID for gladiatrix, but there is no stats mentioning the affinity.

There isn't a way to get it directly, but you can query the card details endpoint to see what can be used.

Steps:

1. Fetch the auctions: https://github.com/fiki574/Skylords-Reborn-API-UI/tree/master/Auctions#post-apiauctionspagenumber

2. Use the cardId fields from the response array

3. Fetch card details: https://github.com/fiki574/Skylords-Reborn-API-UI/tree/master/Auctions#get-apicardscardid

 

3 hours ago, fxfighter said:

Excellent job on this!

Would it be feasible to have an endpoint that outputs a csv or something similar of the current auctions? Purpose being that I would like to be able to import data into a spreadsheet for my own searching/filtering but need the auction information in a digestable format.

All suggestions are welcome here: https://github.com/fiki574/Skylords-Reborn-API-UI/issues

The backend returns JSON as a response, which is definetly a digestable and convertable format. Not sure about the default spreadsheet support for it, but you could always temporarily use some kind of an online converter, like so: https://www.convertcsv.com/json-to-csv.htm

Link to post
Share on other sites
11 minutes ago, fiki574 said:

There isn't a way to get it directly, but you can query the card details endpoint to see what can be used.

Steps:

1. Fetch the auctions: https://github.com/fiki574/Skylords-Reborn-API-UI/tree/master/Auctions#post-apiauctionspagenumber

2. Use the cardId fields from the response array

3. Fetch card details: https://github.com/fiki574/Skylords-Reborn-API-UI/tree/master/Auctions#get-apicardscardid

I don't see the affinity following the third step or am I skipping something?

I went with this link https://auctions.backend.skylords.eu/api/cards/all

image.png.ebd367c042487325cb6be0633b0dfc93.pngimage.png.d513c5ec33caf6118a352adf30b9d301.png

 

Link to post
Share on other sites
1 hour ago, ikke2902 said:

I don't see the affinity following the third step or am I skipping something?

I went with this link https://auctions.backend.skylords.eu/api/cards/all

image.png.ebd367c042487325cb6be0633b0dfc93.pngimage.png.d513c5ec33caf6118a352adf30b9d301.png

 

You're not skipping something: there is no affinity as of now. But we are keen to improve this so please do create suggestions in the link fiki sent: https://github.com/fiki574/Skylords-Reborn-API-UI/issues

Link to post
Share on other sites

Playing around with the API and QlikView and it works pretty nice.

But I was wondering if a “User Based” API is possible or planned?
So you can request Statistics from a User:
- Get which maps have been played
- Current card collection
- Etc.

Of cures not for all users. Just for yourself with maybe an API Key form the Forum Page.

Would be nice to make a Completionist – Dashboard.
-> You are missing this card, this map and this Upgrades + this Charge upgrades.

Also would be fun to connect your current collection with the current (or historical) AH price to see how much it is worth.
 

Link to post
Share on other sites
17 hours ago, T1421 said:

Playing around with the API and QlikView and it works pretty nice.

But I was wondering if a “User Based” API is possible or planned?
So you can request Statistics from a User:
- Get which maps have been played
- Current card collection
- Etc.

Of cures not for all users. Just for yourself with maybe an API Key form the Forum Page.

Would be nice to make a Completionist – Dashboard.
-> You are missing this card, this map and this Upgrades + this Charge upgrades.

Also would be fun to connect your current collection with the current (or historical) AH price to see how much it is worth.
 

Glad you like it. All suggestions are welcome here: https://github.com/fiki574/Skylords-Reborn-API-UI/issues

7 hours ago, Angel said:

Is there anyway to get data when an item is actually bought/sold on the AH? Or are we limited to just the listings (the information we would normally be able to obtain via the game client)?

Just the live listings.

Link to post
Share on other sites
On 12/18/2020 at 12:11 PM, Maze said:

This is so amazing. :D Thank you all so much for allowing the community to be even more involved in the amazing work you all have done.

With this I can finally expand my project and create the site that I envisioned. Again, thanks so much! :)
 

 

 

Wow nice jo

 

On 12/15/2020 at 6:13 PM, fiki574 said:

Hello everyone.

I'll keep it short. Past few months, I've been working on our web API that is completely public and available for everyone to use. I've also created simple, functional (but stylistically not very pretty) user interfaces that visualize and consume the said API.

User interface applications are open-sourced on my GitHub. The repository also contains complete instructions on how to consume the API yourselves, if you were to decide to create your own frontend applications. But, you have to be somewhat profficient in web development to understand and begin doing stuff on your own. 

Issues tab is to be used freely for any and all suggestions and bug reports.

Pull Requests that improve and extend the existing UIs are more than welcome. After manual review, they might get merged into the master branch and appear as a part of the next website update. 

Links:

All applications are caching data periodically, so you're actually "querying" the in-memory data, and not the database directly, which does not have any kind of impact on the game servers and database itself. Have in mind these applications are also the first version, they will definetly get improved and extended, as well as the API.

For some of you, these applications and the API open up whole lot of possibilities.

For example, now you could create an application that tracks the average price of every card and makes a nice graph. You could even extend the search options with card orbs, expansion, rarity, etc. 

Or you could create an application that tracks all auctions for a specific card and sends you a mail or push notification when a card appears on the auction house, but is equal or below the specified price.

Average concurrent players/matches graph could be visualized by querying the Statistics API every 2/5/X minutes.

Those of you who understood everything said and know what you're doing, will use this to its maximum potential.

Have fun! :)

Awesome!

Link to post
Share on other sites
1 hour ago, anonyme0273 said:

Will you be implementing a token authentication for auctions, perhaps for a future mobile app on which to follow and do trades efficiently an on the go?

 

Never, unfortunately.

Explained somewhere that it opens up too much boting possibilities.

1 hour ago, dreaddy said:

hmm... so many possibilities ;). I think i'll play around a bit with it.

Do you have a list of all current cardids/names and maybe images of all cards?
My backup of bf programming stuff from 10 years ago is not as good as I hoped ;).

Yea, have a list but without images.

https://auctions.backend.skylords.eu/api/cards/all

Link to post
Share on other sites

I've found some inconsistencies in the API signature...

This endpoint https://github.com/fiki574/Skylords-Reborn-API-UI/tree/master/Auctions#post-apiauctionspagenumber  is a POST and it should be a GET because you are retrieveing information and is the auction state do not change it should be idemponent.

  • Why is a POST?

Also... 

  • This API is opensource or restitrcted to verfied developers?

Also I've found many other errors that would like to discuss or at least notify, but this post wolud be too long and boring ^.^'

Link to post
Share on other sites
On 12/24/2020 at 12:49 AM, ZeraZerg said:

I've found some inconsistencies in the API signature...

This endpoint https://github.com/fiki574/Skylords-Reborn-API-UI/tree/master/Auctions#post-apiauctionspagenumber  is a POST and it should be a GET because you are retrieveing information and is the auction state do not change it should be idemponent.

  • Why is a POST?

Also... 

  • This API is opensource or restitrcted to verfied developers?

Also I've found many other errors that would like to discuss or at least notify, but this post wolud be too long and boring ^.^'

It is not recommended and in most cases not supported to have a request body in a GET request. Since you are sending a JSON to that endpoint, it should use POST. This is basics of web development and semantics.

Frontend applications and API specifications are open-sourced, backend is not.

I highly doubt you found many other errors cause I have no problems running any of the applications, be it frontend or backend, locally or on a VPS. You might have found some misstypes or inconsistencies, but I hardly doubt you found errors per se. All reports and suggestions are welcome here: https://github.com/fiki574/Skylords-Reborn-API-UI/issues

Link to post
Share on other sites

 

Quote

Frontend applications and API specifications are open-sourced, backend is not.

What do you mean? :thinking:

 

Quote

It is not recommended and in most cases not supported to have a request body in a GET request. Since you are sending a JSON to that endpoint, it should use POST. This is basics of web development and semantics.

Yes I know, that but the point is that the resource POST /api/auctions/:page/:number with the body could be simply converted as query parameters this way:

  • /api/auctions/:page/:number ==> /api/auctions?page=1&resultsPerPage=1
    • Reason: the resource you are waintg to retrieve is "auctions", not the "number"
    • Also change "number" to "resultsPerPage", which is more clear as user. Can set a defalut number of "30" or just make it mandatory.
    • You can make "page" it mandatory giving a 4XX error and feedback.
  • input ==> cardName. Query param also

    • Reason: More semantical name, excep for technical limitations no extra info is required, the names gives all the meta info needed

    • Optional

  • min ==> minBfpPrice. Query param also

    • Reason: More semantical name, excep for technical limitations no extra info is required, the names gives all the meta info needed

    • Optional

  • max ==> maxBfpPrice. Query param also

    • Reason: More semantical name, excep for technical limitations no extra info is required, the names gives all the meta info needed

    • Optional

Having this all together the
"POST /api/auctions/:page/:number" + "Body" can be a simple 

"GET /api/auctions?page=1&resultsPerPage=1&cardName=Master Archers&minBfpPrice=12&maxBfpPrice=30000" and no Body is required

 

This being told, I don't want to make enemies but to give feedback as person that wants to use this and finds it usable, but not mostly correct. I find this approach clearer and easily expandable wityh more filters in the future if it's required.

If it's a problem of change it, give me access to a feature branch and I gladly will make the changes and send de merge request (logically the final decison will be yours to apply it) :)

Quote

I highly doubt you found many other errors cause I have no problems running any of the applications, be it frontend or backend, locally or on a VPS. You might have found some misstypes or inconsistencies, but I hardly doubt you found errors per se. All reports and suggestions are welcome here: https://github.com/fiki574/Skylords-Reborn-API-UI/issues

I'll post the same on the issues page from github, I just wanted to give a more direct developer-friendly response.

 

Thank you for your hard work,

fellow Skylord.

Edited by ZeraZerg
fiki574 likes this
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use