API Endpoint
Hypothetical Investment Growth
Calculate 'what if I had invested' scenario showing growth from past entry price.
Endpoint
Also supports GET with query parameters.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
investmentAmount | number | — | Investment amount ($) |
startPrice | number | — | Entry price per share ($) |
endPrice | number | — | Current/exit price per share ($) |
dividendYieldPercent | number | 0 | Annual dividend yield (%) |
years | number | 0 | Holding period (years) |
Request Examples
POST (JSON body)
curl -X POST https://likeoptions.com/api/v1/calculate/hypinvest \
-H "Content-Type: application/json" \
-d '{"investmentAmount": 100000, "startPrice": 50000, "endPrice": 6}'GET (query parameters)
curl "https://likeoptions.com/api/v1/calculate/hypinvest?investmentAmount=100000&startPrice=50000&endPrice=6"Response
{
"kind": "hypinvest",
"result": {
"primary": 1234.56,
"secondary": [
{ "label": "Example metric", "value": 100, "format": "money" },
{ "label": "Example percent", "value": 5.5, "format": "percent" }
]
}
}When to Use
- Measure hypothetical returns
- Evaluate investment decisions
- Compare past opportunities
Error Handling
- 400 Bad Request — Invalid input parameters or missing required fields
- 404 Not Found — Unknown calculator kind
- 429 Too Many Requests — Rate limit exceeded (120 req/hour per IP)
- 413 Payload Too Large — Request body exceeds 16 KB
Related Endpoints
View request examples in JavaScript, Python, cURL, and more →