Code Monkey home page Code Monkey logo

steamwebapilib's Introduction

SteamWebApiLib

nuget License AppVeyor branch FOSSA Status

SteamWepApiLib is a .NET wrapper for the Steam API. It provides a set of methods to retrieve various data from the Steam API. Library can interact with Steam Strorefront API and Steam Web API (each API provides a different set of data).

The Steam API is not officially available or documented. So, all data in this library was either collected by trial and error from unofficial API documentation, and is therefore provided as-is.

Installation

Install NuGet package.

Usage examples

using System;
using System.Threading.Tasks;
using SteamWebApiLib;
using SteamWebApiLib.Models.AppDetails;
using SteamWebApiLib.Models.BriefInfo;
using SteamWebApiLib.Models.Featured;
using SteamWebApiLib.Models.FeaturedCategories;
using SteamWebApiLib.Models.PackageDetails;

private static async Task Examples()
{
    var steamApiClient = new SteamApiClient();

    // Get full list of SteamApps.
    SteamAppBriefInfoList steamAppList = await steamApiClient.GetAppListAsync();
    Console.WriteLine($"Got {steamAppList.Apps.Length.ToString()} items.");

    // Get details for SteamApp with ID 292030 (The Witcher 3: Wild Hunt).
    SteamApp steamApp1 = await steamApiClient.GetSteamAppAsync(292030);
    Console.WriteLine($"Got response for {steamApp1.Name}.");

    // Get details for SteamApp with same ID for region US.
    SteamApp steamApp2 = await steamApiClient.GetSteamAppAsync(292030, CountryCode.USA);
    Console.WriteLine($"Got response for {steamApp2.Name}.");

    // Get details for Package with ID 68179 (Don't Starve Together).
    PackageInfo package1 = await steamApiClient.GetPackageInfoAsync(68179);
    Console.WriteLine($"Got response for {package1.Name}.");

    // Get details for Package with same ID for region JP.
    PackageInfo package2 = await steamApiClient.GetPackageInfoAsync(68179, CountryCode.Japan);
    Console.WriteLine($"Got response for {package2.Name}.");

    // Get a list of featured games.
    FeaturedApps featured1 = await steamApiClient.GetFeaturedAppsAsync();
    Console.WriteLine($"Got {featured1.FeaturedWin.Length.ToString()} items for Windows.");

    // Get a list of featured games for region DE.
    FeaturedApps featured2 = await steamApiClient.GetFeaturedAppsAsync(CountryCode.Germany);
    Console.WriteLine($"Got {featured2.FeaturedWin.Length.ToString()} items for Windows.");

    // Get a list of featured games grouped by category.
    FeaturedCategories featuredCategories1 = await steamApiClient.GetFeaturedCategoriesAsync();
    Console.WriteLine($"Got {featuredCategories1.TopSellers.Items.Length.ToString()} top sellers items.");

    // Get a list of featured games grouped by category for region US.
    FeaturedCategories featuredCategories2 = await steamApiClient.GetFeaturedCategoriesAsync(CountryCode.USA);
    Console.WriteLine($"Got {featuredCategories2.TopSellers.Items.Length.ToString()} top sellers items.");
}

Dependencies

Target .NET Standard 2.0 and version of C# is 7.1. Project uses further dependencies:

  • Newtonsoft.Json v12.0.2;
  • Polly v7.1.0.

You can install dependencies using NuGet package manager. Also all dependensies and this project have NuGet packages.

Additional info

As a basis for project were taken SteamStorefrontAPI and Narochno.Steam.

License information

This project is licensed under the terms of the Apache License 2.0.

FOSSA Status

Third party software and libraries used

Copyright © 2007 James Newton-King

License: MIT

steamwebapilib's People

Contributors

fossabot avatar vasar007 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

fossabot

steamwebapilib's Issues

Input string was not in the correct format

Describe the bug
if you're trying to get the info of a package as you have shown it in an example it throws an "Input string was not in the correct format." error in the converters.cs
also happens with FeaturedApps.

So just compiling your example with the GitHub project throws the "error"

Add Steam Server Queries

Is your feature request related to a problem? Please describe.
Need to implement support of Steam Server Queries. It extends features of this lib.

Describe the solution you'd like
Need to research Steam Server Queries UDP protocol. Examples of GitHub libs:

Describe alternatives you've considered
None.

Additional context
Need to write new tests for this feature.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.