Solved

Get country and city by IP

Posted on 2014-04-04
5
479 Views
Last Modified: 2014-04-11
Hello, I need to be able to get the country and city of a website's visitors by IP through a service paid or free (obviously better if it's free) accurately. I if have to download some database files instead of using a service it could work too.

I'm using php, thanks so much.
0
Comment
Question by:ivanblue
5 Comments
 
LVL 37

Assisted Solution

by:Bing CISM / CISSP
Bing CISM / CISSP earned 125 total points
Comment Utility
FYI -  free access to the latest in IP geolocation databases is now available in GeoLite2 Database below.

http://dev.maxmind.com/geoip/legacy/geolite/
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
I have been using  http://smart-ip.net and it seems pretty accurate.   You wouldn't want to buy or download a list, that would be too hard to manage.  There are api's to make your life easy.  With low volume they will be free and higher volume you may have to pay.


The smart-ip.net API docs are easy to read http://smart-ip.net/geoip-api

dim theIP
theIP = xx.xx.xx.xx
http://smart-ip.net/geoip-xml/"&theIP
0
 
LVL 17

Assisted Solution

by:Kent Dyer
Kent Dyer earned 125 total points
Comment Utility
Maxmind
IpChicken
What is my IP

I know what is my IP have APIs exposed for you to work with

ARIN Whois may have some exposed API calls available too
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 125 total points
Comment Utility
I use Maxmind myself but you should know that IP addresses belong to Internet Service Providers and their locations are what you are going to get.  When it tries to locate me, it brings up one of two locations for my ISP, one is about 10 miles northeast and two towns over and the other is 30 miles south and at least two towns distant.
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 125 total points
Comment Utility
Exactly, some of the IP services have different variances of error.  Some services have these variances built in where the free version is kind of close and the paid is scary close.  

It has been a while, but I unscientifically tested a few services and for the areas that I care about.  Smart-ip seemed to have a good accuracy to price (free) ratio for me but your milage will vary.

It's good to test a few services.   But do use an API.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to dynamically set the form action using jQuery.

771 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

14 Experts available now in Live!

Get 1:1 Help Now