Jump to content

.NET API Library


Recommended Posts

Since I didn't find any .NET implementation regarding the API I've gone ahead and make one myself.

With my limited experience regarding webapis and accessing them etc. the source may look reasonably bad.

Which APIs does it support?

  • Cards API (limited)
  • Map API (not working)
  • Auction API (should work to its full extent)
  • Leaderboards API (untested)
  • Battleforge replay reader

So with that out of the way:

Nuget link

Github repository

Example Usage

Spoiler

private static readonly JsonSerializerSettings Settings = new()
{
    MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
    Formatting = Formatting.Indented,
    DateParseHandling = DateParseHandling.None,
    Converters =
    {
        new StringEnumConverter()
    }
};

static void Main()
{
    var x = Instances.CardService.HandleCardRequest(new List<Tuple<RequestProperty, string>>
    {
        new(RequestProperty.Name, "Gro"),
        new(RequestProperty.Defense, "1100")
    });
    foreach (var card in x)
    {
        Console.WriteLine(JsonConvert.SerializeObject(card, Settings));
    }
}

 

Edited by RaiNote
update 1.0.5 | ReplayReader working
Link to post
Share on other sites
  • RaiNote changed the title to .NET API Library

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