# API

**URL:** https://community.aliceblueonline.com/c/api/8.md

[Latest](https://community.aliceblueonline.com/latest.md) · [Categories](https://community.aliceblueonline.com/categories.md) · [Tags](https://community.aliceblueonline.com/tags.md)

---

## [About the API category](https://community.aliceblueonline.com/t/about-the-api-category/149)

<div class="topic-metadata">

**Author:** [@community\_admin](https://community.aliceblueonline.com/u/community_admin)\
**Replies:** 0

</div>

About: This category is dedicated to discussions related to the Alice Blue API. Whether you are building custom trading bots, developing new trading algorithms, or integrating Alice Blue with other platforms, share your…

---

## [API not working](https://community.aliceblueonline.com/t/api-not-working/14550)

<div class="topic-metadata">

**Author:** [@SRI\_SAILESH\_V](https://community.aliceblueonline.com/u/SRI_SAILESH_V)\
**Replies:** 1\
**Last updated:** [September 29, 2026, 8:50am UTC](https://community.aliceblueonline.com/t/api-not-working/14550 "2026-09-29T08:50:22Z")

</div>

My API session is valid — customer/accountDetails returns HTTP 200. But POST https://ant.aliceblueonline.com/rest/AliceBlueAPIService/api/ws/createSocketSess has returned HTTP 404 since Monday morning. It worked on Frida…

---

## [Unable to place MARKET order through Alice Blue API – EC965](https://community.aliceblueonline.com/t/unable-to-place-market-order-through-alice-blue-api-ec965/14479)

<div class="topic-metadata">

**Author:** [@Greekslabs\_IT](https://community.aliceblueonline.com/u/Greekslabs_IT)\
**Replies:** 4\
**Last updated:** [August 19, 2026, 11:21am UTC](https://community.aliceblueonline.com/t/unable-to-place-market-order-through-alice-blue-api-ec965/14479 "2026-08-19T11:21:30Z")

</div>

Hi Team, I am testing order placement using the Alice Blue API. When I place a LIMIT order, the API accepts it and returns a brokerOrderId. However, when I try to place a MARKET order using: { "exchange": "NSE", …

---

## [Problem while connecting Alice Blue API](https://community.aliceblueonline.com/t/problem-while-connecting-alice-blue-api/14459)

<div class="topic-metadata">

**Author:** [@soniharsh1](https://community.aliceblueonline.com/u/soniharsh1)\
**Replies:** 1\
**Last updated:** [August 6, 2026, 7:49am UTC](https://community.aliceblueonline.com/t/problem-while-connecting-alice-blue-api/14459 "2026-08-06T07:49:14Z")

</div>

Hi all, I am trying to connect my Python code with the Alice Blue App. I am logged into the Alice Blue application. The app was created Source Code: import pyotp from pya3 import \* # Aliceblue, Alice\_Wrapper import i…

---

## [EC097 - IP Restriction Error While Placing Orders via API](https://community.aliceblueonline.com/t/ec097-ip-restriction-error-while-placing-orders-via-api/14384)

<div class="topic-metadata">

**Author:** [@pratish](https://community.aliceblueonline.com/u/pratish)\
**Replies:** 9\
**Last updated:** [July 27, 2026, 10:07am UTC](https://community.aliceblueonline.com/t/ec097-ip-restriction-error-while-placing-orders-via-api/14384 "2026-07-27T10:07:26Z")

</div>

Dear Alice Blue Support Team, I am facing an issue while placing orders through the Alice Blue API. Error Response: { “status”: “EC097”, “message”: “IP restriction: You are not allowed to place the order”, “result”…

---

## [API KEY for new ANT website](https://community.aliceblueonline.com/t/api-key-for-new-ant-website/4912)

<div class="topic-metadata">

**Author:** [@Chris\_Bhansali](https://community.aliceblueonline.com/u/Chris_Bhansali)\
**Replies:** 4\
**Last updated:** [June 3, 2026, 2:52am UTC](https://community.aliceblueonline.com/t/api-key-for-new-ant-website/4912 "2026-06-03T02:52:17Z")

</div>

Hello, I am using pya3 to generate an algorithmic trading using python. However, the new ANT does not have API key option in Apps like how we had for ANT WEB. Can someone help me with this? How can I generate the API KE…

---

## [Order rejected: IP restriction](https://community.aliceblueonline.com/t/order-rejected-ip-restriction/14328)

<div class="topic-metadata">

**Author:** [@venu2423](https://community.aliceblueonline.com/u/venu2423)\
**Replies:** 2\
**Last updated:** [May 14, 2026, 7:20am UTC](https://community.aliceblueonline.com/t/order-rejected-ip-restriction/14328 "2026-05-14T07:20:33Z")

</div>

Order rejected: IP restriction: You are not allowed to place the order

---

## [API support required](https://community.aliceblueonline.com/t/api-support-required/14292)

<div class="topic-metadata">

**Author:** [@Vinay\_Bagde](https://community.aliceblueonline.com/u/Vinay_Bagde)\
**Replies:** 2\
**Last updated:** [April 27, 2026, 11:49am UTC](https://community.aliceblueonline.com/t/api-support-required/14292 "2026-04-27T11:49:53Z")

</div>

Dear Alice Blue API Team, I am an API user experiencing persistent failures with Market Data endpoints. My session is valid, my Static IP is whitelisted, and non-market data requests (like option chain expiries) are wor…

---

## [Algo Trading API](https://community.aliceblueonline.com/t/algo-trading-api/14290)

<div class="topic-metadata">

**Author:** [@ktn600](https://community.aliceblueonline.com/u/ktn600)\
**Replies:** 1\
**Last updated:** [April 23, 2026, 5:46am UTC](https://community.aliceblueonline.com/t/algo-trading-api/14290 "2026-04-23T05:46:51Z")

</div>

Hello, As per new SEBI rules for algo trading needs Static IP. Market orders are not allowed in NFO. Is this true? Does algo trading in aliceblue needs static ip and allowed market orders? Thanks.

---

## [Alice Blue API malfunction](https://community.aliceblueonline.com/t/alice-blue-api-malfunction/14268)

<div class="topic-metadata">

**Author:** [@Harsh\_Kajla](https://community.aliceblueonline.com/u/Harsh_Kajla)\
**Replies:** 1\
**Last updated:** [April 8, 2026, 10:00am UTC](https://community.aliceblueonline.com/t/alice-blue-api-malfunction/14268 "2026-04-08T10:00:21Z")

</div>

Don’t use alice blue APIs , their new APIs are malfunctioning Its been many days we and algotest reported this issue but they don’t care. All the order logs were shared and alice blue enginerring team accepted the issu…

---

## [Static IP Registration Alice Blue](https://community.aliceblueonline.com/t/static-ip-registration-alice-blue/14255)

<div class="topic-metadata">

**Author:** [@Harsh\_Kajla](https://community.aliceblueonline.com/u/Harsh_Kajla)\
**Replies:** 1\
**Last updated:** [April 1, 2026, 3:55am UTC](https://community.aliceblueonline.com/t/static-ip-registration-alice-blue/14255 "2026-04-01T03:55:45Z")

</div>

Hi team I am using Algotest to place algo orders in alice blue. Algotest has provided me a static IP and now i am super confused where to put that static IP. Do i need to use New Alice Blue APIs from 1st April with sta…

---

## [MT4 Subscription](https://community.aliceblueonline.com/t/mt4-subscription/14154)

<div class="topic-metadata">

**Author:** [@sreemusic](https://community.aliceblueonline.com/u/sreemusic)\
**Replies:** 5\
**Last updated:** [February 2, 2026, 10:36am UTC](https://community.aliceblueonline.com/t/mt4-subscription/14154 "2026-02-02T10:36:14Z")

</div>

I have subscribed for MT4 from Bot for one month.No further email came from Aliceblue.how i can login MT4 with aliceblue credentials to access indian market in metatrader 4

---

## [As per new SEBI guidelines, our updated API will go live by January 2026](https://community.aliceblueonline.com/t/as-per-new-sebi-guidelines-our-updated-api-will-go-live-by-january-2026/14010)

<div class="topic-metadata">

**Author:** [@AB166616](https://community.aliceblueonline.com/u/AB166616)\
**Replies:** 1\
**Last updated:** [November 28, 2025, 12:57pm UTC](https://community.aliceblueonline.com/t/as-per-new-sebi-guidelines-our-updated-api-will-go-live-by-january-2026/14010 "2025-11-28T12:57:07Z")

</div>

Please provide a demo for the above subject

---

## [Not able to get response in return for any of the APIs](https://community.aliceblueonline.com/t/not-able-to-get-response-in-return-for-any-of-the-apis/13597)

<div class="topic-metadata">

**Author:** [@vivekdeo](https://community.aliceblueonline.com/u/vivekdeo)\
**Replies:** 1\
**Last updated:** [June 20, 2025, 3:16am UTC](https://community.aliceblueonline.com/t/not-able-to-get-response-in-return-for-any-of-the-apis/13597 "2025-06-20T03:16:26Z")

</div>

Hi, I am trying to use APIs as guided in the document. I am able to connect to ‘/customer/getAPIEncpkey’ – could get the encryption key ‘/customer/getUserSID’ – was able to get the session id To get the s…

---

## [Websocket connection on a single API](https://community.aliceblueonline.com/t/websocket-connection-on-a-single-api/5023)

<div class="topic-metadata">

**Author:** [@Chris\_Bhansali](https://community.aliceblueonline.com/u/Chris_Bhansali)\
**Replies:** 6\
**Last updated:** [November 11, 2024, 11:19am UTC](https://community.aliceblueonline.com/t/websocket-connection-on-a-single-api/5023 "2024-11-11T11:19:49Z")

</div>

Does anyone know how many websocket connection can we open on a single API?

---

## [Not able to get FNO detail](https://community.aliceblueonline.com/t/not-able-to-get-fno-detail/12365)

<div class="topic-metadata">

**Author:** [@Afzalur](https://community.aliceblueonline.com/u/Afzalur)\
**Replies:** 0\
**Last updated:** [August 16, 2024, 9:52am UTC](https://community.aliceblueonline.com/t/not-able-to-get-fno-detail/12365 "2024-08-16T09:52:59Z")

</div>

Dear Friends Today when I am using the following code I am getting wrong result. instrument\_fo = alice.get\_instrument\_for\_fno( exch=‘NFO’, symbol=‘NIFTY’, expiry\_date=‘2024-08-22’, is\_fut=False, strike=25000, is\_…

---

## [Create Session with api](https://community.aliceblueonline.com/t/create-session-with-api/12268)

<div class="topic-metadata">

**Author:** [@Mihir\_Dave](https://community.aliceblueonline.com/u/Mihir_Dave)\
**Replies:** 0\
**Last updated:** [July 31, 2024, 5:39am UTC](https://community.aliceblueonline.com/t/create-session-with-api/12268 "2024-07-31T05:39:24Z")

</div>

Hii there, today from early morning i have been facing this issue while creating sessions in alice blue with api . In response it is giving me that “Check Your Internet Connection”.

---

## [OI data not available in historical data api. Do you have plan to add it in the future?](https://community.aliceblueonline.com/t/oi-data-not-available-in-historical-data-api-do-you-have-plan-to-add-it-in-the-future/5094)

<div class="topic-metadata">

**Author:** [@akdotv](https://community.aliceblueonline.com/u/akdotv)\
**Replies:** 5\
**Last updated:** [July 27, 2024, 3:47pm UTC](https://community.aliceblueonline.com/t/oi-data-not-available-in-historical-data-api-do-you-have-plan-to-add-it-in-the-future/5094 "2024-07-27T15:47:25Z")

</div>

Open Interest data is not available in the “/chart/history” endpoint for FNO symbols. Please add them as it is important data for trading. Without OI, historical data is meaningless for FNO.

---

## [API to get Open Interest (OI)](https://community.aliceblueonline.com/t/api-to-get-open-interest-oi/12243)

<div class="topic-metadata">

**Author:** [@Saranya\_Rao](https://community.aliceblueonline.com/u/Saranya_Rao)\
**Replies:** 0\
**Last updated:** [July 27, 2024, 3:40pm UTC](https://community.aliceblueonline.com/t/api-to-get-open-interest-oi/12243 "2024-07-27T15:40:59Z")

</div>

Hi Team, Please advise how to get real time Open Interest (OI) using API ? Looking forward your reply

---

## [I Was Trying to connect web sockets But its getting error](https://community.aliceblueonline.com/t/i-was-trying-to-connect-web-sockets-but-its-getting-error/9548)

<div class="topic-metadata">

**Author:** [@adi4444](https://community.aliceblueonline.com/u/adi4444)\
**Replies:** 3\
**Last updated:** [June 5, 2024, 10:57am UTC](https://community.aliceblueonline.com/t/i-was-trying-to-connect-web-sockets-but-its-getting-error/9548 "2024-06-05T10:57:29Z")

</div>

I Was Trying to connect to web sockets from my react project but getting an error Can Some one helps me with this please… i can able to get all id’s and keys but unable to connect to web sockets…

---

## [Getting error while subscribing an index](https://community.aliceblueonline.com/t/getting-error-while-subscribing-an-index/11796)

<div class="topic-metadata">

**Author:** [@pennytrader](https://community.aliceblueonline.com/u/pennytrader)\
**Replies:** 0\
**Last updated:** [May 27, 2024, 5:49am UTC](https://community.aliceblueonline.com/t/getting-error-while-subscribing-an-index/11796 "2024-05-27T05:49:11Z")

</div>

I tried to subscribe Midcap nifty and I am getting the error. The value being picked to aliceblue.py subscribe method is ‘NSE|26074’ AliceBlue Ticker Subscribing instruments \[Instrument(exchange=‘NSE’, token=26074, sy…

---

## [Regarding Trailing Stop Loss](https://community.aliceblueonline.com/t/regarding-trailing-stop-loss/11717)

<div class="topic-metadata">

**Author:** [@chaitanyaks](https://community.aliceblueonline.com/u/chaitanyaks)\
**Replies:** 2\
**Last updated:** [May 17, 2024, 4:58pm UTC](https://community.aliceblueonline.com/t/regarding-trailing-stop-loss/11717 "2024-05-17T16:58:54Z")

</div>

Is the Trailing Stop Loss feature using the API functional, or is it just a placeholder? I’ve tried multiple brokers but had no luck. Does it really work in Alice Blue? If yes, what segments does it allow? Does it allow…

---

## [How to select previous trading day closing price of Banknifty Futures](https://community.aliceblueonline.com/t/how-to-select-previous-trading-day-closing-price-of-banknifty-futures/10591)

<div class="topic-metadata">

**Author:** [@Dhruvmalani](https://community.aliceblueonline.com/u/Dhruvmalani)\
**Replies:** 0\
**Last updated:** [February 13, 2024, 7:09am UTC](https://community.aliceblueonline.com/t/how-to-select-previous-trading-day-closing-price-of-banknifty-futures/10591 "2024-02-13T07:09:47Z")

</div>

instrument = alice.get\_instrument\_by\_symbol(‘NFO’, ‘BANKNIFTY29FEB24F’) print(instrument) from\_datetime = datetime.datetime(2024, 2, 12) # From last 5 days to\_datetime = datetime.datetime(2024, 2, 12) # To now inte…

---

## [How to select next Fut contracts automatically after expiry](https://community.aliceblueonline.com/t/how-to-select-next-fut-contracts-automatically-after-expiry/10590)

<div class="topic-metadata">

**Author:** [@Dhruvmalani](https://community.aliceblueonline.com/u/Dhruvmalani)\
**Replies:** 0\
**Last updated:** [February 13, 2024, 7:05am UTC](https://community.aliceblueonline.com/t/how-to-select-next-fut-contracts-automatically-after-expiry/10590 "2024-02-13T07:05:12Z")

</div>

\#Finding the yesterdays closing price import datetime instrument = alice.get\_instrument\_by\_symbol(‘NFO’, ‘BANKNIFTY29FEB24F’) print(instrument) from\_datetime = datetime.datetime(2024, 2, 12) # From last 5 days to\_d…

---

## [Getting error while placing order](https://community.aliceblueonline.com/t/getting-error-while-placing-order/9160)

<div class="topic-metadata">

**Author:** [@pennytrader](https://community.aliceblueonline.com/u/pennytrader)\
**Replies:** 2\
**Last updated:** [February 11, 2024, 7:55am UTC](https://community.aliceblueonline.com/t/getting-error-while-placing-order/9160 "2024-02-11T07:55:20Z")

</div>

I am placing an alice blue order using placeOrder, order\_id = alice.place\_order( transaction\_type=TransactionType.Buy if intraday\_order\['Trantype'\] == 'B' else TransactionType.Sell, instr…

---

## [Option api history data](https://community.aliceblueonline.com/t/option-api-history-data/9580)

<div class="topic-metadata">

**Author:** [@Amol\_Yelegaonkar](https://community.aliceblueonline.com/u/Amol_Yelegaonkar)\
**Replies:** 2\
**Last updated:** [February 10, 2024, 2:51pm UTC](https://community.aliceblueonline.com/t/option-api-history-data/9580 "2024-02-10T14:51:37Z")

</div>

what is wrong command in below exch=“NFO” symbol=“BANKNIFTY” expiry= nse\_expirydetails(nse\_optionchain\_scrapper(‘BANKNIFTY’), 0)\[0\] #print(alice.get\_instrument\_for\_fno(exch=“NFO”,symbol=‘BANKNIFTY’, expiry\_date=str(ex…

---

## [I cannot place nse stock options order in alice blue](https://community.aliceblueonline.com/t/i-cannot-place-nse-stock-options-order-in-alice-blue/10366)

<div class="topic-metadata">

**Author:** [@199870](https://community.aliceblueonline.com/u/199870)\
**Replies:** 0\
**Last updated:** [January 29, 2024, 10:34am UTC](https://community.aliceblueonline.com/t/i-cannot-place-nse-stock-options-order-in-alice-blue/10366 "2024-01-29T10:34:39Z")

</div>

while placing algo trades, the stock options order, I get no broker status, no broker request, no broker reason in broker response.

---

## [ALGO TRADING INSTEAD OF CREATING ANY SOFTWARE YOU CAN USE EASILY redyamde](https://community.aliceblueonline.com/t/algo-trading-instead-of-creating-any-software-you-can-use-easily-redyamde/9796)

<div class="topic-metadata">

**Author:** [@Fox\_Player](https://community.aliceblueonline.com/u/Fox_Player)\
**Replies:** 0\
**Last updated:** [December 24, 2023, 5:28am UTC](https://community.aliceblueonline.com/t/algo-trading-instead-of-creating-any-software-you-can-use-easily-redyamde/9796 "2023-12-24T05:28:27Z")

</div>

INSTEAD OF CREATING ANY SOFTWARE YOU CAN USE EASILY FROM WWW.FOXPLAYER.CO.IN, THERE IS A HINDI AND TAMIL VIDEO THEN YOU GO AHED for easy process.

---

## [I can not get session id](https://community.aliceblueonline.com/t/i-can-not-get-session-id/8616)

<div class="topic-metadata">

**Author:** [@hshyamh4](https://community.aliceblueonline.com/u/hshyamh4)\
**Replies:** 1\
**Last updated:** [November 3, 2023, 5:12am UTC](https://community.aliceblueonline.com/t/i-can-not-get-session-id/8616 "2023-11-03T05:12:04Z")

</div>

public static String generateChecksum(String userID, String apiKey, String encryptionKey) { String inputData = userID + apiKey + encryptionKey; try { MessageDigest digest = MessageDigest.getInstance(“SHA-256”); byte …

---

## [Cannot get MCX live data on websoket](https://community.aliceblueonline.com/t/cannot-get-mcx-live-data-on-websoket/8908)

<div class="topic-metadata">

**Author:** [@Yashpal\_Vaghela](https://community.aliceblueonline.com/u/Yashpal_Vaghela)\
**Replies:** 9\
**Last updated:** [November 1, 2023, 10:12am UTC](https://community.aliceblueonline.com/t/cannot-get-mcx-live-data-on-websoket/8908 "2023-11-01T10:12:25Z")

</div>

I am using pya3 python library and getting all NSE & BSE market live data but cannot get live feed of any MCX symbol , Can anyone help me ? This is waht I am using to get instrument \> alice.get\_instrument\_by\_symbol(‘M…

[Next page](https://community.aliceblueonline.com/c/api/8.md?page=1)
