Capovex Data Center API
Market data for Indian exchanges over one API: candles in ten timeframes, every stored tick with five levels of depth, live quotes, the instrument master and option chains.
Quick start
Find the instrument
Every instrument is a segment and a number. Search once and keep the id.
GET /v1/instruments?q=SBIN&seg=nse → "seg":"nse","id":3045
Load its candles
Ask for a timeframe; page back in time with nextCursor.
GET /v1/bars/nse/3045?tf=5m&limit=500
→ {"bars":[…],"nextCursor":1796120100}Receive live candles
Subscribe on the stream; a message arrives when each candle closes.
{"op":"sub","ids":["nse:3045"],"tf":["5m"]}
← {"e":"candle",…,"closed":true}Keys and limits
Every request carries one header. A key looks like ccdc_<key id>_<secret>; the data center stores only a keyed hash of the secret, so a lost key is replaced, never recovered.
x-api-key: ccdc_app1_••••••••••••••••
Each key has its own request rate and a list of scopes. A call outside the key's scopes answers 403 forbidden; too many calls answer 429 with a Retry-After header in seconds.
| Scope | Opens |
|---|---|
| any key | Instrument master, /v1/status (no key needed) |
| bars | Candles, all timeframes |
| ticks | Stored ticks and live quotes |
| chains | Option chains |
| live | Candle stream (WebSocket) |
| Limit | Value | When you reach it |
|---|---|---|
| Requests per key | Set per key when it is issued | 429 rate_limited with Retry-After |
| Candles per request | 5,000 | Page back with cursor |
| Ticks per request | 10,000 | Page back with cursor |
| Quotes per request | 200 instruments | 422 |
| Stream subscriptions per connection | 5,000 | too_many_subscriptions, connection closes |
| Instruments per stream message | 500 | too_many_ids |
Request desk
Pick an endpoint, set the parameters, and send. The answer is shown as a table and as raw text; the code to make the same call is underneath.
Live candle stream
A WebSocket at wss://cdc.capovex.in/stream. Subscribe to instruments and timeframes; the forming candle arrives a few times a second, and a message with "closed":true arrives the moment a candle is final, so an application never has to poll.
Endpoints
| Call | Returns | Parameters | Scope |
|---|---|---|---|
GET /v1/bars/{segment}/{id} | Candles, oldest first, with nextCursor to page further back | tf 1m 3m 5m 10m 15m 30m 1h 1d 1w 1M (default 1d) · limit 1–5000 (500) · cursor · from · to (unix seconds) | bars |
GET /v1/ticks/{segment}/{id} | Every stored tick, newest page first, with depth | limit 1–10000 · cursor · from (unix nanoseconds) | ticks |
GET /v1/quotes?ids= | Latest quote and depth for up to 200 instruments | ids = nse:3045,nfo:42730 | ticks |
GET /v1/instruments | Search the instrument master | seg · q · type · underlying · limit · offset | any key |
GET /v1/instruments/{segment}/{id} | One instrument | none | any key |
GET /v1/chains | Underlyings with their expiries | none | chains |
GET /v1/chains/{underlying} | Newest chain snapshot: bid, ask, IV, Greeks, opening OI | expiry YYYY-MM-DD (default: nearest) | chains |
GET /v1/status | Health of the API and its database | none | no key |
WSS /stream | Forming and closed candles, 1m to 1h | messages auth · sub · unsub · ping | live |
Fields
| Candle | |
|---|---|
t | Start of the bucket, unix seconds. Daily candles are stamped 00:00 IST. |
o h l c | Open, high, low, close in rupees |
v | Traded quantity in the bucket |
nextCursor | Pass as cursor for the page before this one; absent at the start of history |
| Quote | |
|---|---|
t · ltt | Receive time (ms) · last trade time (s) |
ltp ltq avg | Last price, last quantity, average price (rupees) |
o h l pc chg chg_pct | Day open, high, low, previous close, change |
v oi tbq tsq | Volume, open interest, total buy and sell quantity |
lc uc | Lower and upper circuit |
bid ask | Five levels each: [price, quantity, orders] |
| Tick (stored exactly as received) | |
|---|---|
r · s | Receive time in nanoseconds · sequence number |
et ltt | Exchange time, last trade time (unix seconds) |
ltp avg o h l pc lc uc | Integers in paise (111470 = ₹1,114.70), so nothing is rounded |
bp bq bo · ap aq ao | Bid and ask price (paise), quantity, orders: five levels each |
feed mode flags | Source feed, packet mode (3 = full), validation flags |
| Option contract | |
|---|---|
expiry strike type | Expiry date, strike, CE or PE |
seg id symbol lot_size | Where the contract trades; use seg:id with the other calls |
bid bid_qty ask ask_qty | Best bid and offer at the snapshot |
iv delta gamma theta vega | Implied volatility (0.15 = 15%) and Greeks |
opening_oi · ltp v oi | Opening open interest · last price, volume and OI from the live feed (0 for a contract that is not on the live feed) |
Formats
| Format | Where | Use it for |
|---|---|---|
| JSON | Every endpoint (default) | Applications and services |
| CSV | Candles: add format=csv. Columns t,o,h,l,c,v, oldest first; the first row's t is the cursor for the page before. | Spreadsheets, pandas, R, back-tests |
| WebSocket JSON | Candle stream, /stream | Live applications |
| OpenAPI 3.1 | /openapi.json | Import into Postman or Insomnia, or generate a client in any language |
import pandas as pd
df = pd.read_csv("https://cdc.capovex.in/v1/bars/nse/3045?tf=1d&limit=5000&format=csv",
storage_options={"x-api-key": "ccdc_<id>_<secret>"})
df["t"] = pd.to_datetime(df["t"], unit="s", utc=True).dt.tz_convert("Asia/Kolkata")
Market rules
| Rule | What it means for you |
|---|---|
| Session only | Candles count the regular session: NSE and BSE cash and F&O 09:15–15:30 IST, MCX 09:00–23:55 IST. Packets before the open and after the close are stored as ticks but never bend a candle. |
| Buckets from the open | A 15-minute candle runs 09:15–09:30, a 1-hour candle 09:15–10:15. The last candle of the day is shorter. |
| Exchange history wins | Today's candles are built from live ticks. When the exchange's own candle for the same minute or day arrives, it replaces ours. |
| Today is included | Daily, weekly and monthly candles include the day in progress; that candle keeps changing until the close. |
| Nothing is deleted | Expired contracts and renamed symbols stay on record. An instrument is always segment:id. |
Errors
Every error has the same body, with a code that never changes and a short explanation.
{"error":{"code":"bad_timeframe","detail":"tf must be 1m 3m 5m 10m 15m 30m 1h 1d 1w or 1M"}}
| Status | Codes | What to do |
|---|---|---|
| 401 | unauthorized | Send a valid key in x-api-key. |
| 403 | forbidden | The key lacks the scope for this call. Ask for the scope to be added. |
| 404 | not_found | Unknown path, or no option chain for that underlying and expiry. |
| 422 | bad_segment bad_instrument bad_timeframe bad_limit bad_cursor bad_from bad_to bad_range bad_expiry bad_underlying unknown_parameter bad_query | Fix the request; detail says which value and what is allowed. |
| 429 | rate_limited | Wait the number of seconds in Retry-After, then continue. |
| 503 | unavailable | The database is busy or restarting. Retry after a second or two. |
| WS | auth_first auth_timeout unauthorized too_many_subscriptions bad_json bad_op bad_ids bad_tf too_many_ids too_large unknown_field | Sent as {"op":"error","code":"…"}, then the connection closes. A client that reads too slowly is also disconnected; reconnect and subscribe again. |
Service status
Read from the data center's own monitor, which checks every service several times a minute and records each incident. One bar is one day (IST); grey means the monitor had not started recording yet.
Changelog
| Date | Change |
|---|---|
| 3 Dec 2026 | Candles as CSV (format=csv). /v1/status/services and this page. OpenAPI description at /openapi.json. Daily, weekly and monthly candles include the day in progress. |
| 3 Dec 2026 | Instruments, quotes and option chains. Candle stream with a closed-candle message on port 7200. |
| 2 Dec 2026 | API v1: candles in ten timeframes and stored ticks with five levels of depth. |