Lord NullPointer Posted August 26, 2016 Share Posted August 26, 2016 CardBase API For those interested in making applications with BattleForge data, we expose the CardBase API. Note that we are still expanding the CardBase in functionality, so it could be that your application becomes useless in the future.. Just sayin~ This API provides data about Cards and Maps in json format. On this page I will give you the endpoints and required data to make use of this API. Each Response from this API returns the data inside a wrapper APIWrap<T> which looks like this: public class APIWrap<T> //T = Return Type of API Call { public ExceptionData Exception { get; set; } public T Result { get; set; } public bool Success { get; set; } } public class ExceptionData { public int Code { get; set; } public string Name { get; set; } public string Details { get; set; } } EndPoints For Cards EndPoint: http://cardbase.skylords.eu/Cards/GetCards ResultSet: Response of this call is a List<Card>, where Card is the following class: public class Card { public string Name { get; set; } public Rarity Rarity { get; set; } public int Cost { get; set; } public Edition Edition { get; set; } public CardType Type { get; set; } public Color Color { get; set; } public Affinity Affinity { get; set; } public bool IsRanged { get; set; } public int Defense { get; set; } public int Offense { get; set; } public DefenseType DefenseType { get; set; } public OffenseType OffenseType { get; set; } public int UnitCount { get; set; } public int ChargeCount { get; set; } public string Category { get; set; } public List<Ability> Abilities { get; set; } = new List<Ability>(); public List<Upgrade> Upgrades { get; set; } = new List<Upgrade>(); public OrbInfo OrbInfo { get; set; } public string Extra { get; set; } public Media Image { get; set; } } Essentially parameters for this call is ?[Property1]=[Value]&[Property2]=[Value], if the property is a string it will check if given value is inside property value. Example: http://cardbase.skylords.eu/Cards/GetCards?Name=Dread will return all cards with "Dread" in their name. Note that some properties have integers as values, some of these properties represent enums. Property Enums: public enum Rarity { Common = 0, Uncommon = 1, Rare = 2, UltraRare = 3 } public enum Edition { Twilight = 1, Renegade = 2, LostSouls = 4, Amii = 8 } public enum CardType { Spell = 0 Creature = 2, Building = 3, } public enum OffenseType { Small = 0, Medium = 1, Large = 2, XL = 3, Special = 4 } public enum DefenseType { Small = 0, Medium = 1, Large = 2, XL = 3, Building = 4 } public enum AbilityType { Attack = 0, Passive = 1, Activated = 2, Interval = 3, Cast = 4 } public enum Difficulty { Standard = 0, Advanced = 1, Expert = 2 } For Maps EndPoint: http://cardbase.skylords.eu/Maps/GetMaps ResultSet: Response of this call is a List<Map>, where Map is the following class: public class Map { public string Name { get; set; } public string SubTitle { get; set; } public string Campaign { get; set; } public int Players { get; set; } public Edition Edition { get; set; } public string Description { get; set; } public List<string> Goals { get; set; } public List<string> Unlocks { get; set; } public List<string> Prerequisite { get; set; } public Media Image { get; set; } public Media Map { get; set; } public List<string> Difficulties { get; set; } = new List<string>(); public YoutubeVideo WalkThrough { get; set; } public List<Loot> Standard { get; set; } public List<Loot> Advanced { get; set; } public List<Loot> Expert { get; set; } public class Loot { public string CardName { get; set; } public int Era { get; set; } } } Essentially parameters for this call is ?[Property1]=[Value]&[Property2]=[Value], if the property is a string it will check if given value is inside property value. Example: http://cardbase.skylords.eu/Maps/GetMaps?Name=Soul will return all maps with "Soul" in their name. Note that some properties have integers as values, some of these properties represent enums. Property Enums: public enum Edition { Twilight = 1, Renegade = 2, LostSouls = 4, Amii = 8 } Infinitesimal likes this Link to comment Share on other sites More sharing options...
Dallarian Posted August 26, 2016 Share Posted August 26, 2016 1 hour ago, Lord NullPointer said: Example: http://cardbase.bfreborn.com/Maps/GetMaps?Name=Soul will return all maps with "Soul" in their name. @Lord NullPointer After click that i went here. http://cardbase.bfreborn.com/Cards/GetCards?Name=Dread Link to comment Share on other sites More sharing options...
Lord NullPointer Posted August 26, 2016 Author Share Posted August 26, 2016 Just now, Dallarian said: @Lord NullPointer After click that i went here. http://cardbase.bfreborn.com/Cards/GetCards?Name=Dread Lol, seems it didnt fix the href, Ill update Link to comment Share on other sites More sharing options...
anonyme0273 Posted August 27, 2016 Share Posted August 27, 2016 Not that I would understand it all, but I enjoy reading it and trying to get something out of it. Link to comment Share on other sites More sharing options...
Fotti Posted October 24, 2016 Share Posted October 24, 2016 Its a nice API for some useful tools. I may try to make something out of it. Maybe a deckbuilder where you can share your saved decks. If someone has any ideas - you can share those Link to comment Share on other sites More sharing options...
Avire Posted November 11, 2016 Share Posted November 11, 2016 (edited) nice api. definitly useful Edited November 25, 2016 by Avire Link to comment Share on other sites More sharing options...
Mynoduesp Posted September 9, 2020 Share Posted September 9, 2020 (edited) Is this API still supported/up to date? @Zyna @Ladadoos (sry for taging) Edited September 10, 2020 by Mynoduesp Link to comment Share on other sites More sharing options...
Ladadoos Posted September 10, 2020 Share Posted September 10, 2020 (edited) 17 hours ago, Mynoduesp said: Is this API still supported/up to date? @Zyna @Ladadoos (sry for taging) The API still works, although is not update with any changes we have done (which aren't many regardless, since none of the balance changes for example are live yet). That being said, I believe only the Cards work correctly. We might in the future update this and the cardbase too. Edited September 10, 2020 by Ladadoos Link to comment Share on other sites More sharing options...
Kubik Posted September 10, 2020 Share Posted September 10, 2020 so it is official API and we are supposed to report bugs on it? Link to comment Share on other sites More sharing options...
Mynoduesp Posted September 10, 2020 Share Posted September 10, 2020 So the official cardlist on https://allcards.skylords.eu/ isn't up to date...? That's a bummer, but alright, I wont play with it before release then. Would be nice to have an API after launch though. :^) Link to comment Share on other sites More sharing options...
Zyna Posted September 10, 2020 Share Posted September 10, 2020 4 minutes ago, Mynoduesp said: So the official cardlist on https://allcards.skylords.eu/ isn't up to date...? That's a bummer, but alright, I wont play with it before release then. Would be nice to have an API after launch though. :^) Yeah unfortunately it isn't completely up to date. I'll export more accurate card data from the game database once I get the time, but we don't plan on changing the API format. So you could start using the API for your application Link to comment Share on other sites More sharing options...
Mynoduesp Posted September 10, 2020 Share Posted September 10, 2020 30 minutes ago, Zyna said: Yeah unfortunately it isn't completely up to date. I'll export more accurate card data from the game database once I get the time, but we don't plan on changing the API format. So you could start using the API for your application I'm not very familiar with APIs and the information I was hoping to find in the there isn't part of the API either (CardIDs and more importantly AbilityIDs). So I won't use it any time soon anyways. That said, an up to date API is still a nice feature to have. Deckbuilding and such still work with not quite up to date data I know. I'm curious what the future brings though, maybe you'll implement a deck import/export feature to Skylords reborn as a QoL feature, things like that would cause trouble if not maintained. :^) Link to comment Share on other sites More sharing options...
LEBOVIN Posted September 10, 2020 Share Posted September 10, 2020 Perhaps if such a deck import feature would be added, the wiki might be able to also generate the code for u to store it/create decks rdy to be imported. Likely requires a wiki account tho. Link to comment Share on other sites More sharing options...
Mynoduesp Posted September 10, 2020 Share Posted September 10, 2020 1 hour ago, LEBOVIN said: Perhaps if such a deck import feature would be added, the wiki might be able to also generate the code for u to store it/create decks rdy to be imported. Likely requires a wiki account tho. Maybe, but since https://allcards.skylords.eu/ already has a deck building feature I'd start there Link to comment Share on other sites More sharing options...
Ladadoos Posted September 10, 2020 Share Posted September 10, 2020 3 hours ago, Mynoduesp said: I'm curious what the future brings though, maybe you'll implement a deck import/export feature to Skylords reborn as a QoL feature, things like that would cause trouble if not maintained. :^) I actually started working on a feature like this years ago, but looks like I never finished it. And probably won't anytime soon considering the more pressing features there are to add and bugs to fix. Mynoduesp likes this Link to comment Share on other sites More sharing options...
LEBOVIN Posted September 10, 2020 Share Posted September 10, 2020 1 hour ago, Mynoduesp said: Maybe, but since https://allcards.skylords.eu/ already has a deck building feature I'd start there Well ^^ check ur wiki profile Link to comment Share on other sites More sharing options...
Mynoduesp Posted September 10, 2020 Share Posted September 10, 2020 2 hours ago, LEBOVIN said: Well ^^ check ur wiki profile yikes XD Link to comment Share on other sites More sharing options...
Crypto5842 Posted January 21, 2021 Share Posted January 21, 2021 Hi I'm working on an Discordbot which should display the cards as MessageEmbed in my Discord Server. The Problem is that the API Image Response is not an PNG or JPG Image, if you post this link in Discord for example: https://cardbase.skylords.eu/lrms/GetMediaData?id=5f3324a2c6ee954ccfe9bdc8 you will not get an Image displayed. Is it possible that you could provide the images in PNG Format? Thanks. Link to comment Share on other sites More sharing options...
RaiNote Posted January 21, 2021 Share Posted January 21, 2021 8 minutes ago, Crypto5842 said: Hi I'm working on an Discordbot which should display the cards as MessageEmbed in my Discord Server. The Problem is that the API Image Response is not an PNG or JPG Image, if you post this link in Discord for example: https://cardbase.skylords.eu/lrms/GetMediaData?id=5f3324a2c6ee954ccfe9bdc8 you will not get an Image displayed. Is it possible that you could provide the images in PNG Format? Thanks. The issue you are facing isn't because it's not PNG, as in fact it's MIME type is PNG. Your issue ist that first of all those images are cached, thus may not display immediately, to avoid this I'd suggest caching them locally with their IDs and check whether the image already exists in that folder & if not download it and provide it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now