Solved

Get country and city by IP

Posted on 2014-04-04
5
495 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 37

Assisted Solution

by:bbao
bbao 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 53

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 53

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

734 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