---
title: "Returns filtered information about the current IP."
method: GET
path: "/lookup/{filter}"
---

# Returns filtered information about the current IP.

`GET /lookup/{filter}`

## Request

- Base URL: `https://iplocate.io/api`
- URL: `https://iplocate.io/api/lookup/{filter}`
- Auth: API key in query parameter `apikey`

Returns filtered information about the current IP address. When using URL path filters, only a single filter is allowed.

**Text-only behavior**: Single non-object fields return their value as plain text (e.g., `8.8.8.8` for the `ip` filter).
**JSON behavior**: Object fields (like `asn`, `privacy`) or when using the `?include=` parameter always return JSON.

**Examples**:
- `/lookup/ip` → returns `8.8.8.8` (text)
- `/lookup/asn.asn` → returns `AS15169` (text)
- `/lookup/asn` → returns `{"asn": {...}}` (JSON object)
- `/lookup?include=asn.asn` → returns `{"asn": {"asn": "AS15169"}}` (JSON)
- `/lookup?include=asn.asn,privacy.is_vpn` → returns `{"asn": {"asn": "AS15169"}, "privacy": {"is_vpn": false}}` (JSON)

## Path parameters

- `filter` string, required

## Response `200`

Filtered lookup response. Can be either JSON (partial object) or plain text (single field).

- object: Partial object containing only the requested fields. Structure depends on the filters applied. **Examples**: - `{"ip": "8.8.8.8"}` (single field) - `{"asn": {"asn": "AS15169"}}` (nested field) - `{"asn": {"asn": "AS15169", "route": "8.8.8.0/24"}}` (object field)

## Other responses

- `400`: Invalid IP address.
- `403`: Unknown token or invalid permission.
- `404`: Not found. Please check the IP address.
- `429`: API quota has been reached for the token. Visit https://iplocate.io/pricing.
- `500`: Internal server error or server unavailable.

---

[API](https://skmtc.dev/iplocate/apis/iplocate-io.md) · [All operations](https://skmtc.dev/iplocate/apis/iplocate-io/llms.txt) · [OpenAPI document](https://skmtc.dev/iplocate/apis/iplocate-io/revisions/9f4d9cf31e4b?raw)
