Skip to content
OSINTtools.io

IP2Location API

IP geolocation provider with a free lookup demo, free LITE databases and paid proxy and location data.

Base URL
https://api.ip2location.io
Sign-in
Bearer token
Free tier
Free tier
Format
REST
Endpoints
1

Compiled by OSINTtools.io editors from ip2location.io · updated Nov 29, 2026Work on this API? Claim it to keep these docs currentReport a mistake

Introduction

The IP2Location.io web service returns geolocation data for an IPv4 or IPv6 address as JSON or XML. The free plan returns country, region, city, coordinates, ZIP code, time zone, ASN and a proxy flag. Higher plans add fields such as ISP, domain, usage type, and on the Security plan a fraud score and proxy details.

Calls go to https://api.ip2location.io/ with an ip query parameter. A key is sent as a Bearer header (recommended) or in a key query parameter. Requests can also be made without a key, with a lower daily limit. If ip is left out, the address of the caller is looked up.

Which fields come back depends on the plan. The docs list free-plan fields separately from the Starter, Plus and Security additions.

Quick start

  1. Get a key

    Create an account with IP2Location and copy your bearer token (free tier). Where to get it

  2. Make your first request

    Look up the location and network details of an IPv4 or IPv6 address.. Replace YOUR_API_KEY and run it in a terminal, or use Try it on the endpoint.

    curl 'https://api.ip2location.io/' \
      -H 'Authorization: Bearer YOUR_API_KEY'
  3. Read the response

    A 200 response looks like this.

    {
      "ip": "203.0.113.7",
      "country_code": "NL",
      "country_name": "Netherlands",
      "region_name": "Example Region",
      "city_name": "Example City",
      "latitude": 52,
      "longitude": 4,
      "zip_code": "1000 AA",
      "time_zone": "+01:00",
      "asn": "64500",
      "as": "Example Network",
      "is_proxy": false
    }

Authentication

Send your token in the Authorization header as Bearer YOUR_TOKEN.

A key is optional; keyless requests are limited to 1,000 queries per day. The docs also allow a key query parameter.

Get a key from IP2Location

Try it on this page keeps your key in your browser; it is never sent to OSINTtools.io.

Rate limits and pricing

Keyless: 1,000 queries per day (resets 00:00 UTC). Free plan key: 50,000 queries per month. Commercial plans: requests continue past the quota and extra queries are billed as overage.

Free tier.

Errors

StatusMeaning
400Invalid IP address (10001) or invalid language code (10003)
401Invalid API key (10000)
402Insufficient credits (10006)
403Your IP address has been blocked, or translation is not available with your plan (10005, 10004)
429Daily quota exceeded for keyless use (10007)
500Internal server error (10002)

IP geolocation

  • Takes: IP address
  • Passive: the target is not contacted
  • Plan: Any plan; some fields need a paid plan

Returns location, ASN and proxy fields. Starter, Plus and Security plans add more fields. Errors return an error object with error_code and error_message.

Query parameters

ipstringtakes your ip address

IPv4 or IPv6 address. Defaults to the address of the caller.

Example: 203.0.113.7
formatstring

Response format.

Example: jsonDefault: jsonOne of: json, xml
langstring

ISO 639-1 translation code for continent, country, region and city names. Plus and Security plans only.

Example: de
Response fields · 18Show

ipstring

The address looked up

country_codestring

Country code

country_namestring

Country name

region_namestring

Region name

city_namestring

City name

latitudenumber

Latitude

longitudenumber

Longitude

zip_codestring

ZIP or postal code

time_zonestring

Time zone offset

asnstring

Autonomous system number

asstring

Autonomous system name

is_proxyboolean

Whether the address is a known proxy

ispstring

Internet service provider (Starter plan and above)

domainstring

Domain of the ISP (Starter plan and above)

usage_typestring

Usage type (Starter plan and above)

fraud_scoreinteger

Fraud score, 0 to 99 (Security plan)

is_vpnboolean

VPN flag (Security plan)

is_torboolean

Tor flag (Security plan)

curl 'https://api.ip2location.io/' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Replace YOUR_API_KEY with your key
Response
{
  "ip": "203.0.113.7",
  "country_code": "NL",
  "country_name": "Netherlands",
  "region_name": "Example Region",
  "city_name": "Example City",
  "latitude": 52,
  "longitude": 4,
  "zip_code": "1000 AA",
  "time_zone": "+01:00",
  "asn": "64500",
  "as": "Example Network",
  "is_proxy": false
}