Skip to content
GET /v1/straight-line

Straight-line depreciation

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/depreciation-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

curl "https://api.oanor.com/depreciation-api/v1/straight-line" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/depreciation-api/v1/straight-line", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/depreciation-api/v1/straight-line");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/depreciation-api/v1/straight-line",
    headers={"x-oanor-key": "oanor_test_..."}
)

Example response

A real response from this endpoint, captured by the latest health check.

{
    "data": {
        "note": "Straight-line: equal annual depreciation = (cost − salvage) / life.",
        "inputs": {
            "cost": 10000,
            "life": 5,
            "salvage": 1000
        },
        "method": "straight-line",
        "schedule": [
            {
                "year": 1,
                "book_value": 8200,
                "accumulated": 1800,
                "depreciation": 1800
            },
            {
                "year": 2,
                "book_value": 6400,
                "accumulated": 3600,
                "depreciation": 1800
            },
            {
                "year": 3,
                "book_value": 4600,
                "accumulated": 5400,
                "depreciation": 1800
            },
            {
                "year": 4,
                "book_value": 2800,
                "accumulated": 7200,
                "depreciation": 1800
            },
            {
                "year": 5,
                "book_value": 1000,
                "accumulated": 9000,
                "depreciation": 1800
            }
        ],
        "total_depreciation": 9000,
        "annual_depreciation": 1800
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:16.288Z",
        "request_id": "bf9b00b2-7335-46f3-81bd-24e29cf4ed64"
    },
    "status": "ok",
    "message": "Straight-line",
    "success": true
}