GET /v1/roiROI Calculator
Business Utils lf-business-utils
Works out whether an investment paid off, as a percentage. Takes an initial investment plus total return, gain, or a period in years. Returns roi_pct, net_gain, and annualized_roi_pct.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
investment | number | Yes | Initial investment |
return | number | No | Total return (incl. investment) |
gain | number | No | Net gain |
years | number | No | Period in years |
Response Schema
roi_pct (number): Return on investment %
net_gain (number): Net gain
annualized_roi_pct (number): Annualized ROI %
cURL Example
curl 'https://lf-business-utils.laminarforge.dev/v1/roi?investment=<investment>' -H 'Authorization: Bearer lf_YourApiKey'
Python Example
import requests
url = 'https://lf-business-utils.laminarforge.dev/v1/roi'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'investment': '<investment>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())