惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
L
LangChain Blog
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
MyScale Blog
MyScale Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
A
About on SuperTechFans
Stack Overflow Blog
Stack Overflow Blog
V
V2EX

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How to Fetch Real-Time Options Chain Data in Python (With...
Salomon · 2026-06-24 · via DEV Community

Salomon

If you've ever tried to pull live options data into a Python script, you've probably hit the same wall I did: the cheapest real-time providers start at $99/mo.

Here's how to do it for $20/mo — or free if you stay within 1,000 credits/day.


What You'll Need

  • Python 3.8+
  • requests library (pip install requests)
  • An API key from market-option.com (free tier available, no card required)

Fetching a Full Options Chain

import os
import requests

API_KEY = os.environ["MARKET_OPTIONS_KEY"]
BASE_URL = "https://market-option.com/api/v1"

def get_chain(ticker: str) -> list[dict]:
    res = requests.get(
        f"{BASE_URL}/options/chain/{ticker}",
        params={"apiKey": API_KEY},
    )
    res.raise_for_status()
    return res.json()["results"]

contracts = get_chain("SPY")
print(f"{len(contracts)} contracts returned")
print(contracts[0])

Each contract in results looks like this:

{
  "details": {
    "contract_type": "call",
    "strike_price": 530,
    "expiration_date": "2026-01-17",
    "ticker": "O:SPY260117C00530000"
  },
  "last_quote": {
    "bid": 3.45,
    "ask": 3.50,
    "midpoint": 3.475
  },
  "greeks": {
    "delta": 0.42,
    "gamma": 0.031,
    "theta": -0.18,
    "vega": 0.29
  },
  "implied_volatility": 0.182,
  "open_interest": 12418
}


Filtering by Expiration and Strike

def get_near_the_money(ticker: str, expiration: str, spot: float, width: float = 0.05):
    """Return contracts within ±width% of spot price."""
    contracts = get_chain(ticker)

    low = spot * (1 - width)
    high = spot * (1 + width)

    return [
        c for c in contracts
        if c["details"]["expiration_date"] == expiration
        and low <= c["details"]["strike_price"] <= high
    ]

atm = get_near_the_money("SPY", "2026-01-17", spot=530)
for c in atm:
    print(
        c["details"]["strike_price"],
        c["details"]["contract_type"],
        c["last_quote"]["bid"],
        c["greeks"]["delta"],
    )


Scanning for High IV Contracts

def high_iv_scan(ticker: str, iv_threshold: float = 0.5) -> list[dict]:
    """Find contracts with IV above threshold."""
    contracts = get_chain(ticker)
    return [
        c for c in contracts
        if c.get("implied_volatility", 0) > iv_threshold
    ]

spikes = high_iv_scan("AAPL", iv_threshold=0.8)
print(f"Found {len(spikes)} high-IV contracts")


What the API Covers

  • Top 100 US equity underlyings (~95% of options volume)
  • Chains, quotes, Greeks, IV, open interest
  • Plain JSON — no SDK needed
  • Pagination via next_url for large chains

Pricing: Free tier gives 1,000 credits/day. Pro is $20/mo with 10,000 credits/minute.


Wrapping Up

Options data doesn't have to be expensive for hobbyist projects or indie algo traders. The examples above are production-ready — just swap in your ticker and you're done.

Try it at market-option.com — new accounts get a 7-day Pro trial automatically.

What would you add to this scanner? Drop a comment below.