Docs/Business Utils/GET /v1/roi

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

ParameterTypeRequiredDescription
investmentnumberYesInitial investment
returnnumberNoTotal return (incl. investment)
gainnumberNoNet gain
yearsnumberNoPeriod 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())