Probability of profit
Send any position, up to 8 option legs plus stock, to POST /pop and get the chance it makes money,
where it breaks even, and the most it can make or lose.
A credit spread at your own prices
Give each leg's price (per share) to use your broker's fills instead of the delayed market price.
curl -X POST https://www.optionsprofitcalculator.com/api/v1/pop \
-H "Authorization: Bearer $OPC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"symbol": "SPY",
"legs": [
{
"type": "put",
"action": "sell",
"strike": 600,
"expiry": "2026-12-18",
"price": 5.1
},
{
"type": "put",
"action": "buy",
"strike": 590,
"expiry": "2026-12-18",
"price": 2.7
}
]
}'import os
import requests
r = requests.post(
"https://www.optionsprofitcalculator.com/api/v1/pop",
json={
"symbol": "SPY",
"legs": [
{
"type": "put",
"action": "sell",
"strike": 600,
"expiry": "2026-12-18",
"price": 5.1
},
{
"type": "put",
"action": "buy",
"strike": 590,
"expiry": "2026-12-18",
"price": 2.7
}
]
},
headers={"Authorization": "Bearer " + os.environ["OPC_API_KEY"]},
)
data = r.json()
if not data["success"]:
raise RuntimeError(data["error"]["message"])
print(data["data"])const res = await fetch("https://www.optionsprofitcalculator.com/api/v1/pop", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OPC_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"symbol": "SPY",
"legs": [
{
"type": "put",
"action": "sell",
"strike": 600,
"expiry": "2026-12-18",
"price": 5.1
},
{
"type": "put",
"action": "buy",
"strike": 590,
"expiry": "2026-12-18",
"price": 2.7
}
]
}),
});
const { success, data, error } = await res.json();
if (!success) throw new Error(error.message);
console.log(data);function callOpcApi() {
const key = PropertiesService.getScriptProperties().getProperty('OPC_API_KEY');
const body = {
"symbol": "SPY",
"legs": [
{
"type": "put",
"action": "sell",
"strike": 600,
"expiry": "2026-12-18",
"price": 5.1
},
{
"type": "put",
"action": "buy",
"strike": 590,
"expiry": "2026-12-18",
"price": 2.7
}
]
};
const res = UrlFetchApp.fetch('https://www.optionsprofitcalculator.com/api/v1/pop', {
method: 'post',
contentType: 'application/json',
headers: { Authorization: 'Bearer ' + key },
payload: JSON.stringify(body),
muteHttpExceptions: true,
});
const json = JSON.parse(res.getContentText());
if (!json.success) throw new Error(json.error.message);
return json.data;
}This spread takes in $2.40 a share, so netCost is -240 (a credit) and maxLoss is $760.
A covered call
Add a stock leg with a quantity in shares. Its price defaults to underlyingPrice.
curl -X POST https://www.optionsprofitcalculator.com/api/v1/pop \
-H "Authorization: Bearer $OPC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"symbol": "AMD",
"underlyingPrice": 165,
"legs": [
{"type": "stock", "action": "buy", "quantity": 100, "price": 165},
{
"type": "call",
"action": "sell",
"strike": 180,
"expiry": "2027-03-19",
"price": 4.1
}
]
}'import os
import requests
r = requests.post(
"https://www.optionsprofitcalculator.com/api/v1/pop",
json={
"symbol": "AMD",
"underlyingPrice": 165,
"legs": [
{"type": "stock", "action": "buy", "quantity": 100, "price": 165},
{
"type": "call",
"action": "sell",
"strike": 180,
"expiry": "2027-03-19",
"price": 4.1
}
]
},
headers={"Authorization": "Bearer " + os.environ["OPC_API_KEY"]},
)
data = r.json()
if not data["success"]:
raise RuntimeError(data["error"]["message"])
print(data["data"])const res = await fetch("https://www.optionsprofitcalculator.com/api/v1/pop", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OPC_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"symbol": "AMD",
"underlyingPrice": 165,
"legs": [
{"type": "stock", "action": "buy", "quantity": 100, "price": 165},
{
"type": "call",
"action": "sell",
"strike": 180,
"expiry": "2027-03-19",
"price": 4.1
}
]
}),
});
const { success, data, error } = await res.json();
if (!success) throw new Error(error.message);
console.log(data);function callOpcApi() {
const key = PropertiesService.getScriptProperties().getProperty('OPC_API_KEY');
const body = {
"symbol": "AMD",
"underlyingPrice": 165,
"legs": [
{"type": "stock", "action": "buy", "quantity": 100, "price": 165},
{
"type": "call",
"action": "sell",
"strike": 180,
"expiry": "2027-03-19",
"price": 4.1
}
]
};
const res = UrlFetchApp.fetch('https://www.optionsprofitcalculator.com/api/v1/pop', {
method: 'post',
contentType: 'application/json',
headers: { Authorization: 'Bearer ' + key },
payload: JSON.stringify(body),
muteHttpExceptions: true,
});
const json = JSON.parse(res.getContentText());
if (!json.success) throw new Error(json.error.message);
return json.data;
}Reading the result
probabilityOfProfit: the chance of making at least $0.01 at the earliest expiry, from 0 to 1.probabilityOf50PctMaxProfit,probabilityOf75PctMaxProfit,probabilityOfMaxProfit: useful for deciding when to take profits.breakevens: stock prices at expiry, each withprofitWhenaboveorbelow.maxProfitandmaxLoss, withmaxProfitUnlimited/maxLossUnlimitedfor naked positions.collateral: estimated margin for naked short options.
How it's calculated
A lognormal model of the stock price, with the 30-day implied volatility (IV30), the same as the calculator.
Pass iv30 to use your own volatility, or underlyingPrice to evaluate at a different stock price.
Probability of profit is a statistical estimate, not a prediction. Real prices jump, and volatility changes.