← All tool references

Finance · not_available

ROI Calculator

Measure return on investment from cost and proceeds.

Open public tool

Overview

Category
Finance
API mode
not_available
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/roi-calculator

View this descriptor as JSON

Execute availability

This tool is documented as a browser capability. Its execute route does not produce a server-side result; when execution is enabled, it responds with browser_interaction_required and points callers to the public tool page.

POST /api/v1/tools/roi-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.

initial_cost · number · required
Enter initial cost for this calculation.
additional_costs · number · required
Enter additional costs for this calculation.
final_value · number · required
Enter final value or proceeds for this calculation.
years · number · required
Enter holding period for this calculation.
{
    "type": "object",
    "properties": {
        "initial_cost": {
            "type": "number",
            "description": "Enter initial cost for this calculation.",
            "minimum": 0
        },
        "additional_costs": {
            "type": "number",
            "description": "Enter additional costs for this calculation.",
            "minimum": 0
        },
        "final_value": {
            "type": "number",
            "description": "Enter final value or proceeds for this calculation.",
            "minimum": 0
        },
        "years": {
            "type": "number",
            "description": "Enter holding period for this calculation.",
            "minimum": 0.01000000000000000020816681711721685132943093776702880859375
        }
    },
    "required": [
        "initial_cost",
        "additional_costs",
        "final_value",
        "years"
    ],
    "additionalProperties": false
}

Output schema

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

net_return · number
Net return calculated by the tool.
roi · number
ROI calculated by the tool.
annualized_roi · number
Annualized ROI calculated by the tool.
cost_basis · number
Total cost basis calculated by the tool.
{
    "type": "object",
    "properties": {
        "net_return": {
            "type": "number",
            "description": "Net return calculated by the tool."
        },
        "roi": {
            "type": "number",
            "description": "ROI calculated by the tool."
        },
        "annualized_roi": {
            "type": "number",
            "description": "Annualized ROI calculated by the tool."
        },
        "cost_basis": {
            "type": "number",
            "description": "Total cost basis calculated by the tool."
        }
    },
    "additionalProperties": false
}

ROI Calculator worked example

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/roi-calculator/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "initial_cost": 10000,
    "additional_costs": 1000,
    "final_value": 13500,
    "years": 2
}'
{
    "ok": true,
    "data": {
        "slug": "roi-calculator",
        "result": {
            "values": {
                "net_return": 2500,
                "roi": 22.727273000000000280351741821505129337310791015625,
                "annualized_roi": 10.782341999999999870851752348244190216064453125,
                "cost_basis": 11000
            },
            "display": {
                "display": "2500"
            },
            "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.