Broker API Comparison: Margins and Funds
How clearly each Indian broker API states your margins, and whether it can quote a margin before you order.
Every broker API tells you roughly how much money you have. The difference is how much detail sits behind that number. The best APIs break margin down into cash, collateral, span, exposure and option premium, split between the equity and commodity segments, and let you ask what an order will cost in margin before you place it. The weakest give three or four numbers and no way to check anything in advance. Two brokers return their margin figures as a list of labels and amounts meant for displaying on a screen rather than as proper named fields, which makes them awkward to rely on. Most brokers do offer a margin calculator, and several will also quote the reduced margin on a hedged set of orders, which is useful before entering a spread.
Every broker API tells you roughly how much money you have to trade with. The difference is how much detail sits behind that number — and whether you can find out what an order will cost before you place it.
Six things separate a good margin response from a thin one:
- Clear total, used and available figures — the basics
- An opening balance, so you can see how much has moved today
- Collateral from pledged stock, counted separately from cash
- Realised and unrealised profit folded into your margin
- A breakdown into span, exposure and option premium
- A split between the equity and commodity segments
✅ provided · ⚠️ provided with a limitation · ❌ not provided · — not stated in the documentation
What each broker API reports on margins
| Broker | Total / used / available | Opening balance | Collateral | Realised & unrealised | Span / exposure / premium | Segment split | Margin calculator | Hedged basket |
|---|---|---|---|---|---|---|---|---|
| Shared platform — Symphony XTS | ✅ | ✅ | ✅ | ✅ | ✅ | ⚠️ | ⚠️ | ❌ |
| Kotak | ✅ | ❌ | ✅ | ✅ | ✅ | ⚠️ | ✅ | ❌ |
| Zerodha | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Shared platform — Kambala | ✅ | ⚠️ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Upstox | ✅ | ✅ | ✅ | ✅ | ⚠️ | ⚠️ | ✅ | ✅ |
| Nuvama | ✅ | ✅ | ✅ | ✅ | ⚠️ | ✅ | ❌ | ❌ |
| Angel One | ✅ | ❌ | ✅ | ✅ | ⚠️ | ❌ | ✅ | ✅ |
| Groww | ✅ | ✅ | ✅ | ⚠️ | ✅ | ✅ | ✅ | ✅ |
| AliceBlue | ✅ | ✅ | ✅ | ❌ | ⚠️ | ❌ | ✅ | ✅ |
| Fyers | ✅ | ✅ | ✅ | ⚠️ | ❌ | ✅ | ✅ | ⚠️ |
| 5paisa | ✅ | ❌ | ✅ | ❌ | ⚠️ | ⚠️ | ✅ | ✅ |
| Mastertrust | ✅ | ⚠️ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ |
| SAS Online (Stocko) | ⚠️ | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ |
| Motilal | ⚠️ | ✅ | ❌ | ✅ | ❌ | ✅ | ❌ | ❌ |
| Choice | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ⚠️ |
| Dhan | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ |
| Sharekhan | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
The most detailed margin responses
Symphony XTS and Kotak give the most detail by a clear margin. Both break the figures down into cash, collateral, adhoc limits, payin and payout, span, exposure, option premium and value-at-risk, alongside realised and unrealised profit. Kotak goes further still, reporting span and exposure separately for each segment and product type rather than as one number.
Zerodha is the most usable. It has nearly everything the two above have, but it is the only one that returns a clean split between equity and commodity as separate blocks, each with the same shape. That makes the two comparable without any extra work.
Fyers has the cleanest segment split of all. Every line of its funds response carries an equity amount and a commodity amount side by side. It is the easiest structure to read, though it gives less breakdown detail than the three above.
The weakest margin responses
Dhan is the thinnest of the well-documented ones. It gives available balance, opening balance, collateral, utilised and withdrawable — and nothing else. No profit and loss, no span or exposure, no segment split. For a simple cash view that is fine; for margin planning on derivatives it is not.
Three brokers return a display table, not data. Motilal, SAS Online and Mastertrust all return their margin figures as a table of labels and amounts intended for showing on a screen — the sort of thing a person reads rather than a program. Anything reading them has to match on the text of the label, or on a column heading. That is fragile, because a broker renaming a label breaks it silently.
The upside is that this format carries the segment split for free, since equity and commodity arrive as separate columns. It is why SAS Online and Mastertrust are marked ✅ for a segment split despite being thin elsewhere.
Sharekhan gives the fewest figures of all. Cash, what is blocked, what is left, and a single collateral amount — with no split between segments, no payin or payout, no profit and loss, and no span or exposure breakdown.
Five brokers offer no way to check a margin in advance: Motilal, Nuvama, SAS Online, Mastertrust and Sharekhan. Every other broker here offers some form of margin calculator.
Choice is better than its thin documentation suggests. Its margin response covers total, used and available, ledger balance, payin and payout, collateral against assets, and both realised and unrealised profit — more than Dhan gives. It also has a margin calculator that accepts several contracts in one request, so a basket can be priced in one call. What it lacks is any span or exposure breakdown and any segment split, and its documentation does not confirm whether a hedge benefit is applied to a multi-contract request — which is why it is marked with a warning rather than a tick.
Checking margin before you order
Most brokers let you ask what will this order cost me in margin before you send it. This is more useful than it sounds — it is the difference between finding out your margin is short before an order goes in and finding out from a rejection.
Available on: Zerodha, Angel One, Upstox, Dhan, Fyers, Groww, 5paisa, Kotak, AliceBlue, Choice, Symphony XTS and Kambala.
Not available on: Motilal, Nuvama, SAS Online, Mastertrust and Sharekhan.
The quality of the answer varies a lot. Zerodha returns the most complete quote — span, exposure, option premium and a full charges breakdown including brokerage and taxes. 5paisa returns the least — just the margin required and the margin available.
One caveat on Symphony XTS. The platform offers five different margin-check endpoints, but IIFL’s version leaves them all out. This is a good example of why a shared-platform row is a starting point, not a guarantee.
Margin benefit on hedged orders
If you enter a spread — two or more legs that offset each other — the margin should be less than the legs would cost separately. Several APIs will quote you that reduced figure across a group of orders.
Angel One is the clearest, naming the benefit as its own value rather than leaving you to subtract. Upstox returns the margin both before and after the benefit, so the difference is visible. Kambala supports it too, but expects you to compute the benefit yourself by comparing against your current margin.
One quirk worth knowing on Fyers: the order in which you list the legs affects the result. Its documentation states that if the sell order is listed before the buy order, the hedge benefit may not be counted. The same basket in a different sequence can quote a different margin.
A note on collateral
Collateral from pledged stock is reported by nearly every broker, but only as a total amount inside the margin response — not against the individual holding it came from. Only two brokers give it as a named figure you can tie back to your holdings. See the holdings comparison for that.
5paisa deserves credit here. It reports collateral in the most detail of any API in this comparison, separating total collateral value, value after haircut, free stock value and the haircut percentage itself — plus a separate block for mutual fund collateral.
Related help
- Holdings comparison — pledged stock and where collateral comes from
- Order placement comparison
- All six areas — the comparison hub
- Risk management
Frequently asked questions
Can I check the margin required for an order before placing it?▾
With most brokers, yes. Zerodha, Angel One, Upstox, Dhan, Fyers, Groww, 5paisa, Kotak, AliceBlue and both the Symphony XTS and Kambala shared platforms all let you ask what an order will cost in margin before you send it. Motilal, Nuvama and SAS Online do not offer this. Note that IIFL's version of Symphony XTS leaves the margin calculator out even though the platform supports it.
Do broker APIs show margin separately for equity and commodity?▾
Some do and some do not. Zerodha, Fyers, Groww, Nuvama and the Kambala platform give a genuine split. Fyers is the cleanest, returning both an equity and a commodity amount side by side on every line. Angel One, AliceBlue, Dhan and SAS Online return a single combined set of figures with no split at all. Kotak splits by asking for one segment at a time rather than returning both together.
What is the difference between total, used and available margin?▾
Total is everything you have, counting cash plus the value of any collateral. Used is what is currently blocked against open positions and pending orders. Available is what is left to trade with. Nearly every broker API gives you a used figure and an available figure. Fewer give a proper total, and fewer still give your opening balance for the day, which is what lets you see how much has moved since the market opened.
Do broker APIs show the reduced margin on a hedged position?▾
Several do. Angel One, Upstox, Fyers, Groww, 5paisa, AliceBlue and the Kambala platform can quote the margin on a group of orders together, so the benefit of hedging shows up as a lower figure than the orders would cost separately. Angel One names the benefit as its own value. On Fyers the order in which you list the legs affects whether the benefit is counted, so the sequence matters.
Next steps
Thanks for the feedback. Still stuck? Contact support.
Last updated 23 July 2026