Requests and responses
Every endpoint speaks JSON over HTTPS and answers with the same envelope.
Requests
- Base URL:
https://www.optionsprofitcalculator.com/api/v1 GETendpoints take query parameters.POSTendpoints take a JSON body withContent-Type: application/json.- The full contract is in the OpenAPI spec, which you can use to generate a client.
The response envelope
{"success": true, "data": {"symbol": "AAPL", "price": 344.87}}{
"success": false,
"error": {
"code": "invalid_symbol",
"message": "symbol must be a ticker such as AAPL"
}
}Check success, then read data, or error.code for what went wrong. See Errors.
Conventions
| Money | Dollars for the whole position (100 shares per contract). netCost is negative for a credit. |
|---|---|
| Option prices | Per share, as quoted by brokers. |
| Volatility | Whole percent: 28.5 means 28.5%. |
| Probabilities | 0 to 1. |
| Dates | YYYY-MM-DD, New York market dates. |
| Prices | Delayed by at least 15 minutes. Send your own prices to use live ones. |
Caching
Identical /finder and /calculate requests within 2 minutes return the same result, with X-Cache: HIT.
They still count towards your quota.