Click here to Skip to main content
12,951,034 members (53,394 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


8 bookmarked
Posted 14 Jan 2014

LocatorHQ - Get Country/Region/City From IP Address

, 14 Jan 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
Easily get Country, Region and Citry of web visitors from their IP address.

Register FREE Username and API key at[^]

Then, get the data by accessing:<username>&key=<apikey>&ip=<ipaddress>  


Data return in this format:



US,United States,California,Mountain View,34.305,-86.2981, 

Data format suports XML and JSON, just add a parameter of format:<username>&key=<apikey>&ip=<ipaddress>&format=xml<username>&key=<apikey>&ip=<ipaddress>&format=json

For C# ASP.NET, you can get the data at code behind by using WebClient.


string url = "";
WebClient wc = new WebClient();
byte[] ba = wc.DownloadData(url);
string text = System.Text.Encoding.UTF8.GetString(ba); 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
Malaysia Malaysia
Writing programs is an art.

You may also be interested in...

Comments and Discussions

QuestionJust like any amateur API.... Pin
Axel Rietschin15-Jan-14 15:44
memberAxel Rietschin15-Jan-14 15:44 
GeneralNice, but not at all Pin
Lus Oliveira15-Jan-14 0:01
memberLus Oliveira15-Jan-14 0:01 
GeneralMessage Removed Pin
adriancs15-Jan-14 2:42
memberadriancs15-Jan-14 2:42 
GeneralRe: Nice, but not at all Pin
Lus Oliveira15-Jan-14 9:17
memberLus Oliveira15-Jan-14 9:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 15 Jan 2014
Article Copyright 2014 by adriancs
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid