Sharekhan API Algo Trading: Custom Bots on the Trading API
Sharekhan API algo trading means a program that signs in to your own Mirae Asset Sharekhan account through the broker’s free Trading API and places orders when rules you wrote are met. We build that program to order. Sharekhan isn’t one of the ten brokers our ready-made Indian copiers support, so every Sharekhan project starts with a check of what the Sharekhan API allows for your account.
You run the finished software on a computer you control, a home PC or a VPS, signed in with your keys. AlgoDevelop writes code. It isn’t a SEBI-registered intermediary, it gives no tips, and it never holds client money.
On this page
- Sharekhan API algo trading in practice
- Sharekhan API documentation: what the official pages confirm
- How the Sharekhan API key and login work
- Why Sharekhan needs a custom build
- What goes into a custom Sharekhan build
- Questions we settle before quoting
- Static IP and SEBI’s retail algo circular
- How a Sharekhan project runs
- Who is responsible for what
- Sharekhan automation: frequently asked questions
Sharekhan API algo trading in practice
Most requests arrive as one sentence. “Buy the NIFTY call when my TradingView alert fires, only before 11:00, and square off at 3:15.” Another trader wants every call from a paid Telegram channel copied at half size, with a stop for the day after two losses.
The program keeps a session open, waits for its trigger, checks your limits and sends the order. That order then appears in your normal order book, exactly as if you had typed it in the app. Your funds stay with the broker the whole time.
A trigger can be a Telegram channel, a WhatsApp group, a TradingView webhook or logic coded into the program itself. The software checks your limits first on every signal. An order that breaks one gets logged with the reason and is never sent.

Sharekhan API documentation: what the official pages confirm
Mirae Asset Sharekhan publishes a Trading API overview page, a Trading API FAQ, an API documentation section and SDK repositories on GitHub under the Sharekhan-API account. When we read them on 5 November 2026, they said:
- Access is free for all active customers. Orders placed through the API are charged at your existing brokerage rate, with no extra subscription fee.
- Signing up gives you an API Key and a Secure Key. The FAQ says the key can be used as soon as the request is placed.
- Order calls cover new, modify, cancel, square-off, square-off all and cancel all. Products named include normal/investment, BigTrade, BigTrade+, EMF and trailing stop loss for equities, and investment and BigTrade+ for derivatives.
- Reports cover limits, order status, order details, trade book, positions and holdings.
- Market data includes live streaming for all segments, top-five bid and ask depth and open interest. One WebSocket connection takes at most 1,000 symbols.
- Historical data runs from inception as end-of-day data per scrip, plus intraday data for the last 7 days. It is not adjusted for corporate actions.
- Official SDKs exist for Python, Java, JavaScript, Go, .NET, R and PHP. API support is at skapi@sharekhan.com.
Gaps in the published documentation
Two gaps matter for anything automated. The FAQ answer on order rate limits reads “XX orders per second”, so no number is published. None of the pages we read says how long an access token stays valid either. We confirm both for your account before quoting.
The documentation page loads its content through scripts. We could read its section list (login, orders, holdings, funds, historical chart data, ScripMaster, WebSocket streaming and error codes) and the Python SDK’s source code.

How the Sharekhan API key and login work
You create the API key yourself, from your own Sharekhan login, on the Trading API page. Sharekhan’s own YouTube channel has a short video on creating it. We never sign in to your account or ask for your password.
Getting a session takes more steps than at most Indian brokers. Going by the official Python SDK (shareconnectpython), the sequence is:
- The program builds a login link to api.sharekhan.com that carries your API key. You open it and sign in.
- Next, the broker redirects back with an encrypted request token.
- The program decrypts that token with your Secure Key, swaps its two parts (RequestId and CustomerId), encrypts it again and exchanges it for an access token. The SDK uses AES-GCM for this step.
- Every later call sends the API key and the access token in its headers.
Because a person completes step 1, we don’t promise a fully unattended daily start. Whether part of the sign-in can be automated for your account is one of the points we check, and we never bypass an OTP.
Sharekhan API in Python: the token exchange
We adapted this short Python sketch of the same flow from the SDK’s README. It hasn’t been run against a live account, and it leaves out error handling and secure key storage.
# Python 3. pip install shareconnect (Sharekhan's official SDK)
from SharekhanApi.sharekhanConnect import SharekhanConnect
api_key = "YOUR_API_KEY" # from the Trading API page
secure_key = "YOUR_SECURE_KEY" # keep out of source control
login = SharekhanConnect(api_key)
print(login.login_url()) # open this link and sign in yourself
request_token = input("Request token from the redirect: ")
session = login.generate_session_without_versionId(request_token, secure_key)
access_token = login.get_access_token(api_key, session, 12345)
A symbol name isn’t enough to place a trade. Each order needs the broker’s numeric scrip code and an exchange code (“NC” in the README’s NSE cash example), along with a product type such as INVESTMENT or BIGTRADE. Our builds download the ScripMaster file at the start of each session and map names like ONGC or a NIFTY strike to those codes.
Why Sharekhan needs a custom build
Our Telegram to Indian broker copier and TradingView to Indian broker copier work with ten brokers: Zerodha, Groww, Angel One, Upstox, ICICI Direct, 5paisa, Dhan, Fyers, Kotak Neo and Alice Blue. Sharekhan isn’t on that list.
An account at one of those ten can use a ready-made copier today, and the Indian broker overview compares them. For the Sharekhan account itself, the work is a custom adapter written around the token login and scrip codes described above.
What goes into a custom Sharekhan build
Each project follows its written requirement. A typical build contains:
- A Sharekhan adapter for the login, the token exchange and the ScripMaster mapping.
- Order handling for equity and F&O, in the products your account has enabled.
- Your entry and exit rules, coded exactly as you describe them.
- Signal input from Telegram, WhatsApp or TradingView, or no external signal at all.
- Limits you set: a daily order cap, a size ceiling, a maximum number of open positions, a trading window, a square-off time and a kill switch.
- A log of every request and every broker response, with optional Telegram alerts.
- The full source code and documentation, which you keep.
The SDK’s default request timeout is 7 seconds, and an order that timed out may still have reached the exchange. A careful build checks the order book before it retries, so the same order is not sent twice.

Questions we settle before quoting
Before a price goes out, we confirm these points with you and against the broker’s current pages:
- Your account has Sharekhan API access, and you have generated the API Key and Secure Key.
- The segments and products you plan to trade are enabled, F&O included.
- How the daily sign-in works for you, and how long a token lasts.
- The real order rate limit, since the published FAQ shows “XX”.
- How the broker whitelists your static IP.
- Whether your strategy is likely to cross the exchange’s order-per-second threshold for algo registration.
If something you need turns out to be missing, you hear that before paying anything. For bridges to other broker APIs, see broker API bridge development.

Static IP and SEBI’s retail algo circular
SEBI circular SEBI/HO/MIRSD/MIRSD-PoD/P/CIR/2025/0000013, dated 4 February 2025, covers safer participation of retail investors in algorithmic trading. It tells brokers not to permit open APIs. Access is allowed only through a unique vendor-client-specific API key and a static IP whitelisted by the broker. The same circular requires OAuth-based authentication and two-factor authentication for API access.
For self-written algos, registration with the exchange through the broker is needed only above a specified order-per-second threshold. That threshold is set by the Brokers’ Industry Standards Forum with the exchanges and SEBI. A registered algo may then be used for family, which the circular defines as self, spouse, dependent children and dependent parents.
The circular gave 1 August 2025 as its start date, and SEBI later extended the timelines. Check the current date and rules with your broker. In practice your bot has to run from the whitelisted address. In most setups that’s a rented Windows VPS whose IP address never changes. Sharekhan’s API pages don’t describe how to register that IP, so we work through it with you before going live.
How a Sharekhan project runs
- Send the requirement. Describe the strategy, the signal source and the account over WhatsApp or through the contact page.
- API check and fixed quote. We check the points above for your case and usually reply with a fixed price within a few hours.
- Build and test. We test the software on paper or backtest data first and share progress as it goes.
- Your review. Nothing touches the live account until you have checked it.
- Handover. You receive the tool, the source and a setup walkthrough, and we help with adjustments afterwards.

Who is responsible for what
When the rules, the API keys and the account are all yours, the trades are your own trading decisions. We don’t operate the software, we send no trading calls and we promise no result. Automated orders can lose money as quickly as manual ones, and a strategy’s past record says nothing certain about its next trade.
Running a bot for other people is a regulated activity in India. If your use needs an approval or a registration under SEBI or exchange rules, getting it falls to you. When unsure, take qualified advice first. Our page asking is copy trading legal in India covers the general position.
Send your written strategy with your segment and signal source, and you get a fixed quote: ask for a Sharekhan quote.
Other Indian brokers we automate
- HDFC Securities automation, where API access decides the scope.
- IIFL automation for IIFL Securities accounts.
- ICICI Direct automation on the Breeze API.
Sharekhan automation: frequently asked questions
Can I point my TradingView alerts at Sharekhan?
Not through the ready-made TradingView copier, which doesn’t support Sharekhan. A custom build can accept the same kind of TradingView webhook and send the order through the Sharekhan API instead.
Does Sharekhan have a Python API?
Yes. The official SDK installs with pip install shareconnect, and live streaming also needs the websocket package. The source is public in the Sharekhan-API GitHub account.
Will the bot start on its own every morning?
Not always. A person signs in on the broker’s login page to start each session, and we don’t bypass OTPs. How much of the morning start can be automated depends on your account.
Do I need to register my algo with the exchange?
Under the February 2025 SEBI circular, a self-written algo needs registration only if it crosses the order-per-second threshold set by the Brokers’ Industry Standards Forum. Ask the broker how it applies the current threshold.
Do you provide signals or run the account?
No. AlgoDevelop only develops software to your specification. We give no trading signals or advice, and you operate the account yourself.
Who owns the finished code?
You do. The handover includes every source file and the setup notes, so another developer can maintain it later.
What decides the price?
The number of signal sources, segments and accounts, plus how complex your exit rules are. Send those details and you get a fixed figure before any work starts.