Using the JSON API and ResolveIp we can get the country where a site is hosted:

The following API request returns this JSON response:

Json response example

So we use ResolveIp to get the ip of the site and JsonPathOnUrl on to parse the result:


Note the usage limits from their documentation:

Our system will automatically ban any IP addresses doing over 250 requests per minute. You are free to use for non-commercial use. We do not allow commercial use without prior approval.

Note that I added a interval between request of 240ms between requests using HttpSettings to make sure my IP won't get blocked.