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:
Returns:

A list of N-letter strings representing all the past Wordle answers, retrieved from a webpage and sorted alphabetically.

Return type:

list[str]

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 N uppercase letters.

Parameters:

Warning

The usefulness of the exclude_past_answers feature 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 if get_past_answers() raises an exception.

Returns:

A list containing all the words from the given file, excluding all words returned by get_past_answers() if exclude_past_answers is True.

Return type:

list[int]

wordle_boss.get_response(target: str, guess: str, /) list[int]

Get the Wordle algorithm’s response to the given guess.

Parameters:
  • target (str) – Target word being guessed.

  • guess (str) – Attempt to guess target.

Returns:

List of feedback values representing the Wordle algorithm’s response to the given target and guess.

Return type:

list[int]

Example:

>>> wb.get_response("SLEEP", "SCREE")
[2, 0, 0, 2, 1]