/dota2-api

C# wrapper for the Dota 2 api

Primary LanguageC#

dota2-api

This is a C# wrapper for the Dota 2 api, it's packaged as a net-standard library.

To get this working, you need an API key from valve. Then edit the App.config file in the Test project and you can run the tests.

Supported API methods

  • GetHeroes
  • GetMatchHistory
  • GetMatchDetails
  • GetLeagueListings
  • GetLiveLeagueGames
  • GetTeamInfoById -currently not working
  • GetTournamentPrizePool
  • GetPlayerSummary

Additional methods

These two methods will call the Steam CDN for images and download them.

  • GetHeroPortrait - Will return a byte[] of a .png or .jpg image depending on choices.
  • GetItemIcon - Will return a byte[] of a .png image

Usage

Import the namespace

using Dota2Api

Then use the class!

  using (ApiHandler handler = new ApiHandler("API-KEY-HERE"))
  {
    var matchResult = await handler.GetMatchHistory();
  }

Work left

Some restructuring and renaming might be good

  • Extract HTTP methods from ApiHandler
  • Extract QueryBuilder from ApiHandler
  • Fix GetTeamInfoById or remove it