I'm generating random IP addresses on the frontend, then making an call to our free API to validate the "realness" of the IP addresses — mainly to remove bogon IP addresses, non-routable IPs, and IPs from large ASNs (national ISPs, the DoD, car companies, etc.).
Our free API supports 1,000 requests per day from unique IP addresses, so there shouldn't be any issues for low usage. However, if we get more power users who enjoy the game, I’ll switch to our Lite API service (which is also free, https://ipinfo.io/lite) to validate IP addresses, as it supports unlimited requests.
Let me know if you have any feedback for me :) I made it mostly by "vibe coding", I will write a post about the whole process of it.
Using a dataset-based implementation would require me to have a backend, which is out of the scope of this project. Right now, I'm generating random IPv4 addresses, but if I were generating random IPv6 addresses, I would have to go the database route. For that, I would use our free IPinfo Lite dataset: https://ipinfo.io/lite
My colleagues actually developed an extremely fast algorithm to select truly random IPv6 IPs from a series of CIDRs, which is what you see reflected in our dataset.
Let me know if you have any feedback or suggestions for me, please.