Solved

Get country and city by IP

Posted on 2014-04-04
5
490 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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Designing forms 3 69
Pass SQL to JSON. Page is in classic ASP and using Jquery 4 57
SP result not being displayed 5 67
Secure log in 'box' 4 42
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This video teaches users how to migrate an existing Wordpress website to a new domain.

739 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