SteamModels 1.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package SteamModels --version 1.1.2
                    
NuGet\Install-Package SteamModels -Version 1.1.2
                    
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="SteamModels" Version="1.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SteamModels" Version="1.1.2" />
                    
Directory.Packages.props
<PackageReference Include="SteamModels" />
                    
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 SteamModels --version 1.1.2
                    
#r "nuget: SteamModels, 1.1.2"
                    
#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 SteamModels@1.1.2
                    
#: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=SteamModels&version=1.1.2
                    
Install as a Cake Addin
#tool nuget:?package=SteamModels&version=1.1.2
                    
Install as a Cake Tool

SteamModels-DotNet

.NET Models for the Steam API. Available on NuGet.

Usage

The Steam API results can be deserialized into the .NET model classes provided by SteamModels.

Example with SteamUser:

public class SteamService
{
    private readonly string _playerDetailsUrl = "http://steamcommunity.com/id/{0}/?xml=1";

    private string _username;

    public SteamUser GetSteamUserDetails(string name)
    {
        HttpClient client = new HttpClient();
        this._username = NormalizeUsername(name);
        var playerDetailsResponse = client.GetStreamAsync(this._username);
        XmlSerializer serializer = new XmlSerializer(typeof(SteamUser));
        SteamUser user = (SteamUser)serializer.Deserialize(playerDetailsResponse.Result);
        return user;
    }

    public string NormalizeUsername(string name)
    {
        return name.Contains("http://") ? name : string.Format(_playerDetailsUrl, name);
    }
}

Example with SteamNews:

public class SteamService
{
    private readonly string _steamAppNewsUrl = "http://api.steampowered.com/ISteamNews/GetNewsForApp/v0002/?appid={0}&maxlength=300&format=json";

    public async Task<SteamNews> GetSteamAppNewsJSON(int appid)
    {
	HttpClient client = new HttpClient();
	var steamnews = await client.GetStringAsync(string.format(this._steamAppNewsUrl, appid));
	SteamNews news = JsonConvert.DeserializeObject<SteamNews>(steamnews);
	return news;
    }
}
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.0.1 263 6/26/2025
9.0.0 247 2/6/2025
8.0.0 6,640 12/1/2023
7.0.0 535 11/28/2022
6.0.0 581 11/11/2021
5.0.3 556 10/5/2021
1.3.1 656 11/5/2020
1.3.0 626 11/5/2020
1.2.3 912 10/14/2019
1.2.2 914 3/11/2019
1.2.1 1,084 9/19/2018
1.2.0 1,042 8/30/2018
1.1.3 1,032 8/24/2018
1.1.2 1,080 8/10/2018
1.1.1 1,122 8/9/2018
1.1.0 1,630 5/2/2017
1.0.1 1,862 4/18/2017
1.0.0 1,498 4/7/2017

Adding SteamNews model. Changing the namespace of CSGO specific models to SteamModels.CSGO. Adding accuracy to the CSGOPlayerStats.