5 unstable releases

0.3.1 Jun 10, 2022
0.3.0 May 12, 2022
0.2.1 May 12, 2022
0.2.0 Sep 15, 2021
0.1.3 Aug 27, 2021

#1199 in Web programming

Download history 3/week @ 2024-01-05 3/week @ 2024-01-12 6/week @ 2024-02-02 17/week @ 2024-02-09 34/week @ 2024-02-16 32/week @ 2024-02-23 19/week @ 2024-03-01 19/week @ 2024-03-08 24/week @ 2024-03-15 5/week @ 2024-03-22 58/week @ 2024-03-29

108 downloads per month

MIT/Apache

66KB
1.5K SLoC

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.

Dependencies

~4–17MB
~256K SLoC