# Look up an address by path

`GET /api/v1/ip/{ip}`

- Authentication: Secret API key as a bearer token
- Billing: As `POST /api/v1/ip`.
- Group: IP

Exactly `POST /api/v1/ip` with the address in the path and the options in the query string, for callers that prefer a plain GET: `GET /api/v1/ip/8.8.8.8?privacy=1`. The response, billing and rate limit are the same.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | string | yes | An IPv4 or IPv6 address. |
| `privacy` | query | boolean | no | Keep nothing about this lookup, not even the seven-day repeat marker. |
| `abuse_contact` | query | boolean | no | Also look up the network's abuse mailbox from the registry's RDAP record. |
| `network_details` | query | boolean | no | Also read the allocation's RDAP record for the network name, organisation, range and registration dates. |
| `hostname` | query | boolean | no | Also resolve and forward-confirm the reverse DNS name; a verified crawler name sets is_crawler. |

## Example request

```bash
curl https://spaw.co/api/v1/ip/8.8.8.8 \
  -H "Authorization: Bearer sk_live_…"
```

## Responses

### 200 — The same body as `POST /api/v1/ip`.

```json
{
    "success": true,
    "data": {
        "ip": "8.8.8.8",
        "version": 4,
        "reason": null,
        "country": "US",
        "city": "Mountain View",
        "is_datacenter": true,
        "risk_score": 40,
        "risk_level": "medium"
    },
    "meta": {
        "credits_used": 1,
        "credits_remaining": 8,
        "cache_hit": false,
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}
```

### 401 — The key is missing, malformed, or revoked.

```json
{
    "success": false,
    "error": {
        "code": "UNAUTHENTICATED",
        "message": "Provide a valid API key as a bearer token.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}
```

### 402 — The balance is empty. The lookup did not run.

```json
{
    "success": false,
    "error": {
        "code": "INSUFFICIENT_CREDITS",
        "message": "Your credit balance is empty.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}
```

### 422 — The request body could not be validated; `error.errors` lists the fields.

```json
{
    "success": false,
    "error": {
        "code": "VALIDATION_FAILED",
        "message": "The email field is required.",
        "errors": {
            "email": [
                "The email field is required."
            ]
        },
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}
```

### 429 — Over 5 requests per second for the key. Retry after the limit resets.

```json
{
    "success": false,
    "error": {
        "code": "RATE_LIMITED",
        "message": "Too many requests. Retry after the limit resets.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}
```

## Error codes

- `UNAUTHENTICATED` — https://spaw.co/docs/errors/UNAUTHENTICATED
- `VALIDATION_FAILED` — https://spaw.co/docs/errors/VALIDATION_FAILED
- `INSUFFICIENT_CREDITS` — https://spaw.co/docs/errors/INSUFFICIENT_CREDITS
- `RATE_LIMITED` — https://spaw.co/docs/errors/RATE_LIMITED

---

Canonical page: https://spaw.co/docs/api/get-ip · OpenAPI document: https://spaw.co/openapi.json · All endpoints: https://spaw.co/docs/api
