- type: custom-api
title: 🎮 Recently Played Games
cache: 1h
url: http://api.steampowered.com/IPlayerService/GetRecentlyPlayedGames/v0001/?key=${STEAM_API_KEY}&steamid=${STEAM_USERID}&format=json
template: |
{{ if eq .Response.StatusCode 200 }}
{{ $games := .JSON.Array "response.games" }}
{{ if gt (len $games) 0 }}
{{ range $games }}
-
{{ .String "name" }}
Last 2 weeks:
{{ if gt (toFloat (.Int "playtime_2weeks")) 60.0 }}
{{ printf "%.2f hrs" (div (toFloat (.Int "playtime_2weeks")) 60.0) }}
{{ else }}
{{ .Int "playtime_2weeks" }} mins
{{ end }}
{{ end }}
{{ else }}
No recently played games found.
{{ end }}
{{ else }}
An unexpected error occurred. Please try again later.
{{ end }}