# Option Chain Quickstart

> Request an OptionData option chain for one underlying, read which session it covers, and narrow chains that exceed response guardrails.

The Option Chain API returns per-contract chain rows for one underlying. Set `date` to `YYYY-MM-DD` to request a specific session; if omitted, the most recent available session is returned.

## 1. Request a chain

Store your API key in `OPTIONDATA_API_KEY`, then run:

```bash
curl -X POST https://www.optiondata.io/api/option-chain \
  -H "Authorization: Bearer $OPTIONDATA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "symbol": "AAPL",
    "put_call": "CALL"
  }'
```

The response contains:

- `data`: per-contract rows such as strike, expiration, bid/ask, open interest, IV, and Greeks.
- `meta.trading_date`: the trading session returned.
- `meta.as_of`: the latest update represented in the response, or `null` when unavailable.


## 2. Narrow a large chain

If the request returns HTTP `422` `REQUEST_TOO_BROAD`, the chain has too many contracts for one response. The response's `error.hints` names the filters your request did not use. Requesting `CALL` and `PUT` separately is usually enough, even for the largest chains such as `SPXW`. Retrying the same request returns the same `422`, so change it first. Narrow it with one or more supported filters:

```json
{
  "symbol": "AAPL",
  "expiration_date": "YYYY-MM-DD",
  "put_call": "CALL",
  "strike_min": 150,
  "strike_max": 250
}
```

Use an expiration date that exists in that session's chain. The endpoint rejects over-broad requests instead of silently returning a partial chain.

## 3. Understand access errors

- `401`: missing or invalid key.
- `403`: recognized customer without active/trialing entitlement.
- `422`: request too broad; follow `error.hints` instead of retrying unchanged.
- `429`: rate limited; honor the `Retry-After` header.
- `504`: query timed out; narrow the filters.

The Option Chain endpoint returns chain state, not individual trades. Use [Historical SQL Quickstart](/docs/historical-sql-quickstart) for trades and flow.

See [Option Chain API](/docs/option-chain-api) for the complete request and response contract.
