Is the MegaBull paper trading API free?
Yes. MegaBull provides a free paper trading API for developers in India. Use it to automate simulated trading strategies, build dashboards, or integrate virtual trading into your apps — at no cost.
Integrate with MegaBull's free paper trading API.
Place simulated orders, fetch positions, holdings, and market watch data using REST endpoints
with your API key. Base URL: https://api.megabull.in
Sign up free at trade.megabull.in and get ₹5 Lakhs virtual capital for paper trading.
Log in, open Profile, and generate an API key. Keys expire after 1 month — regenerate anytime.
Click Authorize below, enter your API key, then use Try it out on any endpoint to call the live API.
All endpoints require the api-key header.
Authentication uses API key (header: api-key).
| Method | Endpoint | Category | Description |
|---|---|---|---|
| GET | /api/user/my | User | Get user profile and virtual money balance |
| GET | /api/marketwatch/my | Market Watch | Get your market watch list |
| GET | /api/marketwatch/instruments | Market Watch | Download all tradable instruments (CSV with instrument tokens) |
| GET | /api/marketwatch/ltp/{instrumentToken} | Market Watch | Get last traded price (LTP) for an instrument |
| POST | /api/order/buysell | Order | Place a buy or sell order |
| PUT | /api/order/buysell/{orderId} | Order | Modify a pending order |
| PUT | /api/order/bulk/cancel | Order | Bulk cancel orders by ID |
| GET | /api/order/my | Order | List open and executed orders |
| GET | /api/position/my | Position | Get open positions |
| GET | /api/holding/my | Holding | Get delivery holdings |
| GET | /api/report/virtual/{start}/{end} | Report | Virtual money report for date range |
| GET | /api/report/monthly/{month}/{year} | Report | Monthly trading P&L report |
| GET | /api/report/monthly/day/{date} | Report | Day-wise positions report |
Order and price endpoints identify a stock or index by its instrumentToken.
Get tokens from GET /api/marketwatch/instruments, which returns a
downloadUrl for a CSV of every tradable instrument.
curl -H "api-key: YOUR_API_KEY" \
https://api.megabull.in/api/marketwatch/instruments {
"downloadUrl": "https://megabull-open.s3.us-east-1.amazonaws.com/Instrument.csv"
}
Add ?redirect=true to get an HTTP 302 redirect straight to the CSV,
e.g. curl -L -H "api-key: …" "…/instruments?redirect=true" -o instruments.csv.
"tradingSymbol","instrumentName","instrumentToken"
"NIFTY 50","NIFTY 50","256265"
"SENSEX","SENSEX","265"
"NIFTY BANK","NIFTY BANK","260105" GET /api/marketwatch/ltp/{instrumentToken} — last traded pricePOST /api/order/buysell — instrumentToken in the request bodyPUT /api/order/buysell/{orderId} — modify an order
The CSV is refreshed whenever the API server starts — re-download it rather than hard-coding tokens.
If the file isn't ready yet, the endpoint returns 503.
Yes. MegaBull provides a free paper trading API for developers in India. Use it to automate simulated trading strategies, build dashboards, or integrate virtual trading into your apps — at no cost.
Include your API key in the api-key request header.
Generate a key from your profile at trade.megabull.in. Keys are valid for one month.
No. This is a paper trading API — all orders use virtual money on MegaBull's stock market simulator. It is ideal for testing algorithms and learning without financial risk.