Questions tagged [ip-geolocation]

IP Geolocation refers to services or APIs that provide the capability to locate an address by an IP address.

IP Geolocation refers to services or APIs that provide the capability to locate a certain address by a certain IP address.

The result of the geolocation can include geolocation coordinates (latitude and longitude), country, city, region, postal code, address and others.

It is important to know that IP geolocation is often inaccurate and helps identifying the approximate location of the IP address.

222 questions
92
votes
17 answers

Get Country of IP Address with PHP

Ideally I'm trying to put together a PHP script that I can query from any web browser and it returns the country of the IP address that accessed the PHP script. Is this possible or is there a better solution?
Tristan
  • 3,845
  • 5
  • 35
  • 58
63
votes
2 answers

Best IP to Country Database

We've got a requirement in a couple of our systems to detect a user's country based on their IP address. We'd prefer to use a database rather than a Web Service (to prevent issues with downtime/network access to an externally hosted service) so I'm…
Henry Wilson
  • 3,281
  • 4
  • 31
  • 46
54
votes
6 answers

How does IP geolocating work?

I'm not looking for a service that does this. I'm just curious as to how geolocation works.
weicool
  • 2,613
  • 5
  • 22
  • 19
40
votes
11 answers

Getting a user country name from originating IP address with Ruby on Rails

I want to extract a user country name from visitors' IP addresses. I could get the IP address with remote_ip. But what could be the easiest way to get the country name? It doesn't have to be super accurate. Any ruby library (gem or plugin) to do…
TK.
  • 27,073
  • 20
  • 64
  • 72
32
votes
2 answers

How do some web services recognize I'm logging in from a new location?

I've noticed that several web services (namely Steam, Facebook, Google, etc) are able to detect a new browser/new location, and on some cases, require me to validate it with an emailed code. How do they do that? Do they use a cookie? Some other way?…
Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308
28
votes
5 answers

How does geographic lookup by IP work?

Is which IPs are assigned to which ISPs public information? How do geo IP services obtain this information and maintain this information? How can I personally figure out where a certain IP belongs without using one of these services?
Brian R. Bondy
  • 339,232
  • 124
  • 596
  • 636
27
votes
5 answers

Where are AWS data center locations listed?

I'm failing at Google search today. Is there a page that lists geolocations of the various Amazon AWS server farms? I want to use this data to pick the appropriate farm for a client on a web app, CDN-style. (This isn't programming, but it's for the…
easeout
  • 8,665
  • 5
  • 43
  • 51
24
votes
5 answers

get region/city from ip

how can I retrieve the region and the city from an ip? I have found this service: http://api.hostip.info/?ip=xyz.qwe.rty But It doesn't give me accurate info like this: http://www.ipaddresslocation.org/ Do you know some free service? I need to…
michele
  • 26,348
  • 30
  • 111
  • 168
23
votes
9 answers

free country, city database for sql server

have anyone used this before, i need free country, city, IP database for sqlserver
StoneHeart
  • 15,790
  • 32
  • 67
  • 84
18
votes
2 answers

Exactly how accurate is IP Geolocation?

I'm setting up a iPhone tracking system for my friends, so they can submit their location to my website by their iPhone, anywhere, anytime - by WiFi or cellular data. The website will use Google Maps for their coordination's so that my other friends…
MacMac
  • 34,294
  • 55
  • 151
  • 222
18
votes
7 answers

Reliable API to determine an ip address's city and country

I want a reliable API that can be used to determine a city and country from an IP address. My search on Google led to http://ipinfodb.com/ip_location_api.php. It seems perfect but my only concern is the reliability of this service. Does google have…
Gublooo
  • 2,550
  • 8
  • 54
  • 91
14
votes
5 answers

How to calculate the midpoint of several geolocations in python

Is there's a library or a way to calculate the center point for several geolocations points? This is my list of geolocations based in New York and want to find the approximate midpoint geolocation L = [ (-74.2813611,40.8752222), …
mongotop
  • 7,114
  • 14
  • 51
  • 76
13
votes
2 answers

How would I detect all European countries with CloudFlare geolocation

I'm trying to detect whether a user is visiting my website from a European country or not. I'm using the Cloudflare proxy & CDN so have to make use of the headers that they pass on (like so): $country_code = $_SERVER["HTTP_CF_IPCOUNTRY"]; I'm not…
P110
  • 192
  • 2
  • 2
  • 15
13
votes
8 answers

getting users geolocation via html5 and javascript

I am trying to get the users geolocation via the html5 geolcation api, and i use the following snippet for it: if (navigator.geolocation) { var timeoutVal = 10 * 1000 * 1000; navigator.geolocation.getCurrentPosition( displayPosition, …
whatf
  • 6,378
  • 14
  • 49
  • 78
11
votes
2 answers

How to get current country of device without asking for location permission? Flutter

I just want to know the country where the device is at. Not the street, not the city, not the province. Just the country. I should be able to get that sort of coarse information without having to ask the user for location permissions, I see many…
user6288393
  • 187
  • 2
  • 11
1
2 3
14 15