#api-key #steam #workshop #steam-api #web-api #api-bindings #steam-workshop

steam-workshop-api

Provides an API wrapper for the steam workshop interfaces (IPublishedFileService and ISteamRemoteStorage) with the addition of proxy and api key support

10 unstable releases (4 breaking)

0.6.0 Aug 1, 2024
0.5.0 Jul 30, 2024
0.4.1 Jul 27, 2024
0.3.0 Jul 5, 2023
0.2.5 Jun 7, 2021

#992 in Web programming

Download history 26/week @ 2024-09-13 3/week @ 2024-09-20 31/week @ 2024-09-27 5/week @ 2024-10-04

587 downloads per month

MIT license

19KB
349 lines

rs-steam-workshop-api

A rust api library for the steam web workshop api

Basic Usage

use steam_workshop_api::Workshop;

let mut workshop = Workshop::new();
workshop.set_api_key(Some("yourapikey".to_string()));
let fileids = vec!['121221044', '1643520526'];
let details: Vec<WorkshopItem> = match workshop.get_published_file_details(&fileids) {
    Ok(details) => details,
    Err(err) => { 
        eprintln!("Failed to get file info");
    }
};

lib.rs:

steam_workshop_api

This library provides access to the steam web apis. Uses reqwest::blocking under the hood

Getting Started

To access any web api that requires no authentication (file details) you need to create a new instance:

use steam_workshop_api::SteamWorkshop;

let wsclient = SteamWorkshop::new();
wsclient.get_published_file_details(&["fileid1".to_string()]);

Using Authorized Methods

Authorized methods are behind the AuthedWorkshop struct, which can be generated from a Workshop instance:

use steam_workshop_api::SteamWorkshop;

let mut wsclient = SteamWorkshop::new();
wsclient.set_apikey(Some("MY_API_KEY".to_string()));
wsclient.can_subscribe("blah");

Using Proxied Methods

Proxied methods are identical to AuthedWorkshop, except can use a third party server to proxy (and keep the appkey private)

use steam_workshop_api::{SearchOptions, SteamWorkshop};

let mut wsclient = SteamWorkshop::new();
wsclient.set_proxy_domain(Some("steamproxy.example.com".to_string()));
// Does not require .set_apikey, as the proxy will handle it
wsclient.search_items(&SearchOptions {
    query: "blah".to_string(),
    count: 10,
    app_id: 550,
    cursor: None,
    required_tags: None,
    excluded_tags: None,
});

Dependencies

~4–15MB
~194K SLoC