Hi @rajanprabu
Please refer the enclosed file which list all the order status.
in status you'll get - *Modified
(previous trigger pending order)
in order status - trigger pending
Hi @rajanprabu
Please refer the enclosed file which list all the order status.
in status you'll get - *Modified
(previous trigger pending order)
in order status - trigger pending
We apologize for the discrepancy in the API documentation and the actual data received. Our API is currently limited to returning a maximum of 500 records per request. We have update the members on this post -
https://smartapi.angelbroking.com/topic/3380/issue-fetching-historical-data/12?_=1675141920884
@PareshBhatiya @mudit236 @Phanilbb
We are aware of the error being faced by clients. Our team is currently looking into the internal error issue and working towards a resolution. We apologize for the inconvenience and appreciate your patience as we work towards a solution.
Hi @Reddy We are checking this. Regret the inconvenience caused.
HI Everyone, (@Ashok @mihirshah2500 @rajanprabu @Saidareddy )
We are excited to announce the launch of our new login service that now allows users to login with their PIN in addition to their password.
The new login service solves the problem of newly onboarded Angel One clients who were unable to access SmartAPI due to non-availability of the password, and also solves the problem of users who have forgotten their passwords and were unable to reset them.
Starting today, users will be able to use either their PIN or password to authenticate with Angel One SmartAPI with the existing loginByPassword API endpoint.
The request structure of the current loginbyPassword API endpoint is as below:
{
"clientcode":"Your_client_code",
"password":"Your_Password" OR "Your_PIN"
"totp":"enter_the_code_displayed_on_your_authenticator_app"
}
Likewise, to set up the one time TOTP on https://smartapi.angelbroking.com/enable-totp to retrieve the QR code, users can either login with their password OR PIN . To learn more about TOTP and how to setup TOTP, please visit - https://smartapi.angelbroking.com/topic/2377/guide-to-secure-your-smartapi-account-with-two-factor-authentication?_=1670353255986
By the end of this month (i.e. December 31, 2022), we will be discontinuing the use of passwords for login, so we encourage all users to set up their PIN as soon as possible.
Thank you for your continued support, and we hope you enjoy trading with SmartAPI.
HI @Reddy Have you incorporated the new change which are done yesterday.
Hi @rajanprabu , thank you so much for the fix. Request you to please raise the PR, I'll get my tech team to review and approve the same. Open source contributions from experts and loyal SmartAPI users like you will help us to maintain the SDKs. We are exploring few options on the support for SDKs and shall restore the support soon. Thank you for your contribution again.
Hi @Ashok , the new login process will be MPIN based. We will introduce a new login endpoint giving our users sufficient time to migrate to the new login endpoint.
Hi @nickmanan
We have noticed that you are experiencing issues with our SDK due to poor error handling. The error message you are seeing, "TypeError: 'NoneType' object is not subscriptable", is a result of the SDK not handling exceptions properly. This is causing the orderResponse variable to be None, which is leading to the error you are seeing.
The correct error message from the RestAPI is "Invalid Session or Session is Expired Please Re-login" with error code "AB1010". This error is likely being caused because you are using an expired JWT token. (Read more about it here - https://smartapi.angelbroking.com/topic/3392/faqs-on-ab1010-invalid-session-or-session-expired-please-re-login?_=1671130890317)
Please note that our SDKs are open source, so you are welcome to make contributions to improve the error handling and other aspects of the code. Additionally, if you encounter any errors in the future, you can make a call to the RestAPI directly to get the correct error message and information on how to resolve the issue.
We apologize for any inconvenience this may have caused and thank you for your understanding.
Dear SmartAPI users,
We would like to inform you that we have recently made a change to the format of the "feedToken" field in our login response. This field has been changed from numeric to text format.
Login response: Old Format -
{
"status":true,
"message":"SUCCESS",
"errorcode":"",
"data":{
"jwtToken":"eyJhbGciOiJIUzUxMiJ9.eyJzdWI...",
"refreshToken":"eyJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE1OTk0ODkwMz...",
"feedToken":1345613428
}
}
Login response: New Format -
{
"status": true,
"message": "SUCCESS",
"errorcode": "",
"data": {
"jwtToken": "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VybmFtZSI6IkIyMTA5OTIiLCJyb2xlcyI6MCwidXNlcnR5cGUiOiJVU0VSIiwiaWF0IjoxNjgyNDgyNTM2LCJleHAiOjE2ODI1Njg5MzZ9.Jbbwc64K8SxPOhHgTxB58AX4c2qqi_x9Otb5RE7xDwxOLlbX-QTUWBZdAaRrgZBGmwhhAYDLGRo50hCgLE7pUw",
"refreshToken": "eyJhbGciOiJIUzUxMiJ9.eyJ0b2tlbiI6IlJFRlJFU0gtVE9LRU4iLCJpYXQiOjE2ODI0ODI1MzZ9.PQeoJz3hLMVRJVNVUqmTNa8Mwt3Ta3ieScJ6w6HpzlzQTsQ4p0oMLPDrLK9ouDXRMDcX6ycyMJ2MWwo9AL74YQ",
"feedToken": "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VybmFtZSI6IkIyMTA5OTIiLCJpYXQiOjE2ODI0ODI1MzYsImV4cCI6MTY4MjU2ODkzNn0.tg5rrEX7EOGbdnpKpMwlWWZ-PXEmrJB27A5XfPPqHRN6IEOZUlQXuIbe5M747dPxDRJrnrBFYDt7WeRSEPITRA"
}
}
We recommend that you update your systems to handle the new values for the "feedToken" field to avoid any errors. We understand that some of our clients may be using parsers to handle our responses, and we encourage you to make the necessary updates to ensure compatibility with the new format.
Please note that this change has been made to improve the security and stability of our system. We apologize for any inconvenience this may cause and appreciate your understanding.
If you have any questions or concerns, please don't hesitate to reach out to our support team.
Thank you for using SmartAPI.
Best regards,
The SmartAPI team
@ravitandur Thank you for your suggestion, based on the customer feedback, we are increasing the limit of order tag from 15 to 20.
Dear SmartAPI users,
Starting November 15, 2024, the ordertag field in the placeOrder API will support up to 15 characters, with any orders exceeding this limit being rejected.
We have updated the documentation to include this new validation and provided the error message for cases where the ordertag exceeds the limit.
Let me know if there’s anything further you need on this.
Sample error message:
{
"message": "Ordertag length should not exceed 15 characters",
"errorcode": "AB4008",
"status": false,
"data": null
}
Regards,
SmartAPI Team
Dear Customers,
We are pleased to announce that our SmartAPI platform has successfully migrated from the apiconnect.angelbroking.com domain to the new apiconnect.angelone.in domain.
Key Points:
Root API Endpoint: The new root API endpoint is now https://apiconnect.angelone.in.
The previous endpoint https://apiconnect.angelbroking.com remains fully functional, so you can continue to use either endpoint without any disruption to your services.
Documentation and SDK Updates: We are currently updating all relevant documentation and SDKs to reflect this change. Please stay tuned for these updates, which will help ensure a smooth transition to the new domain.
If you have any questions or encounter any issues during this transition, please don't hesitate to reach out to our support team.
Thank you for your continued support.
Best Regards,
The SmartAPI Team at Angel One
Dear SmartAPI users
We're gearing up for an exciting update to our Live Market Data API, scheduled to go live on November 17, 2023! This enhancement will allow you to fetch data for up to 50 symbols in one go, streamlining your workflow for more efficient trading.
Endpoint: https://apiconnect.angelbroking.com/rest/secure/angelbroking/market/v1/quote/
Request Type: POST
Key Highlights:
Bulk Symbol Fetch: Fetch data for 50 symbols in a single request, enhancing your market data retrieval capabilities.
Rate Limit reduction: The rate limit will be reducted to 1 request per second (1 rps), down from the previous limit of 10 requests per second.
Note: This represents a remarkable fivefold increase from the initial allowance of 10 requests per second, now allowing you to fetch data for 50 symbols in just one request.
Action Required:
To seamlessly transition to this improved experience, please adjust your code to align with the new rate limit of 1 rps.
New Request Structure:
{
"mode": "LTP",
"exchangeTokens": {
"NSE": [
"3045", "881"
],
"NFO": [
"35078"
]
}
}
Sample Response:
{
"status": true,
"message": "SUCCESS",
"errorcode": "",
"data": {
"fetched": [
{
"exchange": "NSE",
"tradingSymbol": "DRREDDY",
"symbolToken": "881",
"ltp": 5567.6
},
{
"exchange": "NSE",
"tradingSymbol": "SBIN",
"symbolToken": "3045",
"ltp": 588.35
},
{
"exchange": "NFO",
"tradingSymbol": "BANKNIFTY",
"symbolToken": "35078",
"ltp": 44766.5
}
],
"unfetched": []
}
}
Release Date: These enhancements are scheduled to go live on November 17, 2023! Ensure to adjust your code and rate limit handling for a seamless experience.
For a detailed overview of the original release, please visit the original forums post.
Dear SmartAPI Users,
We'd like to share an important update about the availability of BSE-BFO Futures and Options via SmartAPI. This development expands the scope of trading on the BSE (Bombay Stock Exchange) in the BFO (BSE Futures and Options) segment.
Start your journey into BFO contracts by referring to the token list available on the Scrip Master.
How to Place Orders with BFO Contracts
To place an order with BFO contracts on SmartAPI, you need to specify the exchange as "BFO" in your order placement request. Here's an example order request:
{
"variety": "NORMAL",
"tradingsymbol": "SENSEX23OCTFUT",
"symboltoken": "1127310",
"transactiontype": "BUY",
"exchange": "BFO",
"ordertype": "LIMIT",
"producttype": "CARRYFORWARD",
"duration": "DAY",
"price": "551",
"quantity": "10",
"ordertag": "10007712"
}
Token Details for BFO Contracts
To make trading even more accessible, we have provided token details for BFO contracts. These tokens can be found on the Scrip Master. Here are some examples:
{"token":"1126170","symbol":"SENSEX23OCT66400CE","name":"SENSEX","expiry":"27OCT2023","strike":"6640000.000000","lotsize":"10","instrumenttype":"OPTIDX","exch_seg":"BFO","tick_size":"5.000000"}
{"token":"840758","symbol":"SENSEX23N0366400CE","name":"SENSEX","expiry":"03NOV2023","strike":"6640000.000000","lotsize":"10","instrumenttype":"OPTIDX","exch_seg":"BFO","tick_size":"5.000000"}
{"token":"840903","symbol":"SENSEX23N03FUT","name":"SENSEX","expiry":"03NOV2023","strike":"0.000000","lotsize":"10","instrumenttype":"FUTIDX","exch_seg":"BFO","tick_size":"5.000000"}
{"token":"1127310","symbol":"SENSEX23OCTFUT","name":"SENSEX","expiry":"27OCT2023","strike":"0.000000","lotsize":"10","instrumenttype":"FUTIDX","exch_seg":"BFO","tick_size":"5.000000"}
Understanding SENSEX tradingsymbol naming convention
Weekly Futures Contract Example: SENSEX23N03FUT
23N03 denotes the year (23), month (N for November), and the date (03) of the expiry.
FUT signifies it's a future contract.
Monthly Futures Contract Expiries Example: SENSEX23OCTFUT
23OCT denotes the year (23) and the month (OCT) for monthly expiries.
FUT stands for future contract.
Weekly Options Contract Example: SENSEX23N0366400CE
23N03 denotes the year (23), month (N for November), and the date (03) of the expiry.
66400CE specifies the strike price followed by CE or PE.
Monthly Options Contract Example: SENSEX23OCT66400CE
23OCT denotes the year (23) and the month (OCT) for monthly expiries.
66400CE specifies the strike price followed by CE or PE.
Important Note: Symbol name formats are subject to change, as this information is received directly from the exchange. We strongly recommend downloading the Scrip Master file daily before the market opening and reviewing it to ensure that you have the most accurate and up-to-date information.
Introduction:
We're pleased to announce the launch of a new WebSocket feature for real-time order updates from tns.angelone.in/smart-order-update.
Background:
The previous order update system had issues and was non-operational for a while. We've made significant improvements to provide you with a reliable and enhanced experience.
Connecting to the WebSocket:
To connect to the WebSocket, clients need to use the following URL:
wss://tns.angelone.in/smart-order-update
In the WebSocket connection request, include the following Header key:
Authorization: Bearer AUTHORIZATION_TOKEN
Please note that there is a connection limit for each user. Each client code is limited to 3 connections.
Initial Response:
Upon successfully connecting to the WebSocket, you will receive an initial response in the following format:
{
"user-id": "Your_client_code",
"status-code": "200",
"order-status": "AB00",
"error-message": "",
"orderData": {
"variety": "",
"ordertype": "",
"ordertag": "",
"producttype": "",
"price": 0.0,
"triggerprice": 0.0,
"quantity": "0",
"disclosedquantity": "0",
"duration": "",
"squareoff": 0.0,
"stoploss": 0.0,
"trailingstoploss": 0.0,
"tradingsymbol": "",
"transactiontype": "",
"exchange": "",
"symboltoken": "",
"instrumenttype": "",
"strikeprice": 0.0,
"optiontype": "",
"expirydate": "",
"lotsize": "0",
"cancelsize": "0",
"averageprice": 0.0,
"filledshares": "",
"unfilledshares": "",
"orderid": "",
"text": "",
"status": "",
"orderstatus": "",
"updatetime": "",
"exchtime": "",
"exchorderupdatetime": "",
"fillid": "",
"filltime": "",
"parentorderid": ""
}
}
The order-status field can have values like:
after-successful connection: AB00
open: AB01
cancelled: AB02
rejected: AB03
modified: AB04
complete: AB05
after market order req received: AB06
cancelled after market order: AB07
modify after market order req received: AB08
open pending: AB09
trigger pending: AB10
modify pending: AB11
Error Codes:
401 : If the AUTHORIZATION_TOKEN is invalid, you will receive a 401 Response Code.
403 : If the AUTHORIZATION_TOKEN is expired, you will receive a 403 Response Code.
429 : If you breach the connection limit, you will receive a 429 Response Code.
Client Interaction:
The client application should periodically send a ping message to the server and expect a pong message from the server every 10 seconds. This helps check the liveliness of the WebSocket connection.
Sample Response:
Here's an example of a response you might receive from the WebSocket:
"user-id": "Your_client_code",
"status-code": "200",
"order-status": "AB03",
"error-message": "",
"orderData": {
"variety": "NORMAL",
"ordertype": "LIMIT",
"ordertag": "10007712",
"producttype": "DELIVERY",
"price": 551.0,
"triggerprice": 0.0,
"quantity": "1",
"disclosedquantity": "0",
"duration": "DAY",
"squareoff": 0.0,
"stoploss": 0.0,
"trailingstoploss": 0.0,
"tradingsymbol": "SBIN-EQ",
"transactiontype": "BUY",
"exchange": "NSE",
"symboltoken": "3045",
"instrumenttype": "",
"strikeprice": -1.0,
"optiontype": "",
"expirydate": "",
"lotsize": "1",
"cancelsize": "0",
"averageprice": 0.0,
"filledshares": "0",
"unfilledshares": "1",
"orderid": "111111111111111",
"text": "Adapter is Logged Off",
"status": "rejected",
"orderstatus": "rejected",
"updatetime": "25-Oct-2023 23:53:21",
"exchtime": "",
"exchorderupdatetime": "",
"fillid": "",
"filltime": "",
"parentorderid": ""
}
SDKs Coming Soon:
We understand that simplicity and ease of integration are vital for our users. That's why we're excited to let you know that we are currently working on developing SDKs for Python, Java, and Node.js. These SDKs will make integrating with our WebSocket order updates even more straightforward.
Stay tuned for updates on the release of these SDKs, and in the meantime, if you have any questions or need further assistance, feel free to reach out to our support team.
Conclusion:
The new WebSocket order updates from tns.angelone.in/smart-order-update provide a powerful tool for traders and investors to receive real-time information about their orders and trading activity. We hope this information helps you get started with WebSocket order updates. Happy trading, and watch out for our upcoming SDK releases!
HI @StocksDeveloper
The JSON file holds the symbol names, which won't align with the trade symbols used in the position book as they follow different formatting conventions. In the position book, we utilize trade symbols, hence the discrepancy. This format has been in use since the inception of our system and there hasn't been any recent modification in the name format.
We've resolved the intermittent "Internal Error" issue (error code "AB2001") some of you faced while placing orders. Your patience is appreciated, and we apologize for any inconvenience.
If you encounter further issues, our support team is ready to assist. Thank you for your trust in our services.
We're implementing significant enhancements to our trading APIs, with a keen focus on practicality and efficiency for our users. These changes include the introduction of the "uniqueorderid" field in the responses of essential APIs: place order, modify order, cancel order, and orderbook.
Moreover, we're introducing the "Individual Order Status" API, which grants users access to detailed information about specific individual orders. This means you can skip the hassle of fetching the entire order book when you only need specific order details. Notably, this API offers an impressive rate limit of 10 requests per second, ensuring a smooth and efficient trading experience.
We believe these improvements will streamline your trading activities, making it easier for you to manage your orders effectively.
1. Introducing the "Individual Order Status" API:
This API allows you to retrieve the status of individual orders using the "uniqueorderid" you receive in the response when placing, modifying, or canceling orders.
API Endpoint: https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/details/{UniqueOrderID}
Method: GET
Sample Request:
https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/details/05ebf91b-bea4-4a1d-b0f2-4259606570e3
Sample Response:
{
"status": true,
"message": "SUCCESS",
"errorcode": "",
"data": {
"variety": "NORMAL",
"ordertype": "LIMIT",
"producttype": "DELIVERY",
"duration": "DAY",
"price": 2298.25,
"triggerprice": 0.0,
"quantity": "1",
"disclosedquantity": "0",
"squareoff": 0.0,
"stoploss": 0.0,
"trailingstoploss": 0.0,
"tradingsymbol": "RELIANCE-EQ",
"transactiontype": "BUY",
"exchange": "NSE",
"symboltoken": "2885",
"instrumenttype": "",
"strikeprice": -1.0,
"optiontype": "",
"expirydate": "",
"lotsize": "1",
"cancelsize": "0",
"averageprice": 0.0,
"filledshares": "0",
"unfilledshares": "1",
"orderid": "231010000000970",
"text": "Your order has been rejected due to Insufficient Funds. Available funds - Rs. 937.00 . You require Rs. 2298.25 funds to execute this order.",
"status": "rejected",
"orderstatus": "rejected",
"updatetime": "10-Oct-2023 09:00:16",
"exchtime": "",
"exchorderupdatetime": "",
"fillid": "",
"filltime": "",
"parentorderid": "",
"ordertag": "",
"uniqueorderid": "05ebf91b-bea4-4a1d-b0f2-4259606570e3"
}
}
Improved Rate Limit:
We understand the importance of quick decision-making in trading, especially when you need to place orders like stop-loss or target orders after a successful trade. Our "place order" API enables you to send requests rapidly, with a limit of up to 20 requests per second. In the context of order monitoring, the "getorderbook" API is limited to just 1 request per second. However, we're introducing the "Individual Order Status" API, which is designed to allow 10 requests per second. This enhancement provides you with greater flexibility and control when checking the status of your individual orders.
2. Unique Order ID:
In conjunction with these enhancements, we are introducing the "Unique Order ID." This identifier will be included in the response every time you interact with our APIs, whether you're placing an order, modifying it, canceling it, or checking your order book. This unique identifier simplifies the process of tracking and managing your orders with precision.
These updates are aimed at enhancing your trading experience, providing you with the necessary tools, speed, and control to thrive in today's dynamic markets.
Sample response on place order:
{
"status": true,
"message": "SUCCESS",
"errorcode": "",
"data": {
"script": "IDEA-EQ",
"orderid": "101105793a45AO",
"uniqueorderid": "87ae4c65-8e5b-4f4e-b836-8c6cf7b0170b"
}
}
We hope you find these updates valuable, and we look forward to serving you with an even better trading experience.
Happy trading!
We're excited to announce an expansion of our historical data offerings through SmartAPI! We've broadened the scope of our data coverage to provide you with even more valuable insights. Now, in addition to existing NSE stocks and NFO (NSE Futures & Options), you can access historical data for a diverse range of symbols, including NSE indices, BSE indices, BSE stocks, BFO (BSE Futures & Options), CDS (Currency Derivatives Segment), and MCX (Multi Commodity Exchange) — all within the same API endpoints. The best part? It's all available for FREE!
How to Use:
Accessing this expanded historical data couldn't be simpler. You can continue to use the same API endpoints you're already familiar with to retrieve historical data for this extended range of symbols.
Sample Request and Response for NSE Indices:
Request:
{
"exchange": "NSE",
"symboltoken": "99926000", // Token for NSE NIFTY50 Index
"interval": "ONE_HOUR",
"fromdate": "2023-09-06 11:15",
"todate": "2023-09-06 12:00"
}
Response:
{
"status": true,
"message": "SUCCESS",
"errorcode": "",
"data": [
[
"2023-09-06T11:15:00+05:30",
19571.2,
19573.35,
19534.4,
19552.05,
0
]
]
}
Sample Request and Response for BSE Indices:
Request:
{
"exchange": "BSE",
"symboltoken": "99919000", // Token for BSE SENSEX Index
"interval": "ONE_DAY",
"fromdate": "2023-09-28 11:15",
"todate": "2023-09-29 12:15"
}
Response:
{
"status": true,
"message": "SUCCESS",
"errorcode": "",
"data": [
[
"2023-09-29T00:00:00+05:30",
65743.93,
66151.65,
65570.38,
65828.41,
0
]
]
}
Note:
Please take note that the provided sample requests are shared for indices, but users can pass different symbols as needed based on the desired segment:
"NSE" for NSE stocks and indices,
"BSE" for BSE stocks and indices,
"NFO" for NSE Futures and Options,
"BFO" for BSE Futures and Options,
"CDS" for currency symbols, and
"MCX" for commodity symbols.
Maximum Number of Days per Interval:
We're pleased to announce that we've resolved an issue regarding the maximum number of candles sent in one request. Previously, only 500 candles were sent in one request. We've now increased the limits, allowing you to access historical data with the following maximum days per interval:
ONE_MINUTE: 30* (restricted to 8000 records)
THREE_MINUTE: 60
FIVE_MINUTE: 100
TEN_MINUTE: 100
FIFTEEN_MINUTE: 200
THIRTY_MINUTE: 200
ONE_HOUR: 400
ONE_DAY: 2000
Feedback and Support:
Your feedback is incredibly important to us. If you come across any challenges or have suggestions, please don't hesitate to get in touch with our dedicated support team through the SmartAPI developer forums.
We remain committed to providing you with the best tools and data to support your trading and investment activities. Thank you for choosing SmartAPI, and we look forward to seeing how these historical data updates enhance your financial endeavors.
Happy trading!
Important Note: Phased Release and Request Variability
We'd like to inform our users that we are currently in the process of a phased release for this historical data expansion. During this period, you may experience variations in the success of your requests, as some may execute successfully while others might not.
We want to assure you that this is a temporary situation as we work diligently to complete the deployment. We are committed to achieving 100% deployment and ensuring a seamless experience for all users by the end of the day on October 10th.
Thank you for your patience and understanding as we enhance SmartAPI to better serve your financial endeavors.