Skip to content

Repository files navigation

SteamWebAPI

A strongly-typed .NET client for the steamwebapi.com Steam Web API. Targets netstandard2.1, uses System.Text.Json, and returns a Result/Result<T> instead of throwing for expected API failures.

Install

Reference the SteamWebAPI project, or pack/reference the built DLL.

Usage

using SteamWebAPI;
using SteamWebAPI.Models.Items;

var client = new SteamWebApiClient("YOUR_API_KEY");

var result = await client.GetItemAsync("AK-47 | Redline (Field-Tested)");

if (result.IsSuccess)
{
    var item = result.Value;
    Console.WriteLine($"{item.MarketHashName}: {item.PriceLatest}");
}
else
{
    Console.WriteLine($"Failed ({result.Error.Type}): {result.Error.Message}");
}

Every method accepts an optional CancellationToken and follows the same Task<Result<T>> pattern. Methods are grouped into partial classes by feature (Items, Info, Currency, Float, Profile, Inventory, Explore, MarketIndex, MarketPrices, Account, SteamGuard, TradeOffers, Proxy).

Dependency injection

using SteamWebAPI.Extensions;

services.AddSteamWebAPI("YOUR_API_KEY");
// or, to configure the underlying HttpClient:
services.AddSteamWebAPI("YOUR_API_KEY", http => http.Timeout = TimeSpan.FromSeconds(30));

Then inject SteamWebApiClient wherever you need it.

Note

This library was mostly generated by AI. Review before relying on it in production.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages