How to use smartapi websocket connections?
Posts made by Moderator_3
-
RE: Doesn't Have slice order API
Thanks for the suggestion.
For now , you can use the loop functionality to achieve the same.Regards,
SmartAPI Team -
RE: Invalid TOTP Error Code AB1050
Attaching a sample code for generating TOTP using pyotp.
import pyotp as tp
Define your secret key
secret_key = "SECRET CODE HERE" # Replace this with your actual secret key
Generate TOTP
totp = tp.TOTP(secret_key)
current_otp = totp.now()Regards,
SmartAPI Team -
RE: Getting Invalid TOTP/Token error in generateSession method call
TOTP expires within a minute.
Storing a TOTP in env variable will not workRegards,
SmartAPI Team -
RE: Ordertag character length restricted to 15 in the placeOrder
Hi @ravitandur
Currently, OrderTag characters restricted to 15 characters if it goes beyond 15 characters will get rejected in Angel One.
Regards, Smart API Team
-
RE: Please share the "Order Status List" for Inteaday Trading work-flow stages.
Hi @Rakhi
Please use Order Book API to get to know order status.
API URL :
https://apiconnect.angelone.in/rest/secure/angelbroking/order/v1/getOrderBook
Please refer doc to consume order book API.
https://smartapi.angelbroking.com/docs/Orders -
RE: "error_code":"AB9019 "
Hi @sac
Informed respective team about this issue will update you soon on this.
Regards, Smart API Team
-
RE: Upticks and Downticks should be greater than given percentage!
Please share actual request, response & client id along with date & time order placed.
Regards, Smart API Team
-
RE: Greeks data for sensex bankex and commodity symbols
Verified. Able to see data for CRUDEOIL MCX with expiry 2024-12-16. Please try again.
Regards, Smart API Team
-
RE: Order ID not returning in Tradebook
Hi @dhruv2599
With uniqueorderid you can't cancel the order. I can able to see the order id for SBIN stock. Please try again.
Regards, Smart API Team
-
RE: "error_code":"AB9019 "
Informed respective team about this issue will update you soon on this.
Regards, Smart API Team
-
RE: Refresh token url
Hi @rahul00125
In login response you'll get refresh token. You can make of use of entire session. With that refresh token you can generate JWT token & refresh token with below Generate Token API.
API Doc
https://smartapi.angelbroking.com/docs/User#flowAPI URL :
https://apiconnect.angelone.in/rest/auth/angelbroking/jwt/v1/generateTokensSample Request :
{
"refreshToken": "3MzM1MDM4Mzh9.oYwF7PD68xyVZrwi-ku1ZWlMHmU8Wpwy1e5x2ZO9Kmx3Aw0pj2tkqHlk0_vQXJfAccKo6cM5GBo8qGfqMaZm_A"
}Sample Response :
{
"status": true,
"message": "SUCCESS",
"errorcode": "",
"data": {
"jwtToken": "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VybmFtZSI6IkRJWUQyMjgxMyIsInJvbGVzIjowLCJ1c2VydHlwZSI6IlVTRVIiLCJ0b2tlbiI6ImV5SmhiR2NpT2lKU1V6STFOaUlzSW5SNWNDSTZJa3BYVkNKOS5leUoxYzJWeVgzUjVjR1VpT2lKamJHbGxibl"
}
} -
RE: Stock name to Symbol
Hi @sourav344
Use SearchScrip API for Implementing search feature
URL :
https://apiconnect.angelone.in/rest/secure/angelbroking/user/v1/searchScrip
Sample Request :
{
"exchange": "NSE",
"searchscrip": "Reliance Industries Limited"
}Sample Response :
{
"status": "success",
"message": "",
"error_code": "",
"data": {
"dataList": [
{
"type": "scrip",
"icon": "icons/scrip/eq_v1.png",
"tradeSymbol": "RELIANCE-EQ",
"isCashWithFno": true,
"nseCashToken": "2885",
"bseCashToken": "500325",
"curFutToken": "",
"details": "RELIANCE INDUSTRIES LTD",
"expirydate": "01 Jan 1980",
"instName": "",
"isinCode": "INE002A01018",
"mktSegID": "1",
"optType": "",
"priceTck": "0.05",
"regLot": "1",
"secDesc": "RELIANCE INDUSTRIES LTD",
"strkPrice": "-1",
"symbolName": "RELIANCE",
"token": "2885",
"isCommodityWithOption": false,
"isIndices": false,
"maxSingleTransactionQty": "67658",
"compName": "RELIANCE INDUSTRIES LTD",
"npriceNum": "1",
"npriceDen": "1",
"sector": "Refineries",
"marketCapCategory": "Large Cap",
"mktcap": "1787896.63",
"scripType": "nseCash",
"isMTFEligible": true,
"astCls": "cash",
"series": "EQ",
"segmentSubType": "stockCash",
"minLot": "1",
"lotSize": "",
"divider": "100",
"filterTypes": [
"STOCKCASH"
]
},
{
"type": "scrip",
"icon": "icons/scrip/eq_v1.png",
"tradeSymbol": "RELIANCE",
"isCashWithFno": false,
"nseCashToken": "2885",
"bseCashToken": "500325",
"curFutToken": "",
"details": "RELIANCE INDUSTRIES LTD.",
"expirydate": "01 Jan 1980",
"instName": "",
"isinCode": "INE002A01018",
"mktSegID": "3",
"optType": "",
"priceTck": "0.05",
"regLot": "1",
"secDesc": "RELIANCE INDUSTRIES LTD.",
"strkPrice": "-1",
"symbolName": "RELIANCE",
"token": "500325",
"isCommodityWithOption": false,
"isIndices": false,
"maxSingleTransactionQty": "0",
"compName": "RELIANCE INDUSTRIES LTD",
"npriceNum": "1",
"npriceDen": "1",
"sector": "Refineries",
"marketCapCategory": "Large Cap",
"mktcap": "1787896.63",
"scripType": "bseCash",
"isMTFEligible": true,
"astCls": "cash",
"series": "A",
"segmentSubType": "stockCash",
"minLot": "1",
"lotSize": "",
"divider": "100",
"filterTypes": [
"STOCKCASH"
]
}
],
"suggester": {
"suggester": []
},
"categories": [
{
"keyword": "",
"displayValue": "All"
},
{
"keyword": "STOCKCASH",
"displayValue": "Cash"
}
],
"scripExperiment": ""
}
}Regards, Smart API Team
-
RE: unable to create TOTP
HI @mydomain
Describe your issue clearly with error screenshot. So, we can help you with a fix.
Regards, Smart API Team