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 |
|---|---|
symbol | Requested symbol |
date | Requested trade date |
atm_strike | Detected at-the-money strike |
count | Number of data rows returned |
generated_at | Response generation timestamp |
version | API response version |
meta | Unit definitions and response metadata |
data | Option-chain rows |
strike | Strike price |
atm_distance | Strike minus ATM strike |
call_iv | Call implied volatility, decimal |
put_iv | Put implied volatility, decimal |
call_delta | Call delta |
put_delta | Put delta |
gamma | Gamma per point |
theta | Theta per day |
spread_bps | Spread in basis points |
tradable | Research filter indicating whether the row passes tradability checks |
10. Plan Limits
| Plan | Daily Limit | Price |
|---|---|---|
| Free | 50 calls/day | ₹0 |
| Starter | 500 calls/day | ₹499/month |
| Pro | 5000 calls/day | ₹1499/month |
| Burst | 5 requests/second per API key | Included |
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 |
|---|---|
| 401 | missing_api_key |
| 401 | invalid_api_key |
| 403 | inactive_api_key |
| 422 | Validation error |
| 429 | rate_limit_exceeded |
| 429 | monthly_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
14. Support
For access, plan details, support, or early-user pricing, email support@afi.codes.