steamgriddb_api

Crates.iosteamgriddb_api
lib.rssteamgriddb_api
version0.3.1
sourcesrc
created_at2021-08-27 16:23:02.549651
updated_at2022-06-10 17:26:20.358674
descriptionRust client for steamgriddb.com API
homepage
repositoryhttps://github.com/PhilipK/steamgriddb_api
max_upload_size
id443152
size111,361
Philip Kristoffersen (PhilipK)

documentation

https://docs.rs/steamgriddb_api/0.1.1/steamgriddb_api/

README

A Rust client for steamgriddb.com

This project is a wrapper for the steamgriddb api, written in Rust.

Getting started

The easiest way to get started is using the Client.

use steamgriddb_api::Client;
use steamgriddb_api::query_parameters::QueryType::Grid;
async fn example() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new("my_auth_key");
    let games = client.search("Celeste").await?;
    let first_game = games.iter().next().ok_or("No games found")?;
    assert_eq!("Celeste", first_game.name);
    let images = client.get_images_for_id(first_game.id, &Grid(None)).await?;
    Ok(())
 }

The client calls the API using the reqwest crate and parses the results using the serde crate.

It is possible to use library without the client, if you want to use a different way of calling the API.

use steamgriddb_api::images::*;
use steamgriddb_api::query_parameters::*;
let url = get_images_by_platform_ids_url("https://www.steamgriddb.com/api/v2", &Platform::Steam, &["107500", "107510"], &QueryType::Grid(None));

Use an Auth Key

In the examples above the client is given a "my_auth_key", you need to substitute this string with your own key. You can get a key here: https://www.steamgriddb.com/profile/preferences/api

Progress

This crate currently only supports getting data from the steamgriddb api. Uploading will come in a later version.

Commit count: 42

cargo fmt