← All tool references

Travel & Auto · execute

Driving Distance Calculator

Measure a known driving route or estimate straight-line distance between two latitude and longitude points.

Open public tool

Overview

Category
Travel & Auto
API mode
execute
Processing
client-side
Privacy
no-data-stored

Public descriptor

The descriptor is available without an API key and supplies this tool’s metadata, schemas, modes, and examples.

GET /api/v1/tools/driving-distance-calculator

View this descriptor as JSON

Execute availability

This tool has an execute route defined by its descriptor. Server-side execution is currently unavailable, so requests return api_not_launched.

POST /api/v1/tools/driving-distance-calculator/execute

Authentication is not issued during the preview. A bearer API key is planned for execution after launch.

Input schema

object object; additional properties are not accepted.

mode · string · required
Choose which calculation or conversion direction you need. Accepted values: manual, coordinates.
distance · number · optional
Enter the route distance you expect to travel, rather than a straight-line distance.
lat1 · number · optional
Enter the latitude of the starting point in decimal degrees.
lon1 · number · optional
Enter the longitude of the starting point in decimal degrees.
lat2 · number · optional
Enter the latitude of the destination point in decimal degrees.
lon2 · number · optional
Enter the longitude of the destination point in decimal degrees.
{
    "type": "object",
    "properties": {
        "mode": {
            "type": "string",
            "enum": [
                "manual",
                "coordinates"
            ],
            "description": "Choose which calculation or conversion direction you need."
        },
        "distance": {
            "type": "number",
            "description": "Enter the route distance you expect to travel, rather than a straight-line distance."
        },
        "lat1": {
            "type": "number",
            "description": "Enter the latitude of the starting point in decimal degrees."
        },
        "lon1": {
            "type": "number",
            "description": "Enter the longitude of the starting point in decimal degrees."
        },
        "lat2": {
            "type": "number",
            "description": "Enter the latitude of the destination point in decimal degrees."
        },
        "lon2": {
            "type": "number",
            "description": "Enter the longitude of the destination point in decimal degrees."
        }
    },
    "required": [
        "mode"
    ],
    "additionalProperties": false
}

Output schema

On a successful execution, schema values appear in data.result.values.

distance · number
Miles or km depending on unit preference.
method · string
manual or haversine.
{
    "type": "object",
    "properties": {
        "distance": {
            "type": "number",
            "description": "Miles or km depending on unit preference."
        },
        "method": {
            "type": "string",
            "description": "manual or haversine."
        }
    },
    "additionalProperties": false
}

Driving Distance Calculator: Manual distance

The request body follows the published input schema. The response below shows the success-envelope shape returned after execution is available.

curl -X POST "https://utilitypages.org/api/v1/tools/driving-distance-calculator/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "manual",
    "distance": 120
}'
{
    "ok": true,
    "data": {
        "slug": "driving-distance-calculator",
        "result": {
            "values": {
                "distance": 120,
                "method": "manual"
            },
            "display": {
                "display": "120"
            },
            "warnings": [],
            "assumptions": [],
            "steps": []
        }
    },
    "meta": [],
    "request_id": "req_example_123"
}

Errors

api_not_launched · 503
Returned by the current launch gate for every execute request.
invalid_json · 400
Returned when an enabled execute request does not contain valid JSON.
validation_failed · 422
Returned when a request does not satisfy the input schema.
browser_interaction_required · 422
Returned for browser capability tools instead of inventing a server-side result.
tool_not_found · 404
Returned when a requested descriptor slug does not exist.
execution_failed · 503
Returned when an enabled server-side execution cannot complete.