SteamWebAPI2 5.0.0

dotnet add package SteamWebAPI2 --version 5.0.0
                    
NuGet\Install-Package SteamWebAPI2 -Version 5.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SteamWebAPI2" Version="5.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SteamWebAPI2" Version="5.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SteamWebAPI2" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SteamWebAPI2 --version 5.0.0
                    
#r "nuget: SteamWebAPI2, 5.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SteamWebAPI2@5.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SteamWebAPI2&version=5.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SteamWebAPI2&version=5.0.0
                    
Install as a Cake Tool

SteamWebAPI2

Build Status NuGet MyGet CI

This is a .NET library that makes it easy to use the Steam Web API. It conveniently wraps around all of the JSON data and ugly API details with clean methods, structures and classes.

Please refer here for details regarding the Steam Web API, its endpoints, and how this library consumes them.

Check this README and the Wiki for more details about getting started and common use cases.

About this Library

This library was created to address the (at times) awful nature of the Steam Web API. Many of the exposed endpoints have little to no documentation on the parameters and absolutely no documentation on any of the responses. In addition, many of the endpoints do not follow any type of coding convention as it appears that different developers created different endpoints without collaborating with one another.

For example, some responses have a containing "response" object while others have a containing "result" object. To make it worse, some have a containing "results" or "responses" or "applist" or "playerstats" object or a number of other unconventional choices.

Instead of stressing about parsing the ugly JSON responses yourself, just use this library to make a method call and get back a response with everything in a more C#/.NET style. These are the rules on which the library was built:

  • Make the library as easy and user friendly as possible.
  • Document everything as thoroughly as possible.
  • Standardize all property names on returned JSON objects.
  • Deserialize UNIX TimeStamps to DateTime.
  • Deserialize "types" into enum where possible.
  • Clean up some of the more egregious JSON responses where JSON arrays should have been used but weren't.
  • Offer a sane way of handling the various representations and conversions of Steam ID by offering a SteamId class.
    • Handles legacy, modern, and 64-bit Steam Id representations

NOTE: Valve's Steamworks documentation doesn't do a good job at explaining the difference between their public API and partner API. This library only works with the public-facing API located at: api.steampowered.com. Any endpoints from their documentation that are located at the partner.steam-api.com will not be accessible with this library. I am not a registered publisher and thus don't have access to any of the partner endpoints.

Install the Library from NuGet

See the library in the NuGet gallery here.

Package Manager:

Install-Package SteamWebAPI2 

.NET Core CLI:

dotnet add package SteamWebAPI2

How to Use the Library

  1. Read the About section so you understand why this library exists
  2. Install the library from NuGet
  3. Get a Steam Web API developer key. Get one here. KEEP THIS SECRET.
  4. Instantiate a SteamWebInterfaceFactory to use as a helper to create objects for various endpoint calls.
  5. Use the factory to create endpoint interface classes.
  6. Use the interface class and call a method with your parameters.

The library is structured to mirror the Steam Web API endpoint structure. For example, the "DOTA2Econ" class will expose methods to communicate with the "IDOTA2Econ" endpoints. See here for more endpoint details.

Each method returns a SteamWebResponse object which contains the following:

Field Type Description
Data T Maps to the payload returned by the Steam Web API.
ContentLength long? Maps to the HTTP ContentLength header.
ContentType string Maps to the HTTP ContentType header.
ContentTypeCharSet string Maps to the HTTP ContentType charset header.
Expires DateTimeOffset? Maps to the HTTP Expires header. Optional.
LastModified DateTimeOffset? Maps to the HTTP LastModified header. Optional

Sample Usage

// factory to be used to generate various web interfaces
var webInterfaceFactory = new SteamWebInterfaceFactory(<dev api key here>);

// this will map to the ISteamUser endpoint
// note that you have full control over HttpClient lifecycle here
var steamInterface = webInterfaceFactory.CreateSteamWebInterface<SteamUser>(new HttpClient());

// this will map to ISteamUser/GetPlayerSummaries method in the Steam Web API
// see PlayerSummaryResultContainer.cs for response documentation
var playerSummaryResponse = await steamInterface.GetPlayerSummaryAsync(<steamIdHere>);
var playerSummaryData = playerSummaryResponse.Data;
var playerSummaryLastModified = playerSummaryResponse.LastModified;

// this will map to ISteamUser/GetFriendsListAsync method in the Steam Web API
// see FriendListResultContainer.cs for response documentation
var friendsListResponse = await steamInterface.GetFriendsListAsync(<steamIdHere>);
var friendsList = friendsListResponse.Data;
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on SteamWebAPI2:

Package Downloads
SourceSchemaParser

Parses Valve Source Engine game schema files into easy to use object oriented structures.

GameCollector.StoreHandlers.Steam

Library for finding games owned and installed with Steam.

Nami

Package Description

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on SteamWebAPI2:

Repository Stars
LANCommander/LANCommander
sp0ok3r/Mercury
Mercury is a powerful tool for Steam users built on SteamKit2, offering advanced features for managing accounts, chats, and interactions.
Version Downloads Last Updated
5.0.0 893 11/12/2025
4.4.1 53,774 4/12/2023
4.4.0 14,298 8/6/2022
4.3.2 15,250 11/20/2021
4.3.1 7,090 7/28/2021
4.3.0 4,250 3/1/2021
4.2.7 4,177 1/4/2021
4.2.6 5,690 10/14/2020
4.2.5 7,711 7/13/2020
4.2.4 1,997 5/27/2020
4.2.3 1,709 5/6/2020
4.2.2 1,247 5/6/2020
4.2.1 1,296 5/1/2020
4.2.0 2,968 5/1/2020
4.1.5 1,260 4/28/2020
4.1.4 1,247 4/27/2020
4.1.3 1,446 4/27/2020
4.1.2 1,273 4/24/2020
4.1.1 2,563 3/26/2020
4.1.0 1,460 3/7/2020
4.0.16 1,598 2/24/2020
4.0.15 1,853 2/21/2020
4.0.14 13,091 12/18/2019
4.0.13 1,279 12/18/2019
4.0.12 2,132 11/22/2019
4.0.9 1,629 8/12/2019
4.0.8 7,377 3/3/2018
4.0.7 2,119 1/27/2018
4.0.6 2,171 1/17/2018
4.0.5 1,995 11/9/2017
4.0.4 1,877 11/4/2017
4.0.2 2,071 8/26/2017
4.0.1 2,176 5/5/2017
4.0.0 2,164 2/3/2017
3.1.0.4 1,966 2/2/2017
3.1.0 1,920 2/2/2017
3.0.0.49 1,921 2/2/2017
3.0.0.47 1,895 1/31/2017
3.0.0.46 1,914 1/31/2017
2.0.0.44 1,983 1/17/2017
2.0.0.43 1,937 1/15/2017
2.0.0.41 1,929 1/15/2017
2.0.0.39 1,955 1/14/2017
2.0.0.36 1,935 12/23/2016
2.0.0.35 1,958 12/19/2016
2.0.0.34 1,897 12/14/2016
2.0.0.33 1,931 11/26/2016
2.0.0.32 1,902 11/26/2016
2.0.0.31 1,907 11/26/2016
2.0.0.30 2,300 8/19/2016
2.0.0.29 1,912 8/19/2016
2.0.0.27 1,966 8/18/2016
2.0.0.26 2,154 7/29/2016
2.0.0.25 2,248 7/29/2016
2.0.0.23 2,335 7/27/2016
2.0.0.22 2,252 7/27/2016
2.0.0.19 1,995 7/24/2016
2.0.0.18 1,911 7/17/2016
2.0.0.17 1,978 5/25/2016
2.0.0.15 2,064 4/16/2016
2.0.0.14 2,000 3/22/2016
2.0.0.11 2,094 3/21/2016
2.0.0.10 1,925 3/15/2016
2.0.0.8 1,942 3/15/2016
2.0.0.7 1,927 3/15/2016
2.0.0.6 1,960 3/14/2016
2.0.0.5 1,990 3/13/2016
2.0.0.4 1,967 2/18/2016
2.0.0.1 1,953 2/17/2016
2.0.0 1,958 2/17/2016
1.2.0.37 2,003 2/17/2016
1.2.0.36 1,946 2/17/2016
1.2.0.35 1,925 2/17/2016
1.2.0.33 2,019 2/14/2016
1.2.0.31 2,250 2/14/2016
1.1.0.29 2,024 2/12/2016
1.1.0.28 1,987 2/10/2016
1.1.0.27 2,013 2/10/2016
1.1.0.26 1,964 2/4/2016
1.1.0.25 1,994 2/4/2016
1.1.0.24 1,976 1/26/2016
1.1.0.22 2,039 12/27/2015
1.1.0.21 1,960 12/22/2015
1.1.0.20 1,935 12/19/2015
1.1.0.19 1,946 12/19/2015
1.1.0.18 2,013 12/18/2015
1.1.0.17 2,007 12/16/2015
1.1.0.15 2,221 12/11/2015
1.1.0.14 2,200 12/11/2015
1.1.0.11 1,926 12/11/2015
1.1.0.10 1,950 12/9/2015
1.1.0.8 1,976 12/8/2015
1.1.0.5 2,217 11/28/2015
1.1.0.3 2,018 11/25/2015
1.1.0.2 2,040 11/25/2015
1.1.0 2,035 11/24/2015
1.0.0.4 2,015 11/20/2015
1.0.0.3 2,004 11/20/2015
1.0.0 2,017 11/20/2015