Getting Location from an IP Address
The Ipregistry API enables geolocation lookup for IPv4 or IPv6 addresses. It includes the country, city, region, postal code, borders, population but also carrier data, company, domain name and more.
Below are some common usage patterns for a variety of programming languages and libraries:
tryoutby your own API key before using the following examples in production. The tryout API key used in these examples is heavily rate limited and is meant only for a few initial tests.
220.127.116.11is the client IP address you want to get information for. How to retrieve the client IP address from your server depends on the technology used but usually, you have a header that you can parse such as