# Options Pricing API
> Black-Scholes option-pricing maths as an API, computed locally and deterministically. The black-scholes endpoint prices European call and put options from the spot price, strike, time to expiry, risk-free rate, volatility and an optional dividend yield — Call = S·e^(−qT)·Φ(d1) − K·e^(−rT)·Φ(d2) — returning both prices, the intermediate d1 and d2, and the put-call parity figure. The greeks endpoint computes the full set of option sensitivities for the call and the put: delta, gamma, theta (per year and per day), vega and rho, the quantities traders use to hedge and manage risk. The implied-volatility endpoint inverts the model, solving by bisection for the volatility that reproduces a given option market price. Rates, volatilities and dividend yields are decimals (0.05 = 5 %) and time to expiry is in years. Everything is computed locally and deterministically, so it is instant and private. Ideal for fintech, trading, quantitative-finance and derivatives app developers, options analytics and risk tools, and finance education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is options pricing; for NPV and IRR use an NPV API and for CAGR and real returns an investment API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/options-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($15/Mo) — 40,000 calls/Mo, 5 req/s
- **Pro** ($39/Mo) — 300,000 calls/Mo, 15 req/s
- **Mega** ($119/Mo) — 2,000,000 calls/Mo, 40 req/s

## Endpoints

### Options

#### `GET /v1/black-scholes` — Option price

**Parameters:**
- `spot` (query, required, string) — Spot price Example: `100`
- `strike` (query, required, string) — Strike price Example: `100`
- `time` (query, required, string) — Time to expiry (years) Example: `1`
- `rate` (query, required, string) — Risk-free rate (decimal) Example: `0.05`
- `dividend_yield` (query, optional, string) — Dividend yield (decimal) Example: `0`
- `volatility` (query, required, string) — Volatility (decimal) Example: `0.2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/options-api/v1/black-scholes?spot=100&strike=100&time=1&rate=0.05&dividend_yield=0&volatility=0.2"
```

**Response:**
```json
{
    "data": {
        "d1": 0.35,
        "d2": 0.15,
        "note": "Black-Scholes-Merton. Call = S·e^(−qT)·Φ(d1) − K·e^(−rT)·Φ(d2); put by parity. Rates/vol are decimals; time in years.",
        "inputs": {
            "rate": 0.05,
            "spot": 100,
            "time": 1,
            "strike": 100,
            "volatility": 0.2,
            "dividend_yield": 0
        },
        "put_price": 5.573518,
        "call_price": 10.450575,
        "put_call_parity": 4.877058
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:00.614Z",
        "request_id": "e420d234-4aa8-4575-9b55-452d7c07c557"
    },
    "status": "ok",
    "message": "Black-Scholes",
    "success": true
}
```

#### `GET /v1/greeks` — Option Greeks

**Parameters:**
- `spot` (query, required, string) — Spot price Example: `100`
- `strike` (query, required, string) — Strike price Example: `100`
- `time` (query, required, string) — Time to expiry (years) Example: `1`
- `rate` (query, required, string) — Risk-free rate (decimal) Example: `0.05`
- `dividend_yield` (query, optional, string) — Dividend yield (decimal) Example: `0`
- `volatility` (query, required, string) — Volatility (decimal) Example: `0.2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/options-api/v1/greeks?spot=100&strike=100&time=1&rate=0.05&dividend_yield=0&volatility=0.2"
```

**Response:**
```json
{
    "data": {
        "put": {
            "delta": -0.363169,
            "rho_per_1pct": -0.418905,
            "theta_per_day": -0.004542,
            "theta_per_year": -1.657881
        },
        "call": {
            "delta": 0.636831,
            "rho_per_1pct": 0.532325,
            "theta_per_day": -0.017573,
            "theta_per_year": -6.414028
        },
        "note": "Gamma and vega are the same for calls and puts. Vega and rho are per 1 % move; theta per year and per day.",
        "gamma": 0.018762,
        "inputs": {
            "rate": 0.05,
            "spot": 100,
            "time": 1,
            "strike": 100,
            "volatility": 0.2,
            "dividend_yield": 0
        },
        "vega_per_1pct": 0.37524
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:00.723Z",
        "request_id": "d23d287d-449f-49a6-bae1-390d75c7b52d"
    },
    "status": "ok",
    "message": "Greeks",
    "success": true
}
```

#### `GET /v1/implied-volatility` — Implied volatility

**Parameters:**
- `spot` (query, required, string) — Spot price Example: `100`
- `strike` (query, required, string) — Strike price Example: `100`
- `time` (query, required, string) — Time to expiry (years) Example: `1`
- `rate` (query, required, string) — Risk-free rate (decimal) Example: `0.05`
- `dividend_yield` (query, optional, string) — Dividend yield (decimal) Example: `0`
- `price` (query, required, string) — Option market price Example: `10.45`
- `type` (query, optional, string) — call or put Example: `call`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/options-api/v1/implied-volatility?spot=100&strike=100&time=1&rate=0.05&dividend_yield=0&price=10.45&type=call"
```

**Response:**
```json
{
    "data": {
        "note": "The Black-Scholes volatility that reproduces the given option price, found by bisection.",
        "inputs": {
            "rate": 0.05,
            "spot": 100,
            "time": 1,
            "type": "call",
            "price": 10.45,
            "strike": 100,
            "dividend_yield": 0
        },
        "implied_volatility": 0.199985,
        "implied_volatility_percent": 19.9985
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:00.801Z",
        "request_id": "28351862-be5e-4ad8-8886-b01d701ef35f"
    },
    "status": "ok",
    "message": "Implied vol",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/options-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Spot/strike in the same currency, time to expiry in years, rate/volatility/dividend_yield as decimals (0.05 = 5 %). European options.",
        "service": "options-api",
        "formulae": {
            "d1": "(ln(S/K) + (r − q + σ²/2)·T)/(σ√T)",
            "call": "S·e^(−qT)·Φ(d1) − K·e^(−rT)·Φ(d2)",
            "put_call_parity": "C − P = S·e^(−qT) − K·e^(−rT)"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/greeks": "Delta, gamma, theta, vega and rho for the call and the put.",
            "GET /v1/black-scholes": "Call and put prices and d1/d2 from spot, strike, time, rate and volatility.",
            "GET /v1/implied-volatility": "The volatility that reproduces a given option market price."
        },
        "description": "Black-Scholes option pricing: call and put prices, the option Greeks (delta, gamma, theta, vega, rho), and implied volatility from a market price."
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:00.877Z",
        "request_id": "09b7eb3d-c793-47b8-b547-4a2bd48c76d7"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/options-api
OpenAPI spec: https://www.oanor.com/api/options-api/openapi.json
