A sync/async client library for communicating with the Pubg developer api. Supporting .Net Standard 2.0.
Contact GavinPower747 on the Pubg Api Discord for more details
From the nuget command line:
nuget install Pubg-DotNet
From the .Net CLI
dotnet add package Pubg-DotNet
From Package Manager:
PM> Install-Package Pubg-DotNet
From within Visual Studio:
- Open the Solution Explorer.
- Right-click on a project within your solution.
- Click on Manage NuGet Packages...
- Click on the Browse tab and search for "Pubg-DotNet".
- Click on the Pubg-DotNet package, select the appropriate version in the right-tab and click Install.
All contributions are welcome, feel free to create an issue to suggest improvements/missing features or just submit a PR to our Development branch with any work you want to contribute yourself.
There are a number of ways to configure your api key. You can choose any of the below methods based on your circumstances, you only need to follow one of the examples below.
- Static Configuration Method
In order to configure your Api Key through our config class you just need to add the following code:
In Your Startup class
PubgApiConfiguration.Configure(opt =>
{
opt.ApiKey = "myApiKey";
});
- Per Request
When making a request to one of our services, all of our request objects contain an ApiKey field, simply provide your api key here. Below we use the GetPubgPlayersRequest as an example
var playerService = new PubgPlayerService();
var request = new GetPubgPlayersRequest
{
ApiKey = "myApiKey",
PlayerNames = new string[] { "myplayername" }
}
playerService.GetPlayers(PubgRegion.PCEurope, request);
Or if the method doesn't need a request object the API key can be provided using an optional parameter at the end of each method call
var playerService = new PubgPlayerService();
playerService.GetPlayer(PubgRegion.PCEurope, "myplayerid", apiKey: "MyApiKey");
- Service Instanciation
When instanciating your service you can supply it with your api key
var matchService = new PubgMatchService("myApiKey");