BYTETOOLS

ipapi.co API

Free IP geolocation API with no key: city, region, country, coordinates, timezone, currency, calling code and ASN in one JSON response. Tested example and live response.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

What is the ipapi.co API?

ipapi.co is an IP geolocation API with a free, key-free tier. A single request returns the network block, city, region, country, postal code, coordinates, timezone, UTC offset, currency, calling code, languages and the ASN and organisation behind the address.

The breadth here is what distinguishes it. Alongside the usual city and country, one response carries the currency code and name, the country's calling code, its TLD, its area and population, whether it is in the EU, and the ASN with the organisation name attached. For localising a checkout — currency, phone prefix, tax jurisdiction — that removes several lookups that would otherwise be separate tables in your own code.

Read the coordinates for what they are. The `network` field in the example, 8.8.0.0/24, is the honest description of what was actually resolved: a block, not a device. The latitude and longitude are a representative point for that block's registration, so they can be a data centre, a regional aggregation point, or in the weakest case a country centroid. Country and timezone are dependable; treating the city as fact will produce visible mistakes for a meaningful minority of users.

Quick facts

Base URL
https://ipapi.co
Authentication
The free tier needs no key. A key raises the quota and unlocks bulk and HTTPS-only features on the paid plans.
Rate limit
Roughly 1,000 requests per day and 30,000 per month per IP on the free tier. Exceeding it returns an error object rather than an HTTP error status.
Pricing
Free below the daily and monthly caps; paid plans lift them.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the ipapi.co API

Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.

1. Look up full location details for an IP address

GET https://ipapi.co/8.8.8.8/json/

curl
curl 'https://ipapi.co/8.8.8.8/json/'
JavaScript (fetch)
const res = await fetch("https://ipapi.co/8.8.8.8/json/");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://ipapi.co/8.8.8.8/json/", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
{
  "ip": "8.8.8.8",
  "network": "8.8.8.0/24",
  "version": "IPv4",
  "city": "Mountain View",
  "region": "California",
  "region_code": "CA",
  "country": "US",
  "country_name": "United States",
  "country_code": "US",
  "country_code_iso3": "USA",
  "country_capital": "Washington",
  "country_tld": ".us",
  "continent_code": "NA",
  "in_eu": false,
  "postal": "94043",
  "latitude": 37.42301,
  "longitude": -122.083352,
  "timezone": "America/Los_Angeles",
  "utc_offset": "-0700",
  "country_calling_code": "+1",
  "currency": "USD",
  "currency_name": "Dollar",
  "languages": "en-US,es-US,haw,fr",
  "country_area": 9629091.0,
  "country_population": 327167434,
  "asn": "AS15169",
  "org": "Google LLC"
}

Parameters

ParameterTypeRequiredDescription
ippathOptionalThe address to look up. Omit it to resolve the caller's own IP. 8.8.8.8
formatpathRequiredResponse format: `json`, `xml`, `csv`, `yaml` or `jsonp`. json
(single field)pathOptional`/{ip}/{field}/` returns one value as plain text — `/8.8.8.8/country/` gives just `US`. country
(own IP)pathOptional`/json/` with no address resolves whatever IP the request came from. json

Response fields

ip / networkstring
The address queried and the CIDR block it belongs to. The block is what was actually resolved.
city / region / region_codestring
Best-guess city and first-level subdivision. The least reliable fields in the response.
country / country_name / country_code_iso3string
Country in two-letter, full-name and three-letter forms.
postalstring
Postal code for the block's registered location, frequently null outside the United States.
latitude / longitudefloat
Representative point for the network block, not a device position.
timezone / utc_offsetstring
IANA timezone name and numeric offset — reliable, since it follows from the country.
currency / currency_name / country_calling_codestring
Currency code and name, and international dialling prefix. Useful for checkout localisation.
asn / orgstring
Autonomous system number and the organisation operating it — here AS15169, Google LLC.
in_eu / country_area / country_populationboolean / float
EU membership flag and country statistics, handy for jurisdiction logic.

What you can build with the ipapi.co API

  • Pre-select currency, language and dialling code at checkout
  • Apply EU-specific consent flows using the in_eu flag
  • Detect hosting and cloud ranges from the ASN and organisation
  • Set a sensible default timezone before the user confirms one
  • Add country and network context to security or fraud logs

Common errors and how to fix them

An error object with HTTP 200

The daily or monthly free-tier quota is exhausted.

Fix: Check for an `error` key on every response, not just a non-2xx status. Cache by IP — the answer for one address does not change hour to hour.

city is null but country is set

The registry holds no city-level data for that block.

Fix: Handle nulls throughout. A null city is more honest than the alternative, which is a plausible-looking wrong city.

Coordinates point at a country centroid

The block has no finer registered location.

Fix: Look for suspiciously round coordinates and a null postal code together — that combination usually means the point is a fallback, not a measurement.

A mobile user's location is far from where they are

Mobile carriers route traffic through regional gateways.

Fix: Mobile IP geolocation is systematically coarse. Use the browser geolocation API when the position genuinely matters.

ipapi.co API — frequently asked questions

Is ipapi.co free without an API key?

Yes, the free tier needs no key or signup, at roughly 1,000 requests a day and 30,000 a month per IP. Paid plans lift the caps and add bulk lookup.

How accurate is the city returned by IP?

City is the weakest field. Country is right the large majority of the time and timezone follows from it, but city-level accuracy varies enormously by network — reliable for fixed broadband in dense areas, poor for mobile and corporate traffic.

Can I fetch just one field?

Yes. `/{ip}/{field}/` returns a single value as plain text, so `/8.8.8.8/country/` gives `US` and nothing else. That is the cheapest form when you only need one attribute.

Does it identify VPNs and proxies?

Not directly on the free tier, but the `asn` and `org` fields make hosting providers obvious — an address registered to a cloud or hosting company is very unlikely to be a residential user.

Tools that pair with this API

ipapi.co is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.