Skip to content
This repository has been archived by the owner on Oct 25, 2019. It is now read-only.
/ dota2_api Public archive

Rust client for the official Dota 2 web API

License

Notifications You must be signed in to change notification settings

sbercx/dota2_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dota2_api

Rust client for the official Dota 2 web API

Currently available requests

  • get_match_details
  • get_match_history
  • get_top_live_games

See documentation for more information: https://docs.rs/dota2_api/

Basic example

extern crate dota2_api;

use dota2_api::Dota2Api;
use dota2_api::models::{SkillLevel, MatchHistoryOptions};


fn main() {
    let mut dota = Dota2Api::new("your key here");

    let options = MatchHistoryOptions {
        matches_requested: Some(10),
        skill: Some(SkillLevel::VeryHigh),
        ..Default::default()
    };

    let data = dota.get_match_history(Some(&options)).expect("Couldn't get match history");
    
    for m in data.matches {
        println!("Match ID: {}, Number of players: {}", m.match_id, m.players.len());
    }
}

About

Rust client for the official Dota 2 web API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages