This is the C# library using the official Legion TD 2 public API. The API endpoint is https://apiv2.legiontd2.com/
You can generate your key at developer.legiontd2.com
For icons, emotes or splash art images you can use our CDN: cdn.legiontd2.com
The current limits are 15 requests per second / 10k burst requests and a maximum of 10k requests per day. The library naturally implements this limit, but allows you to overwrite this in the constructor for LegionTD2Api
.
If you need a higher limit, reach out to the LegionTD2 team through discord or the support portal.
If you have any other questions, feel free to ask in the #api channel on the Legion TD 2 Contributors Discord
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration.Default.BasePath = "https://apiv2.legiontd2.com";
var apiInstance = new DefaultApi(Configuration.Default);
var id = "id_example"; // string | ID (optional)
var name = "name_example"; // string | Name (optional)
var version = "version_example"; // string | Version (optional)
var offset = "offset_example"; // string | Offset (optional)
var limit = "limit_example"; // string | Limit (optional)
try
{
apiInstance.PreflightCheck(id, name, version, offset, limit);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.PreflightCheck: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
All URIs are relative to https://apiv2.legiontd2.com
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | PreflightCheck | OPTIONS /players/byId/{id} | |
DefaultApi | PreflightCheck_0 | OPTIONS /players/byName/{name} | |
DefaultApi | PreflightCheck_1 | OPTIONS /players/bestFriends/{id} | |
DefaultApi | PreflightCheck_10 | OPTIONS /info/legions/{offset}/{limit} | |
DefaultApi | PreflightCheck_11 | OPTIONS /info/waves/byId/{id} | |
DefaultApi | PreflightCheck_12 | OPTIONS /info/waves/{offset}/{limit} | |
DefaultApi | PreflightCheck_13 | OPTIONS /info/spells/byId/{id} | |
DefaultApi | PreflightCheck_14 | OPTIONS /info/spells/{offset}/{limit} | |
DefaultApi | PreflightCheck_15 | OPTIONS /info/abilities/byId/{id} | |
DefaultApi | PreflightCheck_16 | OPTIONS /info/abilities/{offset}/{limit} | |
DefaultApi | PreflightCheck_17 | OPTIONS /info/research/byId/{id} | |
DefaultApi | PreflightCheck_18 | OPTIONS /info/research/{offset}/{limit} | |
DefaultApi | PreflightCheck_19 | OPTIONS /info/descriptions/{id} | |
DefaultApi | PreflightCheck_2 | OPTIONS /players/matchHistory/{id} | |
DefaultApi | PreflightCheck_3 | OPTIONS /players/stats/{id} | |
DefaultApi | PreflightCheck_4 | OPTIONS /players/stats | |
DefaultApi | PreflightCheck_5 | OPTIONS /units/byId/{id} | |
DefaultApi | PreflightCheck_6 | OPTIONS /units/byName/{name} | |
DefaultApi | PreflightCheck_7 | OPTIONS /games | |
DefaultApi | PreflightCheck_8 | OPTIONS /info/legions/byId/{id} | |
DefaultApi | PreflightCheck_9 | OPTIONS /games/byId/{id} | |
DefaultApi | UnitsByVersionVersionOptions | OPTIONS /units/byVersion/{version} | |
GamesApi | GetMatchById | GET /games/byId/{id} | Find match by ID |
GamesApi | GetMatchesByFilter | GET /games | Find match by different filters |
InfoApi | GetAbilities | GET /info/abilities/{offset}/{limit} | Contains information about all abilities |
InfoApi | GetAbilitiesById | GET /info/abilities/byId/{id} | Find an ability by ID |
InfoApi | GetDescriptionById | GET /info/descriptions/{id} | Use this to retrieve a specific description by its ID |
InfoApi | GetLegions | GET /info/legions/{offset}/{limit} | Contains all playable and unplayable legions. |
InfoApi | GetLegionsById | GET /info/legions/byId/{id} | Find a legion by ID |
InfoApi | GetResearches | GET /info/research/{offset}/{limit} | Contains information about all researches (king upgrades, hiring workers, etc.) |
InfoApi | GetResearchesById | GET /info/research/byId/{id} | Find a research (for example king upgrades) by ID |
InfoApi | GetSpells | GET /info/spells/{offset}/{limit} | Contains all enabled or disabled legion spells. |
InfoApi | GetSpellsById | GET /info/spells/byId/{id} | Find a legion spell by ID |
InfoApi | GetWaves | GET /info/waves/{offset}/{limit} | Contains information about all waves |
InfoApi | GetWavesById | GET /info/waves/byId/{id} | Find a wave by ID |
PlayerApi | GetPlayerById | GET /players/byId/{id} | Find player by ID |
PlayerApi | GetPlayerByName | GET /players/byName/{name} | Find player by their nickname |
PlayerApi | GetPlayerFriends | GET /players/bestFriends/{id} | Find other players that had common games with this player |
PlayerApi | GetPlayerHistory | GET /players/matchHistory/{id} | Get most recent matches of this player |
PlayerApi | GetPlayerStats | GET /players/stats/{id} | Get player statistics (wins, losses, etc.) |
PlayerApi | GetSortedPlayerStats | GET /players/stats | Get sorted player statistics (wins, losses, etc.) |
UnitsApi | GetUnitById | GET /units/byId/{id} | Find unit by ID |
UnitsApi | GetUnitByName | GET /units/byName/{name} | Find unit by name |
UnitsApi | GetUnitByVersion | GET /units/byVersion/{version} | Find multiple units by version. Usefull for comparing stats between patches. |