Solved

get city and state from ip address

Posted on 2016-10-20
5
26 Views
Last Modified: 2016-11-08
I know how to get ip address but I need to know how to get city and name by using javascript. not jquery
0
Comment
Question by:ITsolutionWizard
5 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 200 total points (awarded by participants)
ID: 41853253
It's not available.  IP addresses are assigned to ISPs and hosting companies, not individuals.  While large companies like Google, Amazon, and Facebook keep massive databases that's let's them cross correlate info to identify individuals, they do not make that available to you.  Even getting other people's IP address has to be done on the server with a programming language.
1
 
LVL 23

Assisted Solution

by:Dr. Klahn
Dr. Klahn earned 100 total points (awarded by participants)
ID: 41853256
Dave is correct.  IP to geolocation data is not real good when it comes to quality.  Every web site that uses geolocation thinks I'm 60 miles away, and those sites are paying for commercial quality geolocation.  Usually the state is correct but I would trust it no further than that.

Aside from that, when someone goes through Tor or a VPN they can appear to be coming from anywhere in the world.
0
 
LVL 10

Assisted Solution

by:Jeffrey Dake
Jeffrey Dake earned 100 total points (awarded by participants)
ID: 41853267
http://dev.maxmind.com/geoip/geoip2/geolite2/ Here is where you can get a free database to get the city from the ip, all though it is not as accurate as the paid version. But usually when you see someone looking up the location by ip they are doing some sort of backend lookup into a database like this.
0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 100 total points (awarded by participants)
ID: 41853422
I think with maxmind the difference between paid and free is granularity - data is as accurate you just get more with the paid version.

Another problem with GeoLocation is there is move toward using VPN's - people are jealous of their privacy. The question you need to answer is why do you want to get this information without asking your visitor for it.
0
 
LVL 23

Expert Comment

by:Dr. Klahn
ID: 41878465
EE email requested stale question closure.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now