Skip to main content

Introduction

The OptionStrat AI API provides comprehensive endpoints for options trading analysis, strategy building, and AI-powered insights. All endpoints return JSON responses and follow RESTful conventions.

Base URL

http://your-api-domain.com/api

Response Format

All API responses follow a consistent JSON structure:
{
  "status": "success",
  "data": { },
  // endpoint-specific fields
}

Error Handling

The API uses standard HTTP status codes:
  • 200 - Success
  • 400 - Bad Request (invalid parameters)
  • 404 - Resource Not Found
  • 500 - Internal Server Error
Error responses include a descriptive message:
{
  "detail": "Error description"
}

API Categories

Option Chains

Retrieve options chain data, expirations, and live pricing

Calculations

Generate P&L heatmaps and strategy analysis

AI Insights

Greeks calculation and LLM-powered strategy analysis

Recommender

Get AI-recommended strategies based on market bias

Market Data

Market context, sentiment analysis, and insider data

Rate Limits

Rate limiting information will be added in future releases. For now, please be mindful of external API dependencies (Yahoo Finance).

Authentication

Authentication is not currently required for API endpoints. This may change in production deployments.

Quick Start

Here’s a simple example to get started:
# Get available expirations for AAPL
curl http://localhost:8000/api/options/expirations/AAPL

# Get option chain for specific expiration
curl "http://localhost:8000/api/options/chain/AAPL?expiration=2024-12-20"

Data Sources

The API integrates with multiple data providers:
  • Yahoo Finance - Options chains, pricing, and market data
  • YahooQuery - Insider trading information
  • FinViz/VADER - Sentiment analysis
  • Black-Scholes Model - Greeks calculations

Common Parameters

ticker
string
Stock ticker symbol (e.g., “AAPL”, “TSLA”)
expiration
string
Option expiration date in YYYY-MM-DD format
dte
integer
Days to expiration

Next Steps

Explore the specific endpoint categories to learn more about available functionality:

Build docs developers (and LLMs) love