{"id":17928584,"url":"https://github.com/alifeee/steam_collage_api","last_synced_at":"2026-01-20T07:32:52.543Z","repository":{"id":151415101,"uuid":"279557288","full_name":"alifeee/steam_collage_api","owner":"alifeee","description":"Makes a collage image out of your steam games","archived":false,"fork":false,"pushed_at":"2025-06-29T17:24:01.000Z","size":6315,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-22T11:14:01.123Z","etag":null,"topics":["flask","pillow","python"],"latest_commit_sha":null,"homepage":"https://alifeee.co.uk/steam_mosaic/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alifeee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-07-14T10:43:17.000Z","updated_at":"2025-06-29T17:24:02.000Z","dependencies_parsed_at":"2023-11-14T02:38:59.424Z","dependency_job_id":"404b0bac-f09f-4d96-825e-74b33bf2c3a2","html_url":"https://github.com/alifeee/steam_collage_api","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/alifeee/steam_collage_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fsteam_collage_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fsteam_collage_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fsteam_collage_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fsteam_collage_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alifeee","download_url":"https://codeload.github.com/alifeee/steam_collage_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fsteam_collage_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28598158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","pillow","python"],"created_at":"2024-10-28T21:04:12.420Z","updated_at":"2026-01-20T07:32:52.536Z","avatar_url":"https://github.com/alifeee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Steam Collage API\n\nAn API to generate a collage of games from a Steam profile. Python is used to generate the image, which is served via an HTTP server using [Flask](https://flask.palletsprojects.com/en/2.2.x/). Hosted using [Kamatera](https://console.kamatera.com/).\n\nGive it a go! --\u003e \u003chttps://alifeee.co.uk/steam_mosaic/\u003e\n\nBlog post --\u003e \u003chttps://blog.alifeee.co.uk/steam-collage-api/\u003e\n\n![Collage image](./images/alifeee.png)\n\n## URLs\n\n| Service | URL |\n| -------- | --- |\n| Docker Hub | [alifeee/steamcollageapi](https://hub.docker.com/repository/docker/alifeee/steamcollageapi) |\n| GitHub | [alifeee/steam_collage](https://github.com/alifeee/steam_collage/) |\n| Kamatera Console | [alifeee](https://console.kamatera.com/) |\n| Kamatera Server | http://server.alifeee.co.uk |\n\n## Environment\n\nA .env file is used to store environment variables. The following variables are used:\n\n| Name | Description |\n| ---- | ----------- |\n| `API_KEY` | Steam API key - see [below](#api-key). |\n| `DO_CACHE` | Whether to cache the game thumbnails. Note that this increases the memory usage of the server. |\n\n```text\n# .env\nAPI_KEY=8917981789178\nDO_CACHE=True\n```\n\n### API Key\n\nA steam API key must be placed in the `.env` file in the root directory, or exposed to the environment via the terminal. Keys can be obtained from [Steam](https://steamcommunity.com/dev/apikey).\n\n## Commands\n\n### Use python virtual environment\n\n```bash\npython -m venv env\n```\n\n### Install modules from requirements.txt\n\n```bash\npip install -r requirements.txt\n```\n\n### Save modules to requirements.txt\n\n```bash\npip freeze \u003e requirements.txt\n```\n\n### Run tests\n\n```bash\nptw -- --cov=api\n```\n\n### Run server locally\n\n```bash\npython ./api/api.py debug\n```\n\n### Build and run docker image\n\n```bash\ndocker build -t alifeee/steamcollageapi .\ndocker run -d --restart unless-stopped -p 5000:5000 -e API_KEY=8917981789178 alifeee/steamcollageapi\n```\n\n### Push docker image to Docker Hub\n\n```bash\ndocker push alifeee/steamcollageapi\n```\n\n## Thunder Client\n\nThunder client is a VS Code extension which allows you to make HTTP requests. It is useful for testing the API.\n\n### Testing\n\nSome tests are included in the `tests` collection. These can be run by using the `Run All` button in the top right of collection.\n\n## Deploying to Kamatera (remote)\n\n### Connect to Kamatera\n\n```bash\nssh root@server.alifeee.co.uk\n\u003e enter password\n```\n\n### Pull the latest image from Docker Hub\n\n```bash\ndocker pull alifeee/steamcollageapi\n```\n\n### Remove existing container\n\n```bash\ndocker ps -a\n\u003e get container id\ndocker rm \u003ccontainer id\u003e\n```\n\n### Run image\n\n```bash\ndocker create -d --restart unless-stopped -p 5000:5000 -e API_KEY=8917981789178 --name steamcollageapi alifeee/steamcollageapi\n\u003e get container id\ndocker start \u003ccontainer id\u003e\n```\n\n## Docker compose\n\nFirst, create the user:\n\n```bash\nsudo useradd -r -s /bin/false steamcollage\necho \"user id: \"$(cat /etc/passwd | grep \"^steamcollage:\" | awk -F':' '{print $3}')\n```\n\n```yml\nname: steam collage api\nservices:\n    steamcollageapi:\n        environment:\n            - API_KEY=1B74FD1DD42E130B9C066CE658CB0270\n        container_name: steamcollageapi\n        ports:\n            - 5000:5000/tcp\n        restart: unless-stopped\n        image: alifeee/steamcollageapi\n# when user doesn't exist in container, user UID\n#        user: steamcollage\n        user: \"994\"\n        command: python ./api.py\n```\n\n## GitHub actions\n\n### `python-app.yml`: Python testing\n\nThis workflow:\n\n1. Checks out the repository\n2. Sets up Python 3.10\n3. Installs dependencies\n4. Runs linting\n5. Runs tests\n\n#### Secrets\n\nNone.\n\n### `docker-image.yml`: Docker\n\nThis workflow:\n\n1. Checks out the repository\n2. Builds the Docker image\n3. Pushes the Docker image to Docker Hub\n4. Deploys the Docker image to Kamatera\n\n#### Secrets used for Docker and Kamatera\n\n| Name | Description |\n| ---- | ----------- |\n| `API_KEY` | Steam API key - see [above](#api-key). |\n| `DOCKERHUB_USERNAME` | Docker Hub username. |\n| `DOCKERHUB_TOKEN` | [Docker Hub access token](https://docs.docker.com/docker-hub/access-tokens/). |\n| `HOST` | IP address of the Kamatera server |\n| `USERNAME` | Username for the Kamatera server |\n| `KEY` | RSA key* for the Kamatera server |\n\n##### *RSA key\n\nSee [rsa_ssh_key_setup.md](./rsa_ssh_key_setup.md) for details on setting up the RSA key.\n\n## API\n\nAll APIs are served on the port `5000`.\n\n### GET `/steamcollage/games`\n\nReturns a list of games for a given steam ID.\n\n#### Query Parameters {1}\n\n| Name | Type | Description |\n| ---- | ---- | ----------- |\n| `id` | `string` | Steam ID or vanity URL of the user, e.g., alifeee |\n| `cols` | `int` | Number of columns in the collage |\n| `rows` | `int` | Number of rows in the collage |\n| `sort` | `name`, `recent`, or `playtime` | Sort order of the games |\n\n```bash\nwget http://localhost:5000/steamcollage/games?id=alifeee\u0026cols=5\u0026rows=5\u0026sort=recent\n```\n\n![Example image which would be generated by the above API](images/api_collage.png)\n\n### GET `/steamcollage/verifyuser`\n\nReturns a boolean indicating whether a given steam account exists, and whether it is private.\n\n#### Query Parameters {#2}\n\n| Name | Type | Description |\n| ---- | ---- | ----------- |\n| `id` | `string` | Steam ID or vanity URL of the user, e.g., alifeee |\n\n```bash\nwget http://localhost:5000/steamcollage/verifyuser?id=alifeee\n```\n\n```json\n{\n  \"exists\": true,\n  \"private\": false\n}\n```\n\n### GET `/steamcollage/alive`\n\nReturns \"Alive\" if the server is running.\n\n```bash\nwget http://localhost:5000/steamcollage/alive\n```\n\n```text\n\"Alive\"\n```\n\n### GET `/steamcollage/alive_img`\n\nReturns an image if the server is running.\n\n```bash\nwget http://localhost:5000/steamcollage/alive_img\n```\n\n![Lovely picture of a sheep](./sheep.png)\n\n## Alive check\n\nTo check the API is alive, I use [Testfully] to poll the `/steamcollage/alive` endpoint every hour.\n\n[Testfully]: https://app.testfully.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falifeee%2Fsteam_collage_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falifeee%2Fsteam_collage_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falifeee%2Fsteam_collage_api/lists"}