FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
alvi
alviSteamPlaytimeHistory_playHistoryToSqlite
Public
Like
2
SteamPlaytimeHistory_playHistoryToSqlite
Home
Code
2
README.md
C
main.tsx
Branches
1
Pull requests
Remixes
1
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
README.md

This val is part of the SteamPlaytimeHistory project which consists of logging your recently played games on steam everyday through valve's API.

I wanted to log this data so I can analyse which days do I game the most ? which periods do I log the most hours in my confort game (Dead By Daylight) ? And so on. I think the data viz possibilities are super interesting, just like when Valve releases the "Steam in review" at the end of the year

This val fetches your recent playtime history from valve's API and stores it in a database every day !

The project uses multiple vals to work:

  • First you need to create the table to store the data: https://www.val.town/v/alvi/SteamPlaytimeHistory_createPlayHistoryTable
  • You can then interact with the table using this drizzle schema: https://www.val.town/v/alvi/SteamPlaytimeHistory_playHistorySchema
  • Optionnaly, you can backup your data with a csv file in your email every month: https://www.val.town/v/alvi/SteamPlaytimeHistory_exportDbToEmail

Finally, you can run this val every day (or more) to log the data to the sqlite table

To run this project, you'll need:

  • A steam web api key: https://steamcommunity.com/login/home/?goto=%2Fdev%2Fapikey
  • SteamID of the user (profile needs to be public)
  • Discord websocket url (for error messages)

Migrated from folder: Steam/playtimeHistory/play_history/SteamPlaytimeHistory_playHistoryToSqlite

Code
README.md
C
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.