API: Functions
Important
General API notes: Please do not make use of any undocumented
submodules of wordle_boss (such as wordle_boss.lists). Import
constants from wordle_boss.names and everything else from
wordle_boss.
Additionally, there is no public C API. The C files in this package provide a Python API and nothing else intended for public use.
- wordle_boss.get_past_answers() list[str]
Get an alphabetized list of past Wordle answers from a website.
This function uses a predefined list of webpages, retrieving the HTML of each page and attempting to parse it until one page works.
- Raises:
ValueError – on failure to retrieve a word list from any of the online options.
RuntimeError – if past-answers dependency is not installed.
- Returns:
A list of
N-letter strings representing all the past Wordle answers, retrieved from a webpage and sorted alphabetically.- Return type:
- wordle_boss.get_word_list(filename: str, exclude_past_answers: bool = False, errors: int = 2) list[str]
Get a list of words from the given file.
Leading and trailing whitespace in the file is ignored. Each line of the file must contain a word consisting of
Nuppercase letters.- Parameters:
filename (str) – Name/path of the file to use. Often set to
SHORT_LISTorLONG_LIST.exclude_past_answers (bool) – If True, get a list of all past answers using
get_past_answers()and remove them from the returned list. This requires the past-answers dependency to be installed.
Warning
The usefulness of the
exclude_past_answersfeature is questionable since Wordle began reusing past answers on February 2, 2026.- Parameters:
errors (int) – How to handle any exception raised by
get_past_answers(). If set to 2 (the default), allow the exception to propagate; if set to 1, issue a warning; if set to 0, do nothing. In the last two cases, the returned value will simply contain all the words from the file ifget_past_answers()raises an exception.- Returns:
A list containing all the words from the given file, excluding all words returned by
get_past_answers()ifexclude_past_answersis True.- Return type:
- wordle_boss.get_response(target: str, guess: str, /) list[int]
Get the Wordle algorithm’s response to the given guess.
- Parameters:
- Returns:
List of feedback values representing the Wordle algorithm’s response to the given target and guess.
- Return type:
Example:
>>> wb.get_response("SLEEP", "SCREE") [2, 0, 0, 2, 1]