PHPackages                             ivankayzer/howlongtobeat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ivankayzer/howlongtobeat

ActiveLibrary[API Development](/categories/api)

ivankayzer/howlongtobeat
========================

howlongtobeat.com provides information about games and how long it will take to finish them. This library is a simple wrapper to fetch data from Howlongtobeat website

1.1.0(3y ago)6844[1 issues](https://github.com/ivankayzer/howlongtobeat/issues)[1 PRs](https://github.com/ivankayzer/howlongtobeat/pulls)MITPHPPHP ^7.4

Since Feb 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ivankayzer/howlongtobeat)[ Packagist](https://packagist.org/packages/ivankayzer/howlongtobeat)[ Docs](https://github.com/ivankayzer/howlongtobeat)[ RSS](/packages/ivankayzer-howlongtobeat/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (5)Versions (6)Used By (0)

howlongtobeat
=============

[](#howlongtobeat)

[![](https://github.com/ivankayzer/howlongtobeat/workflows/PHP%20Workflow/badge.svg)](https://github.com/ivankayzer/howlongtobeat/workflows/PHP%20Workflow/badge.svg)[![](https://camo.githubusercontent.com/463b7dad8405789af2093ebd0d16ee764504c3d715516aa5fc8bec3937efd295/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792d70657263656e746167652f6976616e6b61797a65722f686f776c6f6e67746f62656174)](https://camo.githubusercontent.com/463b7dad8405789af2093ebd0d16ee764504c3d715516aa5fc8bec3937efd295/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792d70657263656e746167652f6976616e6b61797a65722f686f776c6f6e67746f62656174)

About
-----

[](#about)

howlongtobeat provides information and data about games and how long it will take to finish them.

This library is a simple wrapper to fetch data from howlongtobeat.com. Please check their website and support them if you like what they are doing.

Install
-------

[](#install)

Use the package manager [composer](https://getcomposer.org/download/) to install howlongtobeat.

```
composer require ivankayzer/howlongtobeat
```

Usage
-----

[](#usage)

#### Search

[](#search)

```
use IvanKayzer\HowLongToBeat\HowLongToBeat;

$hl2b = new HowLongToBeat();
$hl2b->search('Lego');
```

returns

```
{
  "Results": [
    {
      "ID": "5265",
      "Image": "https://howlongtobeat.com/gameimages/220px-Lego_Lord_of_the_Rings_cover.jpg",
      "Title": "LEGO The Lord of the Rings: The Video Game",
      "Summary": {
        "Main Story": "10 Hours",
        "Main + Extra": "16 Hours",
        "Completionist": "33 Hours"
      }
    },
    {
      "ID": "5263",
      "Image": "https://howlongtobeat.com/gameimages/256px-Lego_Star_Wars-The_Complete_Saga.jpg",
      "Title": "LEGO Star Wars: The Complete Saga",
      "Summary": {
        "Main Story": "14 Hours",
        "Main + Extra": "23 Hours",
        "Completionist": "39.5 Hours"
      }
    },
    {
      "ID": "16635",
      "Image": "https://howlongtobeat.com/gameimages/LegoTheHobbit.jpg",
      "Title": "LEGO The Hobbit",
      "Summary": {
        "Main Story": "9 Hours",
        "Main + Extra": "16 Hours",
        "Completionist": "35.5 Hours"
      }
    },
  ...
  ],
  "Pagination": {
    "Current Page": 1,
    "Last Page": 4
  }
}
```

You can also pass a page number as a second argument to `search`:

```
$hl2b->search('Lego', 2);
```

#### Get time entries by game ID

[](#get-time-entries-by-game-id)

```
use IvanKayzer\HowLongToBeat\HowLongToBeat;

$hl2b = new HowLongToBeat();
$hl2b->get(5265);
```

returns

```
{
  "ID": 5265,
  "Title": "LEGO The Lord of the Rings: The Video Game",
  "Image": "https://howlongtobeat.com/gameimages/220px-Lego_Lord_of_the_Rings_cover.jpg",
  "Description": "LEGO The Lord of the Rings is based on The Lord of the Rings motion picture trilogy and follows the original storylines of The Lord of the Rings: The Fellowship of the Ring, The Lord of the Rings: The Two Towers, and The Lord of the Rings: The Return of the King. Now the entire family can team up in pairs as adorable LEGO The Lord the Rings minifigures to experience countless dangers, solve riddles and battle formidable foes on their journey to Mount Doom.",
  "Developer": "Traveller's Tales",
  "Publisher": "Warner Bros. Interactive Entertainment",
  "Last Update": "4 Hours Ago",
  "Playable On": "PC, Nintendo 3DS, Nintendo DS, PlayStation 3, PlayStation Vita, Wii, Wii U, Xbox 360, Xbox One",
  "Genres": "Action, Adventure, Open World",
  "Statistics": {
    "Playing": "220",
    "Backlogs": "2300",
    "Replays": "34",
    "Retired": "5%",
    "Rating": "75%",
    "Beat": "1100"
  },
  "Summary": [
    {
      "Title": null,
      "Time": {
        "Main Story": "10 Hours",
        "Main + Extras": "16 Hours",
        "Completionist": "33 Hours",
        "All Styles": "17.5 Hours"
      }
    }
  ],
  "Single-Player": {
    "Main Story": {
      "Polled": "182",
      "Average": "9h 55m",
      "Median": "10h",
      "Rushed": "7h 25m",
      "Leisure": "14h 58m"
    },
    "Main + Extras": {
      "Polled": "109",
      "Average": "16h 48m",
      "Median": "15h",
      "Rushed": "11h 23m",
      "Leisure": "27h 57m"
    },
  ...
  },
  "Speedrun": {
    "Any%": {
      "Polled": "2",
      "Average": "4h 51m 43s",
      "Median": "4h 51m 43s",
      "Fastest": "4h 23m 56s",
      "Slowest": "5h 19m 30s"
    }
  },
  "Multi-Player": {
    "Co-Op": {
      "Polled": "14",
      "Average": "17h 12m",
      "Median": "13h 27m",
      "Least": "10h 54m",
      "Most": "28h 15m"
    }
  },
  "Platform": {
    "Nintendo 3DS": {
      "Polled": "24",
      "Main": "9h 34m",
      "Main +": "21h 15m",
      "100%": "22h 56m",
      "Fastest": "4h 52m",
      "Longest": "60h"
    },
  ...
  }
}
```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 98.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~333 days

Total

4

Last Release

1291d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4268af03d5ae89eeb12d67ef2d22d369e6db8219c55f3ad5d5cbfdf7fbde799?d=identicon)[ivankayzer](/maintainers/ivankayzer)

---

Top Contributors

[![ivankaizer](https://avatars.githubusercontent.com/u/14001131?v=4)](https://github.com/ivankaizer "ivankaizer (58 commits)")[![hechcraft](https://avatars.githubusercontent.com/u/25202564?v=4)](https://github.com/hechcraft "hechcraft (1 commits)")

---

Tags

gameshowlongtobeathow long to beathl2bhowlongtobeat

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ivankayzer-howlongtobeat/health.svg)

```
[![Health](https://phpackages.com/badges/ivankayzer-howlongtobeat/health.svg)](https://phpackages.com/packages/ivankayzer-howlongtobeat)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[sleeping-owl/apist

Package to provide api-like access to foreign sites based on html parsing

3105.3k](/packages/sleeping-owl-apist)[sproutcms/cms

Enterprise content management and framework

241.6k4](/packages/sproutcms-cms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
