Solved

get city and state from ip address

Posted on 2016-10-20
5
34 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 83

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 26

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 55

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 26

Expert Comment

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

808 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