Api Endpoint

Distance Calculator (Geodesic)

Distance calculator: distance and direction between WGS-84 coordinates: geodesic distance by Vincenty with a haversine fallback, initial and final bearing, the midpoint, and the destination point reached from a start point on a given bearing and distance. Also computes the cumulative length of a supplied coordinate path. Results in metres, kilometres, nautical miles and miles.

Open interactive test console

Offering

Provider
api.duoleads.com
Method
GET
Offering type
Api Endpoint
Transport type
http
Category
Location And Travel
Delivery
Not provided
Pricing model
Not provided
x402 version
2

Endpoint context

URL
https://api.duoleads.com/v1/geo/distance
MIME type
application/json
First seen
2026-10-16T01:50:38.788Z
Last seen
Tags
distance, distance-calculator, haversine, geodesy, Geo

Payment pricing

x402 payment terms are the authoritative price for calling this endpoint.

Payment option 1
0.05 USDC
Atomic price: 50000 · Network: eip155:8453 · Asset: USDC · Scheme: exact
Raw x402 terms
[
  {
    "scheme": "exact",
    "network": "eip155:8453",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amount": "50000",
    "payTo": "0xCD673f7e1daD254347AEab6be0DEFe8b9C6b3A39"
  }
]

Observed health

Status
Healthy
Latest latency
1210 ms
Average latency
984 ms
HTTP status
402
Last checked
Reachability
100% over 14 checks

Latency is measured to the first response headers. A reachable result does not verify response accuracy or merchant identity.

Input schema

{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "const": "http"
    },
    "method": {
      "type": "string",
      "enum": [
        "GET"
      ]
    },
    "queryParams": {
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "description": "distance (default), destination, midpoint or path.",
          "enum": [
            "distance",
            "destination",
            "midpoint",
            "path"
          ],
          "maxLength": 64,
          "default": "distance"
        },
        "lat1": {
          "type": "string",
          "description": "Start latitude.",
          "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
          "maxLength": 64
        },
        "lon1": {
          "type": "string",
          "description": "Start longitude.",
          "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
          "maxLength": 64
        },
        "lat2": {
          "type": "string",
          "description": "End latitude.",
          "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
          "maxLength": 64
        },
        "lon2": {
          "type": "string",
          "description": "End longitude.",
          "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
          "maxLength": 64
        },
        "bearing": {
          "type": "string",
          "description": "Initial bearing in degrees for op=destination.",
          "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
          "maxLength": 64
        },
        "distance_m": {
          "type": "string",
          "description": "Distance in metres for op=destination, 0 to 1e9 (about 25 Earth circumferences); larger values are 400 INVALID_PARAM.",
          "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
          "maxLength": 64
        },
        "path": {
          "type": "string",
          "description": "Comma-separated lat,lon pairs for op=path, at most 200 points.",
          "maxLength": 2048
        },
        "method": {
          "type": "string",
          "description": "vincenty (default, WGS-84) or haversine.",
          "enum": [
            "vincenty",
            "haversine"
          ],
          "maxLength": 64,
          "default": "vincenty"
        }
      },
      "required": []
    }
  },
  "required": [
    "type",
    "method"
  ],
  "additionalProperties": false
}

Output schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "input": {
      "additionalProperties": false,
      "properties": {
        "method": {
          "enum": [
            "GET"
          ],
          "type": "string"
        },
        "queryParams": {
          "properties": {
            "bearing": {
              "description": "Initial bearing in degrees for op=destination.",
              "maxLength": 64,
              "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
              "type": "string"
            },
            "distance_m": {
              "description": "Distance in metres for op=destination, 0 to 1e9 (about 25 Earth circumferences); larger values are 400 INVALID_PARAM.",
              "maxLength": 64,
              "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
              "type": "string"
            },
            "lat1": {
              "description": "Start latitude.",
              "maxLength": 64,
              "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
              "type": "string"
            },
            "lat2": {
              "description": "End latitude.",
              "maxLength": 64,
              "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
              "type": "string"
            },
            "lon1": {
              "description": "Start longitude.",
              "maxLength": 64,
              "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
              "type": "string"
            },
            "lon2": {
              "description": "End longitude.",
              "maxLength": 64,
              "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
              "type": "string"
            },
            "method": {
              "default": "vincenty",
              "description": "vincenty (default, WGS-84) or haversine.",
              "enum": [
                "vincenty",
                "haversine"
              ],
              "maxLength": 64,
              "type": "string"
            },
            "op": {
              "default": "distance",
              "description": "distance (default), destination, midpoint or path.",
              "enum": [
                "distance",
                "destination",
                "midpoint",
                "path"
              ],
              "maxLength": 64,
              "type": "string"
            },
            "path": {
              "description": "Comma-separated lat,lon pairs for op=path, at most 200 points.",
              "maxLength": 2048,
              "type": "string"
            }
          },
          "required": [],
          "type": "object"
        },
        "type": {
          "const": "http",
          "type": "string"
        }
      },
      "required": [
        "type",
        "method"
      ],
      "type": "object"
    },
    "output": {
      "properties": {
        "example": {
          "properties": {
            "data": {
              "properties": {
                "bearing_final": {
                  "type": "number"
                },
                "bearing_initial": {
                  "type": "number"
                },
                "converged": {
                  "type": "boolean"
                },
                "destination": {
                  "properties": {
                    "lat": {
                      "type": "number"
                    },
                    "lon": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "lat",
                    "lon"
                  ],
                  "type": "object"
                },
                "distance": {
                  "properties": {
                    "km": {
                      "type": "number"
                    },
                    "m": {
                      "type": "number"
                    },
                    "mi": {
                      "type": "number"
                    },
                    "nmi": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "m",
                    "km",
                    "nmi",
                    "mi"
                  ],
                  "type": "object"
                },
                "legs": {
                  "type": "integer"
                },
                "method": {
                  "type": "string"
                },
                "midpoint": {
                  "properties": {
                    "lat": {
                      "type": "number"
                    },
                    "lon": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "lat",
                    "lon"
                  ],
                  "type": "object"
                },
                "points": {
                  "type": "integer"
                }
              },
              "required": [
                "method",
                "converged"
              ],
              "type": "object"
            },
            "meta": {
              "properties": {
                "computed_at": {
                  "description": "RFC 3339 UTC with milliseconds",
                  "type": "string"
                },
                "deterministic": {
                  "type": "boolean"
                },
                "disclaimer": {
                  "type": "string"
                },
                "price_usd": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "sources": {
                  "items": {
                    "required": [
                      "id",
                      "version",
                      "published"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "required": [
                "request_id",
                "computed_at",
                "price_usd",
                "deterministic",
                "disclaimer"
              ],
              "type": "object"
            },
            "ok": {
              "const": true
            },
            "route": {
              "const": "/v1/geo/distance"
            },
            "version": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "route",
            "version",
            "data",
            "meta"
          ],
          "type": "object"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "input"
  ],
  "type": "object"
}