You can fetch the data shown above as JSON by calling this API
https://iploc.habibur.com/api/?ip= .
Send the IP as parameter ip=, or you can keep it empty and the API will use your public IP in place. Aka, your IP.
.
Example :
Calling with an IP address
.
https://iploc.habibur.com/api/?ip=37.19.199.141 .
Or, for your own public IP
.
https://iploc.habibur.com/api/
Credits
IP data are provided by DB-IP, which you can download for free from here.