| Crates.io | howlongtobeat-scraper |
| lib.rs | howlongtobeat-scraper |
| version | 0.1.0 |
| created_at | 2025-01-16 09:02:40.770965+00 |
| updated_at | 2025-01-16 09:02:40.770965+00 |
| description | Simple api for https://howlongtobeat.com |
| homepage | https://github.com/nytuo/howlongtobeat-scraper |
| repository | https://github.com/nytuo/howlongtobeat-scraper |
| max_upload_size | |
| id | 1519083 |
| size | 14,506 |
Simple API for HowLongToBeat.
howlongtobeat-scraper is a Rust library that provides a simple API to interact with the HowLongToBeat website. It allows you to scrape game information such as playtime estimates.
Add the following to your Cargo.toml:
[dependencies]
howlongtobeat-scraper = "0.1.0"
Here is a basic example of how to use the library:
use howlongtobeat_scraper::HowLongToBeatScraper;
fn main() {
let game_info = search_by_name("The Legend of Zelda: Breath of the Wild").unwrap();
println!("{:?}", game_info);
}
The output will be a JSON string containing the game information. For example:
{
"hltb_id": 2127,
"title": "Cyberpunk 2077",
"main_story": {
"average": 94860.0,
"median": 88920.0,
"rushed": 63900.0,
"leisure": 153900.0
},
"main_extra": {
"average": 233520.0,
"median": 216000.0,
"rushed": 135060.0,
"leisure": 630780.0
},
"completionist": {
"average": 399480.0,
"median": 362100.0,
"rushed": 273180.0,
"leisure": 1102980.0
},
"all_styles": {
"average": 246180.0,
"median": 216000.0,
"rushed": 133500.0,
"leisure": 1028100.0
}
}
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
Arnaud BEUX - GitHub - nytuo.yt@gmail.com