How long to beat provides information and data about games and how long it will take to finish them. It's a great website which relies heavily from community data.
This package is a simple wrapper api to fetch data from How long to beat (search and detail). Please use this responsibly.
Install the library using nuget package manager (search for HowLongToBeat) or using Package Manager Console
Install-Package HowLongToBeat
Install the library using .NET CLI
dotnet add package HowLongToBeat
- Import namespace
using HowLongToBeat;
- Instantiate the
HLTBWebScraper
object and use theSearch()
method- Note: it depends on a
HttpClient
instance
- Note: it depends on a
var httpClient = new HttpClient();
var ws = new HLTBWebScraper(httpClient);
var query = "Halo";
var result = await ws.Search(query);
[
{
"title": "Halo Infinite",
"imgURL": "https://howlongtobeat.com/games/57454_Halo_Infinite.jpg",
"main": "10½ Hours",
"mainAndExtras": "17½ Hours",
"completionist": "25 Hours"
},
{
"title": "Halo: The Master Chief Collection",
"imgURL": "https://howlongtobeat.com/games/Halo_Collection.jpg",
"main": "",
"mainAndExtras": "",
"completionist": ""
},
{
"title": "Halo 3",
"imgURL": "https://howlongtobeat.com/games/256px-Halo_3_final_boxshot.JPG",
"main": "8 Hours",
"mainAndExtras": "11½ Hours",
"completionist": "18½ Hours"
},
{
"title": "Halo: Combat Evolved",
"imgURL": "https://howlongtobeat.com/games/Halobox.jpg",
"main": "10 Hours",
"mainAndExtras": "11 Hours",
"completionist": "13 Hours"
}
]