Endpoint
Query parameters
Target date in YYYY-MM-DD format. Defaults to today’s date if not provided.Validation: Must match the pattern
^\d{4}-\d{2}-\d{2}$Response
The date of this daily game in YYYY-MM-DD format
Array of hint packages. Each package unlocks after a guess is made.
The target country details. Only revealed when the game is over (6 guesses made or game won). Returns
null during active gameplay.Hint unlock logic
Hints are progressively revealed based on gameplay:- Initial state: First hint package is unlocked (1 package visible)
- After each guess: One additional hint package unlocks
- Maximum guesses: 6 attempts
- Game over: All hints become visible when the game ends
app/api/daily/route.ts:140
Example request
Example response
During gameplay (game not finished):Error responses
Invalid date format:400
Server error:
500
Game generation
If no game exists for the requested date, the API automatically generates one:- Selects a random country from the countries database
- Fetches details from RestCountries API
- Retrieves CIA World Factbook data
- Generates hint packages from factbook data
- Stores the game in MongoDB (if available)
- Falls back to Poland if no valid country is found after 5 attempts
The daily game is consistent for all users on a given date. Once generated, it’s cached in the database.