All Projects → babelshift → Steamwebapi2

babelshift / Steamwebapi2

Licence: mit
🎮 C# / .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.

Projects that are alternatives of or similar to Steamwebapi2

Steam Condenser Java
A library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
Stars: ✭ 82 (-48.43%)
Mutual labels:  web-api, steam
InternalSteamWebAPI
Documenting the unofficial and internal Steam Web API
Stars: ✭ 126 (-20.75%)
Mutual labels:  steam, web-api
Steam Condenser Php
A library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
Stars: ✭ 187 (+17.61%)
Mutual labels:  web-api, steam
Steam Condenser Ruby
A library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
Stars: ✭ 95 (-40.25%)
Mutual labels:  web-api, steam
Steamkit
SteamKit2 is a .NET library designed to interoperate with Valve's Steam network. It aims to provide a simple, yet extensible, interface to perform various actions on the network.
Stars: ✭ 1,926 (+1111.32%)
Mutual labels:  steam
Steamcmd Commands List
SteamCMD Commands List
Stars: ✭ 122 (-23.27%)
Mutual labels:  steam
Tmodloader
A mod to make and play Terraria mods. Supports Terraria 1.4 installations - TML itself is 1.3 Terraria currently
Stars: ✭ 2,130 (+1239.62%)
Mutual labels:  steam
Dna.js
🧬 An uncomplicated user interface library for building data-driven semantic templates
Stars: ✭ 114 (-28.3%)
Mutual labels:  json-data
Node Steam Totp
Lightweight module to generate Steam-style TOTP auth codes.
Stars: ✭ 158 (-0.63%)
Mutual labels:  steam
Sourcedemorender
Multithreaded, hardware accelerated solution to create high quality movies for the Source engine.
Stars: ✭ 152 (-4.4%)
Mutual labels:  steam
Remoteplaywhatever
Tiny application that lets you force remote play together any game you have in your steam library including non-steam ones.
Stars: ✭ 138 (-13.21%)
Mutual labels:  steam
Bitlbee Steam
Steam protocol plugin for BitlBee
Stars: ✭ 122 (-23.27%)
Mutual labels:  steam
Csgowinbig
Open-source Counter-Strike: Global Offensive jackpot betting website.
Stars: ✭ 149 (-6.29%)
Mutual labels:  steam
Node Csgo Web Tradebot
Web based CS:GO trade bot. Similar to CSGOSell.
Stars: ✭ 120 (-24.53%)
Mutual labels:  steam
Picodeploy
Deploy Pico-8 Carts as Standalone Applications on Desktop 🖥️(Electron) and Mobile 📱(Ionic) 📦👾
Stars: ✭ 153 (-3.77%)
Mutual labels:  steam
Groq
Specification for GROQ - Graph-Relational Object Queries
Stars: ✭ 117 (-26.42%)
Mutual labels:  json-data
Webapiclientgen
Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
Stars: ✭ 134 (-15.72%)
Mutual labels:  web-api
Cloudrig
Stream your applications with Parsec and AWS on the cheap.
Stars: ✭ 151 (-5.03%)
Mutual labels:  steam
Steamtools
🛠「Steam++」是一个开源跨平台的多功能Steam工具箱。
Stars: ✭ 4,458 (+2703.77%)
Mutual labels:  steam
Proton Caller
Run any Windows program through Proton
Stars: ✭ 130 (-18.24%)
Mutual labels:  steam

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;
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].