#api-wrapper #api #riot #wrapper #lol

rusty-blitzcrank

A batterys included library for the Riot API

8 releases

0.2.1 Sep 26, 2023
0.2.0 Apr 5, 2023
0.1.5 Mar 20, 2023
0.1.3 Feb 24, 2023

#1754 in Web programming

Download history 1/week @ 2024-07-06 61/week @ 2024-07-27 56/week @ 2024-09-28

56 downloads per month

MIT license

105KB
3K SLoC


Logo

Rusty Blitzcrank

A batterys included library for the Riot API

Explore the docs »

View Demo . Report Bug . Request Feature

Contributors Stargazers Issues License Build

Table Of Contents

Built With

The entire library is written in Rust.

Getting Started

You can simply use the library installing it with cargo.

Prerequisites

You will need cargo installed

  • cargo

Installation

  1. Get a free API Key at https://developer.riotgames.com/

  2. Install

   cargo add rusty-blitzcrank

Usage

use rusty_blitzcrank::*;
fn main() {
    let mut client = apiclient::new("RGAPI-fffffff-aaaaae-dddd-cccc-1234567890".to_owned());

    let reg = region::Region::from_str("KR").unwrap();
    let summoner = &client.get_summoner_by_name("Hide on Bush", &reg).unwrap();

    let big_reg = region::Region::from_str("ASIA").unwrap();

    let opts = Some(types::GetMatchIdsOpts {
        count: Some(5),
        start_time: None,
        end_time: None,
        queue: None,
        game_type: Some(types::GameType::RANKED),
        start: Some(0),
    });

    let match_ids = client
        .get_match_ids(&summoner.puuid, &big_reg, opts)
        .unwrap();

    let m = client.get_match(&match_ids[0], &big_reg).unwrap();
    dbg!(&m.metadata.participants);

    let timeline = client.get_match_timeline(&match_ids[0], &big_reg).unwrap();

    for frame in timeline.info.frames {
        dbg!(&frame.participant_frames.n1.minions_killed);
    }

    let top_mast = client
        .get_champion_mastery_top(&summoner.id, None, &reg)
        .unwrap();

    dbg!(top_mast);

    let score = client
        .get_champion_mastery_score(&summoner.id, &reg)
        .unwrap();
    dbg!(score);
}

Dependencies

~6–19MB
~270K SLoC