C# wrapper for PUBG stats API provided by https://pubgtracker.com
- The API is maintained and provided by pubgtracker.com and all credits go to them. This project just wraps the API for easy usage in C#.
- The project targets .NET Framework 4.5 and .NET Core 1.1.
- No need to implement throttling yourself, PUBGSharp does this for you.
To add PUBGSharp to your project, run the following command in the NuGet Package Manager Console:
Install-Package PUBGSharp
You can get your API key from here: https://pubgtracker.com/site-api
A very basic example, getting the KDR of the specified player in duo mode, in all regions combined in Early Access Season 1.
var statsClient = new PUBGStatsClient("api-key-here");
var stats = await statsClient.GetPlayerStatsAsync("player-name-here");
try
{
var kdr = stats.Stats.Find(x => x.Mode == Mode.Duo && x.Region == Region.AGG && x.Season == Seasons.EASeason1).Stats.Find(x => x.Stat == Stats.KDR);
Console.WriteLine($"Duo KDR: {kdr.Value}");
}
catch (NullReferenceException)
{
Console.WriteLine($"Could not retrieve stats for {stats.PlayerName}..");
}
For a bit more detailed examples, see the Examples project.