Product Documentation

AFI Codes NSE Options Data API Documentation

Documentation for the AFI Codes NSE Options Data API, including authentication, endpoint usage, parameters, response fields, plan limits, errors, data methodology, and disclaimers.

1. Overview

AFI Codes provides a backtest-ready NSE Options Data API for NIFTY and BANKNIFTY option-chain research. The API is designed for traders, quants, developers, educators, and analysts who need structured end-of-day options data without rebuilding the same preprocessing pipeline for every project.

2. Supported Symbols

  • NIFTY
  • BANKNIFTY

3. Authentication

All protected requests require an API key in the request header. Do not include real API keys in URLs, screenshots, or public repositories.

x-api-key: YOUR_API_KEY

4. Base URL

https://api.afi.codes

5. Endpoint

GET /v1/options/eod

6. Query Parameters

Parameter Description
symbol NIFTY or BANKNIFTY
date Trade date in YYYY-MM-DD format
window Number of strikes around ATM

7. Example Request

curl -H "x-api-key: YOUR_API_KEY" \
"https://api.afi.codes/v1/options/eod?symbol=NIFTY&date=2026-04-30&window=1"

8. Example Response

{
  "symbol": "NIFTY",
  "date": "2026-04-30",
  "atm_strike": 24000,
  "count": 3,
  "generated_at": "2026-05-03T09:48:41Z",
  "version": "v1",
  "meta": {
    "iv_unit": "decimal",
    "theta_unit": "per_day",
    "delta_range": "[-1,1]",
    "gamma_unit": "per_point",
    "spread_unit": "bps"
  },
  "data": [
    {
      "strike": 24000,
      "atm_distance": 0,
      "call_iv": 0.1758,
      "put_iv": 0.1523,
      "call_delta": 0.5193,
      "put_delta": -0.4788,
      "gamma": 0.000806,
      "theta": -21.867,
      "spread_bps": 5.0,
      "tradable": true
    }
  ]
}

9. Response Field Explanation

Field Meaning
symbolRequested symbol
dateRequested trade date
atm_strikeDetected at-the-money strike
countNumber of data rows returned
generated_atResponse generation timestamp
versionAPI response version
metaUnit definitions and response metadata
dataOption-chain rows
strikeStrike price
atm_distanceStrike minus ATM strike
call_ivCall implied volatility, decimal
put_ivPut implied volatility, decimal
call_deltaCall delta
put_deltaPut delta
gammaGamma per point
thetaTheta per day
spread_bpsSpread in basis points
tradableResearch filter indicating whether the row passes tradability checks

10. Plan Limits

Plan Daily Limit Price
Free50 calls/day₹0
Starter500 calls/day₹499/month
Pro5000 calls/day₹1499/month
Burst5 requests/second per API keyIncluded

Free API Access

Free plan registration creates an API key for integration testing. The key is shown once in V1, so copy it and store it safely.

Endpoint

POST /v1/users/register-free

Request

{
  "name": "User Name",
  "email": "user@example.com",
  "phone": "optional"
}

Response for a new user

{
  "status": "created",
  "plan": "free",
  "daily_limit": 50,
  "monthly_limit": 150,
  "burst_limit_per_second": 5,
  "api_key": "afi_free_xxxxx"
}

The Free plan is for integration testing and includes 50 calls/day, 150 calls/month, and 5 requests/second burst protection.

11. Error Codes

Status Error
401missing_api_key
401invalid_api_key
403inactive_api_key
422Validation error
429rate_limit_exceeded
429monthly_limit_exceeded

12. Data Source and Methodology

Raw market data is derived from publicly available NSE FO bhavcopy / derivatives files and compatible fallback sources where required. AFI Codes does not claim official affiliation with NSE.

Data is normalized, enriched, and served through the API. IV and Greeks are computed using a consistent internal methodology.

  • IV is decimal.
  • Theta is per day.
  • Delta range is [-1,1].
  • Gamma is per point.
  • Spread is basis points.

13. Disclaimer

This product is for research, analytics, backtesting, and educational use only. It is not investment advice. No trading profitability is guaranteed. Users should validate outputs independently before using them in trading systems.

14. Support

For access, plan details, support, or early-user pricing, email support@afi.codes.