Skip to content
Youssof Khawaja edited this page Sep 9, 2021 · 6 revisions

Install the Package

Visual Studio Package Manager:

Install-Package SteamWebAPI2

.NET Core CLI:

dotnet add package SteamWebAPI2

Create an Interface Factory

  • Get a Steam Web API key. Don't expose this key to your users.
  • Use that key to create a factory. The factory generates interfaces to communicate with the Steam Web API.
  • This should be a singleton. There's no reason to have multiple factories.

var webInterfaceFactory = new SteamWebInterfaceFactory(<dev api key here>);

Create an Interface

webInterfaceFactory.CreateSteamWebInterface<T>();

Example to get a player profile summary:

var steamUserInterface = webInterfaceFactory.CreateSteamWebInterface<SteamUser>();
var playerSummaryResponse = await steamUserInterface.GetPlayerSummaryAsync(<steamIdHere>);
var playerSummaryData = playerSummaryResponse.Data;