From Ticker to Option Contract: Designing a Fast Multi-Step Financial Workflow

"Find me a call about 30 days out with a delta near 0.30." It is a one-line request for a trader, and several API calls for a developer. You need the stock's price, the list of expirations, the right chain, and then a filter to pick one contract.

The order of those calls decides how fast the answer arrives. This guide builds the workflow in Python and shows two ways to cut the wait: run independent calls at the same time, and remember what does not change during the day.

Prerequisites

  • A SteadyAPI API key on a paid plan. The Free plan excludes the Options Data API.
  • Python 3.8+ with requests. Everything else is the standard library.

The steps and what each one needs

1. Stock quote: GET /v1/markets/stock/quotes (weight 2). It gives the current price in regularMarketPrice. 2. Expirations: GET /v3/markets/options (weight 2). A call without expiration returns the default chain and meta.expirations, which lists every date as weekly and monthly in YYYY-MM-DD format. 3. Target chain: the same endpoint with expiration set. The body has Call and Put lists. 4. Contract choice: no call. The chain already has bidPrice, askPrice, delta, volatility, openInterest and daysToExpiration for each contract.

Two facts shape the design.

  • The chain is the contract quote. There is no separate call for one option. A quotes request for a symbol like AAPL|20261113|352.50P returns Invalid tickers. Read bid, ask and tradeTime from the chain row.
  • Steps 1 and 2 do not depend on each other. The quote does not need the expiration list, and the list does not need the quote. They can run together.

Where the time goes

Done one after the other, the workflow makes three calls in a row: quote, default chain, target chain. The wait is the sum of all three.

The faster version has two changes:

  • Parallel. Send the quote request in a background thread while the main thread fetches the chain. The wait for those two steps becomes the longer of the two, not the sum.
  • Remember the expirations. The list of expiration dates does not change during a trading day. After the first lookup for a symbol, store it. The next request can skip the default chain and go straight to the target chain, in parallel with the quote.

There is one more saving. If the default chain already is the expiration you want, the script reuses it and skips the third call.


The code

import time
from concurrent.futures import ThreadPoolExecutor
from datetime import date, datetime

import requests

API_KEY = "YOUR_STEADYAPI_KEY"
BASE = "https://api.steadyapi.com"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
calls = []  # one entry per API call, so we can count requests
_expirations = {}  # (symbol, day) -> sorted list of expiration dates


def get(path, **params):
    calls.append(path)
    r = requests.get(f"{BASE}{path}", headers=HEADERS, params=params, timeout=30)
    r.raise_for_status()
    data = r.json()
    if data.get("success") is False:
        raise RuntimeError(data.get("message", "Request failed"))
    return data


def num(v):
    try:
        return float(str(v).replace(",", "").replace("%", "").replace("+", ""))
    except ValueError:
        return None


def find_contract(symbol, side="Call", target_delta=0.30, target_dte=30):
    key, rows, started = (symbol, date.today()), None, time.time()
    with ThreadPoolExecutor(max_workers=1) as pool:
        quote_job = pool.submit(get, "/v1/markets/stock/quotes", ticker=symbol)  # runs alongside the chain call

        if key not in _expirations:  # cold: the default chain also tells us every expiration
            first = get("/v3/markets/options", ticker=symbol)
            exp = first["meta"]["expirations"]
            if not exp:
                raise RuntimeError(f"{symbol} has no listed options")
            _expirations[key] = sorted(exp["weekly"] + exp["monthly"])
            rows = first["body"][side]

        best = min(_expirations[key], key=lambda d: abs((date.fromisoformat(d) - key[1]).days - target_dte))
        if not rows or datetime.strptime(rows[0]["expirationDate"], "%m/%d/%y").date().isoformat() != best:
            rows = get("/v3/markets/options", ticker=symbol, expiration=best)["body"][side]
        quote = quote_job.result()["body"][0]

    def liquid(c):
        bid, ask, oi = num(c["bidPrice"]), num(c["askPrice"]), num(c["openInterest"])
        return bid is not None and ask and oi and oi >= 100 and (ask - bid) / ask <= 0.10 and num(c["delta"]) is not None

    candidates = [c for c in rows if liquid(c)]
    if not candidates:
        raise RuntimeError(f"No liquid {side.lower()} on {best}")
    pick = min(candidates, key=lambda c: abs(abs(num(c["delta"])) - target_delta))
    strike, ask = num(pick["strikePrice"]), num(pick["askPrice"])
    return {"contract": pick["symbol"], "spot": quote["regularMarketPrice"], "delta": pick["delta"],
            "bid_ask": f'{pick["bidPrice"]} / {pick["askPrice"]}', "iv": pick["volatility"],
            "breakeven": round(strike + ask if side == "Call" else strike - ask, 2),
            "seconds": round(time.time() - started, 1)}


for run in ("cold", "warm"):
    before = len(calls)
    result = find_contract("AAPL")
    print(run, result, "| calls:", len(calls) - before)
print(find_contract("AAPL", side="Put", target_delta=0.25, target_dte=45))

How it behaves:

  • Choosing the expiration. min() picks the date whose distance from today is nearest to target_dte. It looks at weeklies and monthlies together.
  • Cold and warm. The first call for a symbol has to read the expirations. Later calls for the same symbol on the same day do not.
  • The liquidity filter. A contract must have an ask, open interest of at least 100, and a spread of no more than 10% of the ask. Without this, the closest delta can land on a contract nobody trades.
  • Delta sign. Call deltas are positive and put deltas are negative, as in "-0.3842". The script compares absolute values.
  • Breakeven. Strike plus ask for a call, strike minus ask for a put. It ignores commissions.
  • Clear failures. An unknown ticker, or one with no options, raises has no listed options. The options endpoint returns an empty expirations list for those, so the script checks for it.

A run

cold {'contract': 'AAPL|20261211|370.00C', 'spot': 355.63, 'delta': '0.2779', 'bid_ask': '3.40 / 3.60', 'iv': '20.61%', 'breakeven': 373.6, 'seconds': 5.4} | calls: 3
warm {'contract': 'AAPL|20261211|370.00C', 'spot': 355.63, 'delta': '0.2779', 'bid_ask': '3.40 / 3.60', 'iv': '20.61%', 'breakeven': 373.6, 'seconds': 2.9} | calls: 2
{'contract': 'AAPL|20261224|330.00P', 'spot': 355.63, 'delta': '-0.1762', 'bid_ask': '3.00 / 3.25', 'iv': '25.90%', 'breakeven': 326.75, 'seconds': 2.8}

The first two runs return the same contract. The third line is a put search, covered below. The warm run used 2 calls instead of 3, which is 4 request units instead of 6, and it finished in about half the time. These timings are from a local test. Yours depend on your network and your plan, so measure with your own setup.


Check the result, not just the code

The closest liquid contract is not always close. A second run for a put with a target delta of 0.25 and 45 days picked a contract with delta -0.1762. The strikes nearer 0.25 had open interest below 100, so the filter skipped them. Weekly expirations often have thin open interest, so a monthly may fit better.

Decide what your app should do about a gap like that. Options include rejecting a pick whose delta is too far from the target, or searching the next expiration.


Count the cost

  • Cold run: quote (2), default chain (2), target chain (2). That is 6 request units, or 4 when the default chain is the target.
  • Warm run: quote (2) and target chain (2). That is 4 units.
  • Limit: the standard limit is 10 requests per second per account. A workflow with two calls in parallel is far below it. A loop over a hundred symbols needs a pause.

Further steps

  • Cache the quote briefly. A few seconds is enough if many users ask about the same stock. See the market holidays guide for lifetimes by market state.
  • Validate input first. Check the ticker before you start. The ticker validation guide shows how.
  • Go deeper on the chain. The options chain analyzer covers put/call ratios and open interest.
  • Add the skew. Compare the picked contract's implied volatility with others on the same expiration. The IV skew guide shows how.

Conclusion

A ticker-to-contract workflow is three steps and a filter. Run the independent calls together, remember the expiration list, and reuse the chain you already have. Then check that the contract you picked is the one you meant.

Create a free account at steadyapi.com (no card required), upgrade to a paid plan to use options data, and read the API documentation for every parameter and ready-made examples in cURL, JavaScript, PHP, and Python.