I did something similar: https://ifcfg.me
Also via json: https://ifcfg.me/json
Also via json: https://ifcfg.me/json
Is this on GitHub by chance?
I suspect perhaps s/he's using an older/outdated GeoIP database/service as the AS Number returned for my IP is wrong.
The LAN address lookup (which doesn't work on Safari) is utilising a security hole in WebRTC.