# IP2Location API reference

> 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…

Source: https://osinttools.io/apis/ip2location/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

Compiled by OSINTtools.io editors from the vendor's docs, updated Nov 29, 2026. Listing: https://osinttools.io/tools/ip2location/

- Base URL: https://api.ip2location.io
- Authentication: Bearer token in the `Authorization` header. Get a key: https://www.ip2location.io/sign-up A key is optional; keyless requests are limited to 1,000 queries per day. The docs also allow a key query parameter.
- Free tier: yes
- Rate limits: 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.
- Vendor docs: https://www.ip2location.io/ip2location-documentation

## Overview

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.

## Errors

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

## IP geolocation

### Look up the location and network details of an IPv4 or IPv6 address.

`GET /`

- Takes: IP address
- Footprint: 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.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | query | string | no | IPv4 or IPv6 address. Defaults to the address of the caller. Example: 203.0.113.7 |
| `format` | query | string | no | Response format. Example: json One of: json, xml |
| `lang` | query | string | no | ISO 639-1 translation code for continent, country, region and city names. Plus and Security plans only. Example: de |

Response fields:

- `ip` (string): The address looked up
- `country_code` (string): Country code
- `country_name` (string): Country name
- `region_name` (string): Region name
- `city_name` (string): City name
- `latitude` (number): Latitude
- `longitude` (number): Longitude
- `zip_code` (string): ZIP or postal code
- `time_zone` (string): Time zone offset
- `asn` (string): Autonomous system number
- `as` (string): Autonomous system name
- `is_proxy` (boolean): Whether the address is a known proxy
- `isp` (string): Internet service provider (Starter plan and above)
- `domain` (string): Domain of the ISP (Starter plan and above)
- `usage_type` (string): Usage type (Starter plan and above)
- `fraud_score` (integer): Fraud score, 0 to 99 (Security plan)
- `proxy.is_vpn` (boolean): VPN flag (Security plan)
- `proxy.is_tor` (boolean): Tor flag (Security plan)

```bash
curl 'https://api.ip2location.io/' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Example response (200):

```json
{
  "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
}
```

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
