---
title: "Distance (km) between two IP addresses"
method: GET
path: "/ip/distance"
tags: ["IP"]
---

# Distance (km) between two IP addresses

`GET /ip/distance`

## Request

- Base URL: `https://abundanceapis.com`
- URL: `https://abundanceapis.com/ip/distance`
- Auth: none declared

Geolocates both IPs and returns the great-circle distance between them.

## Query parameters

- `ip1` string, required
- `ip2` string, required

## Response `200`

Default Response

- object
  - `ip1` string
  - `ip2` string
  - `location1` object
    - `country` string, nullable
    - `city` string, nullable
    - `latitude` number
    - `longitude` number
  - `location2` object
    - `country` string, nullable
    - `city` string, nullable
    - `latitude` number
    - `longitude` number
  - `distanceKm` number

## Other responses

- `400`: Bad request

---

[API](https://skmtc.dev/abundanceapis/apis/web-toolbox.md) · [All operations](https://skmtc.dev/abundanceapis/apis/web-toolbox/llms.txt) · [OpenAPI document](https://skmtc.dev/abundanceapis/apis/web-toolbox/revisions/ada2893fef43?raw)
