Wish to contribute to the project by donating? Heads up to our Patreon -> https://www.patreon.com/skylordsreborn

Jump to content
BEWARE: Multiaccounting Will Cause Permabans! Read more... ×
Sign in to follow this  
Lord NullPointer

CardBase API

Recommended Posts

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

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

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.