igdb_provider

Crates.ioigdb_provider
lib.rsigdb_provider
version0.1.0
sourcesrc
created_at2022-01-25 20:55:03.231891
updated_at2022-01-25 20:55:03.231891
descriptionIGDB API client
homepagehttps://git.sr.ht/~alosarjos/igdb-provider
repositoryhttps://git.sr.ht/~alosarjos/igdb-provider
max_upload_size
id521069
size16,673
José Miguel Sarasola (alosarjos)

documentation

README

IGDB Provider builds.sr.ht status

This crate is intended to fetch data from the IGDB API as deserialized objects.

How to use it

First you will need a Twitch Client ID and Secret. You can get both from https://dev.twitch.tv/ for free.

Once you have them, you create an APIAuth object either passing both variables or by setting them as environment vars (TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET).

Call to the request_token method to get the OAuth data required for the client requests.

Create a Client object and make requests for the supported models. (More queries and options to come on the future)

Example

    let mut auth = APIAuth::new_from_env().unwrap();
    auth.request_token().await.unwrap();

    let client = Client::new(auth);
    let games: Vec<Game> = client.query_by_name("The Witcher 3").await.unwrap();

What is working

You can either request Collections by ID or Games by ID or name.

Note

Items can't be filled recursively to avoid infinite recursion. Reference to another games or content inside a Game or a Collection is offered as the ID of the item and not it's data.

Commit count: 0

cargo fmt