Public APIs
ipapi.co favicon

ipapi.co

Geocoding

Find IP address location information.

ipapi.co's website screenshot

About ipapi.co

ipapi.co provides a REST API for retrieving the geographic location of an IP address. For a given IPv4 or IPv6 address, it returns data including city, region, country, continent, postal code, latitude and longitude, timezone, UTC offset, EU membership status, country calling code, capital, top-level domain, currency, country area and population, languages spoken, ASN, and organization. Hostname lookup is available as an optional beta add-on upon request.

Requests are made via HTTP GET to an endpoint of the form https://ipapi.co/{ip}/{format}/, with responses available in JSON, XML, CSV, YAML, or JSONP. Individual fields can also be requested directly (e.g., country only) rather than the full response. The API can be called from either server-side or client-side code, and can also be used to determine the public IP address of the requesting device.

Code examples are provided for Ruby, Python, PHP, JavaScript, Node.js, jQuery, Java, C#, and Go, making the service usable across a range of programming environments without requiring a specific client library.

Key features

  • REST API to look up city, region, country, and geolocation data for any IP address
  • Supports both IPv4 and IPv6 addresses
  • Returns response in JSON, XML, CSV, YAML, or JSONP format
  • Detects the public IP address of the requesting device
  • Optional beta add-on for hostname/domain lookup associated with an IP
  • Client libraries and code examples for Ruby, Python, PHP, JS, Node.js, jQuery, Java, C#, and Go

Frequently asked questions

What data does the API return for an IP address?

It returns city, region, country, continent, postal code, latitude/longitude, timezone, UTC offset, EU membership, calling code, currency, country area/population, languages, ASN, and organization.

What response formats are supported?

The API supports json, xml, csv, yaml, and jsonp formats.

Does it support IPv6 addresses?

Yes, both IPv4 and IPv6 type addresses are supported.

What languages or platforms have example integrations?

Example code is provided for Ruby, Python, PHP, JavaScript, Node.js, jQuery, Java, C#, and Go, and any language capable of making an HTTP request can consume the API.

Is hostname lookup included by default?

No, hostname is an optional beta add-on that requires contacting ipapi.co to enable it for your account.

Advertise here

Featured products

  • SerpApi - Search API favicon
  • Screenshot Scout favicon
  • TalorData favicon
  • CoreClaw favicon

Show your product to thousands of developers

· 100k monthly pageviews
· 7k newsletter subscribers

Advertise your product