Hi @Donald Symmons,
According to the documentation, the old freegeoip API has been deprecated since March 31, 2018.
https://github.com/apilayer/freegeoip/#freegeoip---important-announcement
As of March 31 2018 the old freegeoip API is deprecated and a completely re-designed API is now accessible at [http://api.ipstack.com]. While the new API offers the same capabilities as the old one and also has the option of returning data in the legacy format, the API URL has now changed and all users are required to sign up for a free API Access Key to use the service.
1.Get a free ipstack Account and Access Key
2.Integrate the new API URL
JSON Example: http://api.ipstack.com/186.116.207.169?access_key =YOUR_ACCESS_KEY&output=json&legacy=1
Here's the code for reference:
string ipAddress = "167.220.255.118";
string url = string.Format("http://api.ipstack.com/{0}?access_key=your API Access Key", ipAddress);
using (WebClient client = new WebClient())
{
string json = client.DownloadString(url);
Location location = new Location();
location = new JavaScriptSerializer().Deserialize<Location>(json);
lblPostalCode.Text = location.Country_Name;
}
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.