{"id":34171197,"url":"https://github.com/forbiddencoding/howlongtobeat","last_synced_at":"2026-05-29T22:31:21.789Z","repository":{"id":186812997,"uuid":"675116240","full_name":"forbiddencoding/howlongtobeat","owner":"forbiddencoding","description":"A simple Go wrapper to read data from howlongtobeat.com","archived":false,"fork":false,"pushed_at":"2026-02-09T18:32:26.000Z","size":130,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-09T22:39:02.962Z","etag":null,"topics":["golang","howlongtobeat"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forbiddencoding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-05T20:45:31.000Z","updated_at":"2026-02-09T18:32:29.000Z","dependencies_parsed_at":"2024-01-20T00:31:44.431Z","dependency_job_id":"5d6e1df7-97d6-4341-af70-6bfb2f82849d","html_url":"https://github.com/forbiddencoding/howlongtobeat","commit_stats":null,"previous_names":["forbiddencoding/howlongtobeat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/forbiddencoding/howlongtobeat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbiddencoding%2Fhowlongtobeat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbiddencoding%2Fhowlongtobeat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbiddencoding%2Fhowlongtobeat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbiddencoding%2Fhowlongtobeat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forbiddencoding","download_url":"https://codeload.github.com/forbiddencoding/howlongtobeat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbiddencoding%2Fhowlongtobeat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33673627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","howlongtobeat"],"created_at":"2025-12-15T11:11:08.144Z","updated_at":"2026-05-29T22:31:21.784Z","avatar_url":"https://github.com/forbiddencoding.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HowLongToBeat\n\n[![License](https://img.shields.io/badge/license-BSD_3--Clause-blue.svg?style=flat-square)](LICENSE.md)\n![Documentation](https://img.shields.io/badge/documentation-available-yellow.svg?style=flat-square)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat-square\u0026logo=GitHub)](https://github.com/forbiddencoding/howlongtobeat/issues)\n\n[HowLongToBeat.com](https://howlongtobeat.com) provides information and data about video games, and how long it will\napproximately take to finish them.\n\nThis library is a simple wrapper api to fetch data from HowLongToBeat. HowLongToBeat is an awesome website and a great\nservice, free and also living from community data.\n\nYou get the option to get raw and extensive game data or a simplified, formatted version of it.\n\n\u003e \u0026#9888; **Disclaimer:** This library is not affiliated nor endorsed with HowLongToBeat.com or Ziff Davis LLC\n\u003e in any way. Please use this library responsibly and do not abuse or overload the HowLongToBeat servers.\n\n----\n\n## Contents\n\n* [Quickstart](#quickstart)\n* [API](#api)\n    * [Search](#search)\n    * [SearchSimple](#searchsimple)\n    * [Detail](#detail)\n    * [DetailSimple](#detailsimple)\n    * [Reduce](#reduce)\n* [Similar projects in different languages](#similar-projects-in-different-languages)\n* [Troubleshooting](#troubleshooting)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Quickstart\n\n\u003e \u0026#9888; Verify you are running Golang version **1.20**, by running `go version` in a terminal or console window. Older\n\u003e versions can produce errors, but newer versions are usually fine.\n\u003e\n\u003e \u0026#9888; HowLongToBeat uses go modules, there is no dependency on `$GOPATH` variable.\n\n#### Add **HowLongToBeat** to your project:\n\n```bash\ngo get -u github.com/forbiddencoding/howlongtobeat\n```\n\n#### Building a HowLongToBeat instance:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"github.com/forbiddencoding/howlongtobeat\"\n)\n\nfunc main() {\n\thltb, err := howlongtobeat.New()\n\tif err != nil {\n\t\t// error handling\n\t}\n\t// ...\n}\n```\n\n#### Searching for a game:\n\n```go\n// ...\nsearchResults, err := hltb.Search(context.TODO(), \"The Witcher 3: Wild Hunt\", hltb.SearchModifierNone, nil)\nif err != nil {\n// error handling\n}\n// ...\n```\n\n#### Getting details for a game by its ID:\n\n```go\n// ...\ngameDetails, err := hltb.Detail(context.TODO(), 40171)\nif err != nil {\n// error handling\n}\n// ...\n```\n\n## API\n\n\u003e A note about the returned data:\n\u003e When using the `Simple` methods, the data is already formatted and cleaned up, reducing it to the most commonly used\n\u003e data.\n\u003e Part of the formatting includes converting the time values from seconds to hours.\n\u003e\n\u003e If you find that the `Simple` methods, or the `Reduce` method respectively, trim away too much data, please open an\n\u003e issue and let me know. I am happy to add more data to the `Simple` methods, if it is required by the community.\n\n### Search\n\nSearch allows you to search for games by their name. It returns a raw list of search results.\nThe result usually contains most of the data you would want or need, but might need to be formatted or cleaned up.\n\n##### Parameters\n\n| Name         | Type                    | Description                                                                                                                                                                                                                                                                                                     |\n|--------------|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `query`      | `string`                | The title of the game or DLC.                                                                                                                                                                                                                                                                                   |\n| `modifier`   | `SearchModifier`        | The search modifier to use. Possible values are:\u003cbr/\u003e `SearchModifierNone` for the default behaviour returning both games as well as DLCs the default behaviour\u003cbr/\u003e`SearchModifierOnlyDLC` to only get DLCs matching the search term or compatible with the game\u003cbr/\u003e `SearchModiferHideDLC` to only get games |\n| `pagination` | `*SearchGamePagination` | Used for custom pages sizes or pagination if too many matching result have been found by the HLTB API.\u003cbr/\u003eThe default page size is 20.                                                                                                                                                                         |\n\n#### Usage\n\n```go\n// ...\nsearchResults, err := hltb.Search(context.TODO(), \"The Witcher 3: Wild Hunt\", hltb.SearchModifierNone, nil)\nif err != nil {\n// error handling\n}\n// ...\n```\n\n##### Returns\n\n````json\n{\n  \"color\": \"blue\",\n  \"title\": \"\",\n  \"category\": \"games\",\n  \"count\": 9,\n  \"page_current\": 0,\n  \"page_total\": 0,\n  \"page_size\": 0,\n  \"data\": [\n    {\n      \"count\": 9,\n      \"game_id\": 10270,\n      \"game_name\": \"The Witcher 3: Wild Hunt\",\n      \"game_name_date\": 0,\n      \"game_alias\": \"The Witcher III: Wild Hunt\",\n      \"game_type\": \"game\",\n      \"game_image\": \"10270_The_Witcher_3_Wild_Hunt.jpg\",\n      \"comp_lvl_combine\": 0,\n      \"comp_lvl_sp\": 1,\n      \"comp_lvl_co\": 0,\n      \"comp_lvl_mp\": 0,\n      \"comp_lvl_spd\": 1,\n      \"comp_main\": 184978,\n      \"comp_plus\": 371370,\n      \"comp_100\": 624261,\n      \"comp_all\": 369324,\n      \"comp_main_count\": 2316,\n      \"comp_plus_count\": 5663,\n      \"comp_100_count\": 1939,\n      \"comp_all_count\": 9918,\n      \"invested_co\": 0,\n      \"invested_mp\": 0,\n      \"invested_co_count\": 0,\n      \"invested_mp_count\": 0,\n      \"count_comp\": 18133,\n      \"count_speedrun\": 16,\n      \"count_backlog\": 18719,\n      \"count_review\": 4609,\n      \"review_score\": 94,\n      \"count_playing\": 426,\n      \"count_retired\": 1059,\n      \"profile_dev\": \"CD Projekt RED\",\n      \"profile_popular\": 1805,\n      \"profile_steam\": 292030,\n      \"profile_platform\": \"Nintendo Switch, PC, PlayStation 4, PlayStation 5, Xbox One, Xbox Series X/S\",\n      \"release_world\": 2015,\n      \"similarity\": 0.33\n    }\n    // ...\n  ]\n}\n````\n\n### SearchSimple\n\nSearchSimple allows you to search for games by their name. It returns a list of search results with a simplified\nstructure, omitting data which is not usually needed.\n\n##### Parameters\n\n| Name       | Type             | Description                                                                                                                                                                                                                                                                               |\n|------------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `query`    | `string`         | The title of the game or DLC.                                                                                                                                                                                                                                                             |\n| `modifier` | `SearchModifier` | The search modifier to use. Possible values are:\u003cbr/\u003e `SearchModifierNone` for the default behaviour returning both games as well as DLCs\u003cbr/\u003e`SearchModifierOnlyDLC` to only get DLCs matching the search term or compatible with the game\u003cbr/\u003e `SearchModiferHideDLC` to only get games |\n\n#### Usage\n\n```go\n// ...\nsearchResults, err := hltb.SearchSimple(context.TODO(), \"The Witcher 3\", SearchModifierNone)\nif err != nil {\n// error handling\n}\n// ...\n```\n\n##### Returns\n\n````json\n[\n  {\n    \"game_id\": 10270,\n    \"game_name\": \"The Witcher 3: Wild Hunt\",\n    \"profile_platform\": \"Nintendo Switch, PC, PlayStation 4, PlayStation 5, Xbox One, Xbox Series X/S\",\n    \"game_image\": \"10270_The_Witcher_3_Wild_Hunt.jpg\",\n    \"comp_main\": 51,\n    \"comp_plus\": 103,\n    \"comp_all\": 103,\n    \"similarity\": 0.33\n  }\n  // ...\n]\n````\n\n### Detail\n\nDetail allows you to get raw detailed information about a game or DLC by its ID.\n\n##### Parameters\n\n| Name     | Type  | Description                                                                                                                                       |\n|----------|-------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| `gameID` | `int` | The ID of the game or DLC. Can be found as `GameID` by the search result or in the search bar of your browser when visiting the howlongtobeat.com |\n\n#### Usage\n\n```go\n// ...\ngame, err := hltb.Detail(context.TODO(), 10270)\nif err != nil {\n// error handling\n}\n// ...\n```\n\n#### Returns\n\nSee response in example [here](examples/detail.json).\n\n### DetailSimple\n\nDetailSimple allows you to get detailed information about a game or DLC by its ID. It returns a simplified structure (\nsimilar to `SearchSimple`), omitting data which is not usually needed.\n\n#### Parameters\n\n| Name     | Type  | Description                                                                                                                                       |\n|----------|-------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| `gameID` | `int` | The ID of the game or DLC. Can be found as `GameID` by the search result or in the search bar of your browser when visiting the howlongtobeat.com |\n\n#### Usage\n\n```go\n// ...\ngame, err := hltb.DetailSimple(context.TODO(), 10270)\nif err != nil {\n// error handling\n}\n// ...\n```\n\n#### Returns\n\n````json\n{\n  \"game_id\": 10270,\n  \"game_name\": \"The Witcher 3: Wild Hunt\",\n  \"profile_platform\": \"Nintendo Switch, PC, PlayStation 4, PlayStation 5, Xbox One, Xbox Series X/S\",\n  \"game_image\": \"10270_The_Witcher_3_Wild_Hunt.jpg\",\n  \"comp_main\": 51,\n  \"comp_plus\": 103,\n  \"comp_all\": 103\n}\n````\n\n### Reduce\n\nIf you used the `Search` or `Detail` function, you can call `Reduce` on the result variable to reduce the data in the\nsame way as `SearchSimple` and`DetailSimple` would do.\n\n```go\n// ...\ngame, err := hltb.Detail(context.TODO(), 10270)\nif err != nil {\n// error handling\n}\n\nsimpleGame := game.Reduce()\n// ...\n```\n\n## Similar projects in different languages\n\n| Project                                                                                         | Language   |\n|-------------------------------------------------------------------------------------------------|------------|\n| [ckatzorke/howlongtobeat](https://github.com/ckatzorke/howlongtobeat)                           | TypeScript |\n| [ScrappyCocco/HowLongToBeat-PythonAPI](https://github.com/ScrappyCocco/HowLongToBeat-PythonAPI) | Python     |\n| [ivankayzer/howlongtobeat](https://github.com/ivankayzer/howlongtobeat)                         | PHP        |\n| [jameslieu/howlongtobeat](https://github.com/jameslieu/howlongtobeat)                           | C#         |\n| [saturnavt/howlongtobeat-api](https://github.com/saturnavt/howlongtobeat-api)                   | Rust       |\n\n## Troubleshooting\n\nFor help with common problems, please see [TROUBLESHOOTING.md](TROUBLESHOOTING.md). If you encounter any other issues,\nfeel free to open an issue.\n\n## Contributing\n\nWe'd love your help in making this library better. Please review our [contribution guidelines](CONTRIBUTING.md).\n\n## License\n\nThis project is licensed under the terms of the BSD-3 License. See the [LICENSE](LICENSE.md) for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforbiddencoding%2Fhowlongtobeat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforbiddencoding%2Fhowlongtobeat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforbiddencoding%2Fhowlongtobeat/lists"}