No description
- Python 93.6%
- Dockerfile 6.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .env.example | ||
| .gitignore | ||
| app.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| README.MD | ||
| requirements.txt | ||
Steam Now Playing API
A small Docker-based API that exposes the currently played Steam game for a Steam profile.
It uses the official Steam Web API and requires a Steam Web API key.
Features
- Official Steam Web API
- Current game detection
- Steam AppID
- Steam game cover URL
- Online/offline status
- Configurable cache
- CORS enabled
- Docker Compose
- API key stored in
.env - No API key exposed by the frontend
Configuration
Create .env:
STEAM_API_KEY=your-steam-api-key
STEAM_ID=your-steam-id-here
CACHE_SECONDS=10
STEAM_API_KEY is your Steam Web API key.
STEAM_ID is the SteamID64 of the profile.
CACHE_SECONDS controls how long the API response is cached by this service.
Getting a Steam Web API key
Go to:
https://steamcommunity.com/dev/apikey
Sign in with Steam and create an API key.
The domain can be your website domain.
Start
Build and start the container:
docker compose up -d --build
Check the container:
docker compose ps
View logs:
docker compose logs -f
API
Now playing
GET /now-playing
Example:
{
"playing": true,
"game": "Celeste",
"appid": "504230",
"cover": "https://shared.fastly.steamstatic.com/store_item_assets/steam/apps/504230/capsule_616x353.jpg",
"online": true,
"steamid": "76561199653970951",
"updated": 1789742931
}
When the user is not playing:
{
"playing": false,
"game": null,
"appid": null,
"cover": null,
"online": true,
"steamid": "76561199653970951",
"updated": 1789742931
}
Health
GET /health
Example:
{
"status": "ok",
"steamid_configured": true,
"api_key_configured": true
}