Solved

get city and state from ip address

Posted on 2016-10-20
5
32 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 25

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 54

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 25

Expert Comment

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

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
login jsp example 24 47
Easy responsive table out of existing table 28 55
Where is java script information saved? 2 50
how can i check if the text is an Isogram ? 2 25
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.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

776 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