Solved

Get country and city by IP

Posted on 2014-04-04
5
483 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
ID: 39979583
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
ID: 39979591
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
ID: 39979652
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 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 125 total points
ID: 39979701
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
ID: 39979747
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 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

17 Experts available now in Live!

Get 1:1 Help Now