This IPInfoDB PHP class provides a fast lookup of country, region, city, latitude, longitude, ZIP code as values. The IPInfoDB web service is design for server to server call.
This sample codes can be used in many types of projects such as:
- know where is your web visitors come from
- analyze your web server logs to determine the countries of your visitors
- country blocker
- page redirection according to country
- geotargeting in advertisement
IPInfoDB free API is using IP2Location Lite version. IP2Location Commercial version which provides higher accuracy is available at https://www.ip2location.com/web-service with no restrictions on rate limit.
Below are the methods supported in this class.
Method Name | Description |
---|---|
getCountry | Return country code and country name information of the IP address. |
getCity | Return city information of the IP address, such as region, city, lattitud, longitude, ZIPCode and timezone. |
How to I get the API key?
Please register your API key at https://ipinfodb.com/register.
Is there any restiction for using this web service?
There is a rate limit of 2 connections per second.
Copyright (C) 2018 by IPInfoDB.com, support@ipinfodb.com