Fetch a random game based on optional genre, tag, and price filters. You can also get all available genres and tags.
This API allows you to fetch a single random game from the database, optionally filtered by genres
, tags
, and price
. You can also retrieve all available genres and tags for client-side filter options.
GET /random
— Fetch a random game with filtersGET /genres
— Get all unique genresGET /tags
— Get all unique tags/api/v1/games/random
Parameter | Type | Required | Description |
---|---|---|---|
genres |
string (comma-separated) | No | Genres to filter by (e.g., action,horror ). Case-insensitive and underscores allowed (e.g. survival_horror ) |
tags |
string (comma-separated) | No | Tags to filter by (e.g., multiplayer,co_op ) |
price |
float | No | Maximum price (inclusive). Only games with price ≤ given value are returned. |
{ "name": "Resident Evil", "price": 9.99, "genres": ["Survival Horror", "Action"], "tags": ["Multiplayer", "Horror"] }
{ "message": "No matching game found" }
/api/v1/games/tags
[ "Multiplayer", "Singleplayer", "Co_op", "VR", "Story Rich" ]
/api/v1/games/genres
[ "Action", "Adventure", "Survival Horror", "Strategy", "Simulation" ]
GET https://hishuanigami.com/api/v1/games/random
GET https://hishuanigami.com/api/v1/games/random?genres=action,horror&tags=multiplayer
GET https://hishuanigami.com/api/v1/games/random?price=10
GET https://hishuanigami.com/api/v1/games/genres
GET https://hishuanigami.com/api/v1/games/tags
Returns JSON with the game or list of genres/tags
No game matches the filters
{"message": "No matching game found"}
Unexpected server issue
{"error": "Something went wrong"}