{
  "openapi": "3.0.1",
  "info": {
    "title": "Options Strategy Calculator",
    "description": "Max profit, max loss, breakevens, ROC/annualized and Black-Scholes probability of profit for 9 options strategies. Your prices, pure math, no data feed.",
    "version": "0.4",
    "x-build-id": "YbCJDfUDd3h5Wbszq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/xprm-llc~options-strategy-calculator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-xprm-llc-options-strategy-calculator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/xprm-llc~options-strategy-calculator/runs": {
      "post": {
        "operationId": "runs-sync-xprm-llc-options-strategy-calculator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/xprm-llc~options-strategy-calculator/run-sync": {
      "post": {
        "operationId": "run-sync-xprm-llc-options-strategy-calculator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "strategy": {
            "title": "Strategy",
            "enum": [
              "cash_secured_put",
              "covered_call",
              "bull_call_spread",
              "bear_call_spread",
              "bull_put_spread",
              "bear_put_spread",
              "iron_condor",
              "pmcc",
              "roll"
            ],
            "type": "string",
            "description": "Which strategy to calculate. One of: cash_secured_put, covered_call, bull_call_spread, bear_call_spread, bull_put_spread, bear_put_spread, iron_condor, pmcc, roll."
          },
          "underlyingPrice": {
            "title": "Underlying price",
            "type": "number",
            "description": "Current price of the underlying stock/ETF, which you supply (no quotes are fetched). Required for all strategies."
          },
          "dte": {
            "title": "Days to expiration",
            "type": "number",
            "description": "Calendar days to expiration of the short leg (new expiry for rolls; short call for PMCC). Required."
          },
          "impliedVolatility": {
            "title": "Implied volatility (%)",
            "type": "number",
            "description": "Annualized implied volatility in PERCENT (30 = 30%), used for probability of profit/ITM. Required."
          },
          "riskFreeRate": {
            "title": "Risk-free rate (%)",
            "type": "number",
            "description": "Optional annual risk-free rate in percent (e.g. 4 = 4%). Default 0.",
            "default": 0
          },
          "contracts": {
            "title": "Contracts",
            "minimum": 1,
            "type": "integer",
            "description": "Number of contracts; dollar outputs = per-share values x 100 x contracts. Default 1.",
            "default": 1
          },
          "label": {
            "title": "Label",
            "type": "string",
            "description": "Optional free-text tag echoed in the output row, e.g. ticker and expiry."
          },
          "putStrike": {
            "title": "CSP: put strike",
            "type": "number",
            "description": "cash_secured_put: strike of the short put."
          },
          "putPremium": {
            "title": "CSP: put premium",
            "type": "number",
            "description": "cash_secured_put: premium received per share (must be < strike)."
          },
          "stockCostBasis": {
            "title": "Stock cost basis",
            "type": "number",
            "description": "covered_call / roll (call): price paid per share for the stock."
          },
          "callStrike": {
            "title": "Covered call: call strike",
            "type": "number",
            "description": "covered_call: strike of the short call."
          },
          "callPremium": {
            "title": "Covered call: call premium",
            "type": "number",
            "description": "covered_call: premium received per share."
          },
          "priorPremiumsCollected": {
            "title": "Wheel: prior premiums per share",
            "type": "number",
            "description": "covered_call (wheel): premiums already collected per share on this position; lowers cost basis.",
            "default": 0
          },
          "shortStrike": {
            "title": "Vertical: short strike",
            "type": "number",
            "description": "Vertical spreads: strike of the option you SELL."
          },
          "shortPremium": {
            "title": "Vertical: short premium",
            "type": "number",
            "description": "Vertical spreads: premium per share of the sold option."
          },
          "longStrike": {
            "title": "Vertical: long strike",
            "type": "number",
            "description": "Vertical spreads: strike of the option you BUY."
          },
          "longPremium": {
            "title": "Vertical: long premium",
            "type": "number",
            "description": "Vertical spreads: premium per share of the bought option."
          },
          "longPutStrike": {
            "title": "IC: long put strike",
            "type": "number",
            "description": "iron_condor: long (protective) put strike, lowest strike."
          },
          "longPutPremium": {
            "title": "IC: long put premium",
            "type": "number",
            "description": "iron_condor: premium paid per share for the long put."
          },
          "shortPutStrike": {
            "title": "IC: short put strike",
            "type": "number",
            "description": "iron_condor: short put strike."
          },
          "shortPutPremium": {
            "title": "IC: short put premium",
            "type": "number",
            "description": "iron_condor: premium received per share for the short put."
          },
          "shortCallStrike": {
            "title": "IC/PMCC: short call strike",
            "type": "number",
            "description": "iron_condor / pmcc: short call strike."
          },
          "shortCallPremium": {
            "title": "IC/PMCC: short call premium",
            "type": "number",
            "description": "iron_condor / pmcc: premium received per share for the short call."
          },
          "longCallStrike": {
            "title": "IC/PMCC: long call strike",
            "type": "number",
            "description": "iron_condor: long call strike (highest). pmcc: LEAPS strike (deep ITM, e.g. 80)."
          },
          "longCallPremium": {
            "title": "IC/PMCC: long call premium",
            "type": "number",
            "description": "iron_condor: premium paid for long call. pmcc: LEAPS price paid per share (e.g. 23)."
          },
          "longCallDte": {
            "title": "PMCC: long call DTE",
            "type": "number",
            "description": "pmcc: days to LEAPS expiration; must be greater than dte."
          },
          "longCallImpliedVolatility": {
            "title": "PMCC: long call IV (%)",
            "type": "number",
            "description": "pmcc: optional IV (percent) of the LEAPS; defaults to impliedVolatility."
          },
          "optionType": {
            "title": "Roll: option type",
            "enum": [
              "put",
              "call"
            ],
            "type": "string",
            "description": "roll: type of the short option being rolled, put or call.",
            "default": "put"
          },
          "closeCost": {
            "title": "Roll: buy-to-close cost",
            "type": "number",
            "description": "roll: buy-to-close cost per share of the current option."
          },
          "newPremium": {
            "title": "Roll: new premium",
            "type": "number",
            "description": "roll: premium per share received for the new option."
          },
          "oldStrike": {
            "title": "Roll: old strike",
            "type": "number",
            "description": "roll: strike of the option being closed."
          },
          "newStrike": {
            "title": "Roll: new strike",
            "type": "number",
            "description": "roll: strike of the new option."
          },
          "originalPremium": {
            "title": "Roll: original premium",
            "type": "number",
            "description": "roll: premium originally received per share for the option being closed."
          },
          "calculations": {
            "title": "Batch calculations",
            "type": "array",
            "description": "Optional batch: array of up to 100 objects with the same fields (each with its own 'strategy'). Top-level fields are defaults. Leave empty for a single calculation. One charged result row per valid calculation."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}