Created
December 20, 2023 10:35
-
-
Save zarkone/8752535bbf3dfff94b982eaced459046 to your computer and use it in GitHub Desktop.
Steam, year in review 2023: get total play time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. open browser dev console e.g. with Ctrl+Shift+i | |
// 2. paste in console at Steam year in review page of your account: | |
// e.g. https://store.steampowered.com/yearinreview/...somethinghere../2023 | |
(function getSteamStats() { | |
const appConfigAttrs = document.querySelector("html.responsive body.v6.reactroot.responsive_page.movescrolltocontent div.responsive_page_frame.with_header div.responsive_page_content div#responsive_page_template_content.responsive_page_template_content div#application_config").attributes | |
const accId = JSON.parse(appConfigAttrs["data-userinfo"].value).accountid | |
const yearInReview = JSON.parse(appConfigAttrs[`data-yearinreview_${accId}_2023`].value) | |
const totalPlaytimeSeconds = yearInReview.playtime_stats.total_stats.total_playtime_seconds | |
console.log("Total play time in steam (hours):", totalPlaytimeSeconds / 3600) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment