
Thought I’d add a bit of an update on everyone’s interest in an API here. I see that HL2B was bought by Ziff Davis (owner of IGN) in April this year and the plan is to launch an IGN app/website, most likely behind behind paywall like IGN Prime. So wouldn’t count on a API ever being a reality.
4 Yrs♥$✓#
churros
4 Yrs♥$✓#
I don't have any info on HLTB in particular, but not having an API might make other applications web scrap the website instead, which can be worse for both parties.

6 Yrs♥$✓#
I'm confused as to why someone who doesn't seem to have used the site for 5 years has randomly shown up to bump a thread and tell us old news with a hint of guesswork.
Everdred is currently working on a newly written version of the site. This may or may not help in the creation of an API. There are a number of things that are needed before then.
Everdred is currently working on a newly written version of the site. This may or may not help in the creation of an API. There are a number of things that are needed before then.

13 Yrs♥F✓#
Quite the opposite actually. I'm still running the site and the rebuild will make it much easier for users to access raw data in a convenient format.
10 Yrs✓
StryKan
10 Yrs✓
Awesome nice and thanks!

Super excited for an API. Do you have a timeline? Do you have any objections to scraping & caching until then? Curious what you think about tools like https://github.com/ckatzorke/howlongtobeat

Disclaimer: I have very little experience with programming in general, so forgive me if my idea is stupid.
I found this topic because I'm interested in making userscripts (and maybe a browser extension) to enhance the sites I've been using the most. From HLTB, all I'm interested in are the playtimes to add them to sites like Steam, SteamDB, GOG and gg.deals. To me, it seems reasonable to get all the playtimes' data once and use them locally, because it's not something I'd need ultra fresh. I think getting a new version once a week would be enough, bc new games don't have useful enough data yet.
So I thought that maybe a way to make the game's times data available would be to generate something like a big JSON that wouldn't be super up-to-date, and with something else that discourages people from downloading it too frequently, like putting a delay on the download or using an unconventional compression format. Maybe even requiring a CAPTCHA, or having a verified account on HLTB and limiting to 1 download per day. Or all of those combined lol. The intention is to force developers to make their apps consume their own copy, bc requesting directly in real time would harm their user's experience.
I found this topic because I'm interested in making userscripts (and maybe a browser extension) to enhance the sites I've been using the most. From HLTB, all I'm interested in are the playtimes to add them to sites like Steam, SteamDB, GOG and gg.deals. To me, it seems reasonable to get all the playtimes' data once and use them locally, because it's not something I'd need ultra fresh. I think getting a new version once a week would be enough, bc new games don't have useful enough data yet.
So I thought that maybe a way to make the game's times data available would be to generate something like a big JSON that wouldn't be super up-to-date, and with something else that discourages people from downloading it too frequently, like putting a delay on the download or using an unconventional compression format. Maybe even requiring a CAPTCHA, or having a verified account on HLTB and limiting to 1 download per day. Or all of those combined lol. The intention is to force developers to make their apps consume their own copy, bc requesting directly in real time would harm their user's experience.
9 Yrs✓
Xunkar
9 Yrs✓
Has there been any news on this front? I'm sorry for this slight necro, but research did not turn up much, I can't even find an actual confirmation that a full-fledged API is in the work. I am myself very interested in this, I have plans to write a plugin to sync a game library with HowLongToBeat but I refuse to resort to scrapping and request hi-jacking for obvious reasons.

6 Yrs♥$✓#
The rebuilt site doesn't yet have an ETA afaik and you'll have to wait for that first. As noted in the previous post above by Everdred, this should result in the data being made available more easily.

Love HLTB the site but their lack of API boggles my mind. They are against you using the data. https://www.igdb.com has a free API and it isn't limited to what you can use the data for. It does have time to beat in their API as well. Sadly this data isn't as vast as HLTB but if more people are aware of it and add more times it would be a great alternative. It does have some data now but would be better if more people added in their times. I hate to push to another site but when a company doesn't have the community in mind we have no choice but to see alternatives.

Microsoft now displaying HLTB stats on their Xbox app could signal a public API is close? I'd be very surprised if MS is scraping or manually getting those stats!

9 Yrs♥✓#
Even if they made a deal for an API, doesn't mean that they will open it up publicly. But hopefully they do!

13 Yrs♥F✓#
The Xbox integration is the official API that I built.
I still hope to open this up at some point. This is the first and only 3rd party access at the moment.
First of all, this is a dream collab for me so I wouldn't pass that opportunity and second of all a great test for load balancing and real world use.
EDIT: @SirRandall I apologize, it looks like your post was hidden because it was likely flagged as a bot. (No game activity, a simple name, 1 post).
I still hope to open this up at some point. This is the first and only 3rd party access at the moment.
First of all, this is a dream collab for me so I wouldn't pass that opportunity and second of all a great test for load balancing and real world use.
EDIT: @SirRandall I apologize, it looks like your post was hidden because it was likely flagged as a bot. (No game activity, a simple name, 1 post).

+1 for this! thanks in advance!

All good and thank you.

I used to parse data into google sheets for my backlog and shared the template with the community, but about ~9 months ago it stopped working. I understand that you have blocked Google's user agent. Since you still assume that someday the API will be made public, could you open access for parsing through Google sheets for the time being? Does this cause such a significant load on the server?

Would definitely love a public API to integrate with other tools.
In the new website if you look under the hood while doing a search, using the DevTools you can see that there's an actual API being called (basically /api/search), however calling that API from anywhere throws a 401 (Unauthorized) response.
So it seems that the API is already there is just a matter of make it public
In the new website if you look under the hood while doing a search, using the DevTools you can see that there's an actual API being called (basically /api/search), however calling that API from anywhere throws a 401 (Unauthorized) response.
So it seems that the API is already there is just a matter of make it public
4 Yrs✓#
hpuente85
4 Yrs✓#
+1!
I am developer as well, and would be so fun playing with a HL2B API
I am developer as well, and would be so fun playing with a HL2B API

Not sure if any more +1s are needed, but I wholeheartedly support the request for a Public API.
HLTB is absolutely THE BEST source of information abou play times, it would be amazing if it could be integrated with other sites. Even with a pretty limited # of calls per day!
Perhaps Patreon could help cover the cost of increased traffic?
HLTB is absolutely THE BEST source of information abou play times, it would be amazing if it could be integrated with other sites. Even with a pretty limited # of calls per day!
Perhaps Patreon could help cover the cost of increased traffic?
2 Yrs✓
piyuv
2 Yrs✓
As soon as a public API launches, I'll be (one of the many) iOS devs building a native HLTB app. Something I desperately want for myself. The website is really well built and all but not optimised for mobile.

I'm willing to work on this too. I'm thinking about a C# wraper as there is one already on TypeScript.
Already started a project, tried using the one already exists as a guideline but couldn't make the HTTP request work, neither with /api/search or /?q=SearchParams
Will be messagging Everdred as someone suggested on discord and will try to keep updates on this Threads if I get to something that works at least for searching games with full name ^^
Already started a project, tried using the one already exists as a guideline but couldn't make the HTTP request work, neither with /api/search or /?q=SearchParams
Will be messagging Everdred as someone suggested on discord and will try to keep updates on this Threads if I get to something that works at least for searching games with full name ^^

Well, using the following package https://github.com/ckatzorke/howlongtobeat I decided to build an api rest so anyone can access to it without needing to download the package.
This is on a free tier Azure Function so it wont allow TONS of requests, but for any personal and small project may be usefull.
If I see its not being used as intended I can switch it off to private and just use it myself, hope there is no need to do this.
https://hltb-fanmadeapi.glitch.me/HLTBSearch?search=QuerySearch
https://hltb-fanmadeapi.glitch.me/HLTBDetail?detail=GameID
This is on a free tier Azure Function so it wont allow TONS of requests, but for any personal and small project may be usefull.
If I see its not being used as intended I can switch it off to private and just use it myself, hope there is no need to do this.
https://hltb-fanmadeapi.glitch.me/HLTBSearch?search=QuerySearch
https://hltb-fanmadeapi.glitch.me/HLTBDetail?detail=GameID

It's amazing how many websites utilize howlongtobeat's times!
3 Yrs✓
Baranork
3 Yrs✓
I'm sorry man, I was trying to do something and I crashed your Azure app. It wasn't intentional.
I'll try to use the package, my bad

No worries lol
I'm still new to Azure and don't really know what the free tier cap is and how to keep it on budget so when it gets some requests in a short period of time it disables :/
If u know about a site to host a WebApp for free even if it has its limits let me know :P
enano_forro on discord if u wanna chat
EDIT:
Migrated to Glith plataform, now the api can take up to 4.000 requests per hour =)
I'm still new to Azure and don't really know what the free tier cap is and how to keep it on budget so when it gets some requests in a short period of time it disables :/
If u know about a site to host a WebApp for free even if it has its limits let me know :P
enano_forro on discord if u wanna chat
EDIT:
Migrated to Glith plataform, now the api can take up to 4.000 requests per hour =)