← All tool references

Travel & Auto · execute

Road Trip Calculator

Build a road-trip budget from total route miles, fuel economy, fuel price, lodging, travelers, food, and other costs.

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/road-trip-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/road-trip-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.

distance · number · required
Enter the route distance you expect to travel, rather than a straight-line distance.
mpg · number · required
Enter the vehicle’s expected miles per gallon under the driving conditions you expect.
fuel_price · number · required
Enter the expected price paid per gallon of fuel.
days · number · required
Enter the number of travel days, including the first day, for the food and lodging estimate.
lodging_per_night · number · required
Enter the expected room cost per night, including known taxes and fees if you want them budgeted.
food_per_day · number · required
Enter the expected food spending per traveler per day.
misc · number · required
Enter one combined allowance for parking, tolls, tickets, and other trip costs.
travelers · number · optional
People included in daily food costs.
{
    "type": "object",
    "properties": {
        "distance": {
            "type": "number",
            "description": "Enter the route distance you expect to travel, rather than a straight-line distance."
        },
        "mpg": {
            "type": "number",
            "description": "Enter the vehicle’s expected miles per gallon under the driving conditions you expect."
        },
        "fuel_price": {
            "type": "number",
            "description": "Enter the expected price paid per gallon of fuel."
        },
        "days": {
            "type": "number",
            "description": "Enter the number of travel days, including the first day, for the food and lodging estimate."
        },
        "lodging_per_night": {
            "type": "number",
            "description": "Enter the expected room cost per night, including known taxes and fees if you want them budgeted."
        },
        "food_per_day": {
            "type": "number",
            "description": "Enter the expected food spending per traveler per day."
        },
        "misc": {
            "type": "number",
            "description": "Enter one combined allowance for parking, tolls, tickets, and other trip costs."
        },
        "travelers": {
            "type": "number",
            "description": "People included in daily food costs."
        }
    },
    "required": [
        "distance",
        "mpg",
        "fuel_price",
        "days",
        "lodging_per_night",
        "food_per_day",
        "misc"
    ],
    "additionalProperties": false
}

Output schema

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

fuel_cost · number
No field description is available.
lodging_cost · number
No field description is available.
food_cost · number
No field description is available.
total_cost · number
No field description is available.
{
    "type": "object",
    "properties": {
        "fuel_cost": {
            "type": "number"
        },
        "lodging_cost": {
            "type": "number"
        },
        "food_cost": {
            "type": "number"
        },
        "total_cost": {
            "type": "number"
        }
    },
    "additionalProperties": false
}

Three-day trip for two travelers

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/road-trip-calculator/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "distance": 600,
    "mpg": 26,
    "fuel_price": 3.399999999999999911182158029987476766109466552734375,
    "days": 3,
    "lodging_per_night": 120,
    "food_per_day": 60,
    "misc": 50,
    "travelers": 2
}'
{
    "ok": true,
    "data": {
        "slug": "road-trip-calculator",
        "result": {
            "values": {
                "fuel_cost": 78.4599999999999937472239253111183643341064453125,
                "lodging_cost": 240,
                "food_cost": 360,
                "total_cost": 728.4600000000000363797880709171295166015625
            },
            "display": {
                "display": "78.46"
            },
            "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.