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:

Shell
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.66

Quick start

Send a POST to /game/:n with a JSON array of guesses:

Shell
curl -X POST https://wordle.rdme.io/game/1 \
  -H 'Content-Type: application/json' \
  -d '["SOARE"]'
JSON
{
  "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:

Shell
curl -X POST https://wordle.rdme.io/game/1 \
  -H 'Content-Type: application/json' \
  -d '["SOARE","PIZZA"]'
JSON
{
  "game": 1,
  "guesses": ["SOARE", "PIZZA"],
  "grid": ["⬜️⬜️🟨⬜️⬜️", "🟩🟩🟩🟩🟩"],
  "board": "⬜️⬜️🟨⬜️⬜️\n🟩🟩🟩🟩🟩",
  "solved": true
}

Want just the raw grid? Add ?format=text:

Shell
curl -X POST 'https://wordle.rdme.io/game/1?format=text' \
  -H 'Content-Type: application/json' \
  -d '["SOARE","PIZZA"]'

⬜️⬜️🟨⬜️⬜️
🟩🟩🟩🟩🟩

Endpoint

POST /game/:n

Query parameters:

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.

Shell
curl https://wordle.rdme.io/random
JSON
{ "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.

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

TileMeaning
🟩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.

JSON
{
  "error": "wrong_length",
  "message": "Each guess must be exactly 5 letters. Bad guess: \"ABC\""
}
CodeStatusMeaning
invalid_game400Game number isn't an integer from 1 to 100.
invalid_guesses400Body wasn't a JSON array of guesses.
wrong_length400A guess wasn't exactly 5 letters.
not_a_word400A guess isn't in Wordle's list of valid words.
hard_mode400A guess broke a hard-mode constraint (see above).
invalid_json400Request body wasn't valid JSON.
not_found404No such route or method.

Psst... done early? Here are some bonus ideas.