Hey everyone! I'm working on a bot to automatically fetch the daily Wordle word from its HTML and JavaScript. In the previous version, it was pretty straightforward because it used a "gameState" attribute in localStorage. However, it seems like the New York Times has overhauled the setup. I noticed that there aren't any network requests being made to validate guesses, which suggests that the answer must be stored client-side. Does anyone have insights on how I might be able to access the current daily word? Thanks in advance!
4 Answers
I checked an archive just for kicks, and it looks like the page makes a call to `https://nytimes.com/svc/wordle/v2/YYYY-MM-DD.json`. You’d get back a JSON file that includes the solution in plain text among other info. Just make sure to replace the date with the appropriate one!
Just a heads up, the answer could be encrypted on the client side. They might be just verifying the guesses rather than revealing the actual solution, but it seems like it's still in plain text within the JSON.
But actually, it is in plaintext in the JSON.
I get what you mean about hashing for verification, but since the game provides feedback on each letter (gray, green, or yellow), it wouldn't make much sense to hash it all. Plus, people have already shared answers online!
Aren't the Wordle words just stored in a text file that the web app loads up?
Close! It's actually in JSON format, but you got the right idea.
If you're aiming to build a bot, write a script that optimizes the guessing process for speed!
Don't forget to swap in the date for when you need it!