10

I know that Steam tracks certain stats related to the amount of time I've played games in my library. The stats that I'm aware of are:

  • Time of my current session
  • Time spent playing a game over the last two weeks
  • Time spent playing a game overall (ignoring time before Steam started counting)

What I would like is to be able to access more detailed information. I want to graph things like how often I am playing a game at certain times of day, or on each day of the week. I've got a lot of similar ideas, but all of them basically require knowing exactly when I started and stopped each session - potentially over a very long time.

Does Steam already store this data, or only the information in the list above? If it is, can I query it through an API? I'd assume it would have to be stored on their servers since it's able to be viewed through browsers and the mobile app.

If it isn't queryable through an API, is it possible to track it locally? Is the "current session" counter stored somewhere locally and in a readable format? Could I write a script to scrape it every minute and log the data out? This would allow me to gather the data starting now, at least - it's not the perfect solution but it's something.

3 Answers 3

5

IF Steam is collecting such a detailed statistic, then I haven't seen any documentation on that and it most definitely isn't available via API.

Although, they do collect quite a range of data across all users, presented e.g. via here or here

AFAIK, detailed statistics for single games are available to the games developer/publisher on steam, but not the users.

The easiest way to build your script that I can think of would be to query your Steam community profile for the currently played game, this is queryable in various formats such as JSON or XML. But this requires you to set your profile to public.

7

There may be a solution, if you do not mind digging a bit, on a Windows PC there is a file (or two) in your steam install folder: ..\Steam\logs\controller_ui.txt and ..\Steam\logs\controller_ui.previous.txt which contain logging info on when you started and stopped a steam app (game). it has rows like this:

[2021-02-05 10:22:26] Starting app 305620
[2021-02-05 12:57:30] Exiting app 305620

The App IDs you can look up online, e.g. on steamdb.info

There is also other info in these files, but with a bit of (Excel) tweaking you can filter it and get your history.

It appears that this file has a 256 KB max limit, so when exceeding that it creates a backup and starts a new one, so you may not be able to go back to prehistoric ages..., but at least a couple months/years (depending on your level of addiction). Also, if you are playing on multiple computers, you may need to look them up separately.

2
  • 2
    Looks like a good answer! I guess it doesn't have upvotes (other than mine, now) because it was a bit late. If you know a programming language or Excel, should be pretty easy to filter and calculate the time. || I should point out, not only does it have a 256 KB limit, but it also gets reset if you reinstall Steam. Mine goes back nearly 3 months and only 23 KB---I'm not super addicted, though---but I did a reinstall 3 months ago. Otherwise I'd have been able to get probably 2yrs+ this way
    – Sam OT
    Jun 24, 2021 at 8:20
  • 1
    I found session start/end record in ..\Steam\logs\compat_log.txt: "[2023-03-06 02:31:54] StartSession: appID 552500 session 93d3ce71f3db18d [2023-03-06 03:47:53] OnAppLifetimeNotification: release session(s) for appID 552500" Mar 6, 2023 at 0:21
2

https://steamtime.info/ gives you some of this information on this based on your Steam ID.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .