-
Notifications
You must be signed in to change notification settings - Fork 43
1. Getting Started
Justin Skiles edited this page Apr 17, 2020
·
6 revisions
Package Manager:
Install-Package SteamWebAPI2
.NET Core CLI:
dotnet add package SteamWebAPI2
- 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>);
- Use the
CreateSteamWebInterface
method to generate an interface. -
T
determines the type of interface you want to create. - List of all interfaces in the Valve Steam Web API
- List of supported interfaces in this library
webInterfaceFactory.CreateSteamWebInterface<T>();
Example to get a player profile summary:
var steamUserInterface = webInterfaceFactory.CreateSteamWebInterface<SteamUser>();
var playerSummaryResponse = await steamInterface.GetPlayerSummaryAsync(<steamIdHere>);
var playerSummaryData = playerSummaryResponse.Data;