Wordle Solver
You're going to programmatically play Wordle! This is a tiny, stateless API that scores guesses against 100 pre-programmed puzzles: you send an array of words and get back one row of colored tiles per guess. For example:
curl -X POST 'https://wordle.rdme.io/game/1' -d '["crane","slate","adieu"]'Game number N always maps to the same answer (game 1 is always PIZZA), so every request is fully deterministic. There's no database and no server-side state. The full docs are below.
The challenge
Build a tool that solves all 100 games with the lowest average score (number of guesses). There's no real target to hit. We just want to see how you work through it and iterate to improve your total.
Your output should look something like this, but feel free to be creative:
Game Answer Guesses
1 TINGE 4
2 REPEL 3
3 PLAIN 4
...
100 GUANT 3
Solved: 98/100
Average guesses: 3.66Quick start
Send a POST to /game/:n with a JSON array of guesses:
curl -X POST https://wordle.rdme.io/game/1 \
-H 'Content-Type: application/json' \
-d '["SOARE"]'{
"game": 1,
"guesses": ["SOARE"],
"grid": ["⬜️⬜️🟨⬜️⬜️"],
"board": "⬜️⬜️🟨⬜️⬜️",
"solved": false
}Because there is no state, add the next guess to the array to get the next row:
curl -X POST https://wordle.rdme.io/game/1 \
-H 'Content-Type: application/json' \
-d '["SOARE","PIZZA"]'{
"game": 1,
"guesses": ["SOARE", "PIZZA"],
"grid": ["⬜️⬜️🟨⬜️⬜️", "🟩🟩🟩🟩🟩"],
"board": "⬜️⬜️🟨⬜️⬜️\n🟩🟩🟩🟩🟩",
"solved": true
}Want just the raw grid? Add ?format=text:
curl -X POST 'https://wordle.rdme.io/game/1?format=text' \
-H 'Content-Type: application/json' \
-d '["SOARE","PIZZA"]'
⬜️⬜️🟨⬜️⬜️
🟩🟩🟩🟩🟩Endpoint
POST /game/:n
:n, the game number, an integer from1to100.- Body, a JSON array of guesses, e.g.
["SOARE","TESTY"]. An object form,{ "guesses": [...] }, also works. - Each guess must be exactly 5 letters and must be a real word from Wordle's list of ~12,970 valid guesses. Guesses are case-insensitive.
Query parameters:
?format=text, return the plain emoji grid instead of JSON.?hard=1, play in hard mode (see below).
GET /random
Returns a random valid 5-letter word from the Wordle dictionary (the ~12,970 allowed-guess words). Handy for picking opening words or fuzz-testing a solver.
curl https://wordle.rdme.io/random{ "word": "CRANE" }Add ?format=text to get just the bare word.
Hard mode
Pass ?hard=1 to /game/:n to enforce Wordle's hard mode: every hint a guess reveals must be reused by the guesses that follow it.
- A 🟩 letter is locked to its position, later guesses must keep it there.
- A 🟨 letter must appear again in every later guess, at least as many times as it has been revealed.
If a guess breaks one of these rules the request fails with 400 and a message saying which constraint was violated, e.g. Hard mode: guess 2 ("TRAIN") must keep S in position 1.
Tiles
| Tile | Meaning |
|---|---|
| 🟩 | Right letter, right spot |
| 🟨 | Right letter, wrong spot |
| ⬜️ | Letter is not in the answer |
Duplicate letters follow the real Wordle rule: a letter only lights up as many times as it appears in the answer (greens are assigned first, then yellows). The puzzles deliberately include doubled letters like PIZZA to exercise this.
Errors
Every error response has the same shape: a machine-readable error code and a human-readable message.
{
"error": "wrong_length",
"message": "Each guess must be exactly 5 letters. Bad guess: \"ABC\""
}| Code | Status | Meaning |
|---|---|---|
invalid_game | 400 | Game number isn't an integer from 1 to 100. |
invalid_guesses | 400 | Body wasn't a JSON array of guesses. |
wrong_length | 400 | A guess wasn't exactly 5 letters. |
not_a_word | 400 | A guess isn't in Wordle's list of valid words. |
hard_mode | 400 | A guess broke a hard-mode constraint (see above). |
invalid_json | 400 | Request body wasn't valid JSON. |
not_found | 404 | No such route or method. |
Psst... done early? Here are some bonus ideas.