Announcing Option Greeks API for SmartAPI Users
-
Dear SmartAPI users,
We had seen this request multiple times in the forums and wanted to make it available for you at the earliest. We wanted you to know that we've heard you.
We are glad to announce option greeks API for our users. Using this API, you can find the greeks for option contracts with a simple request.The API endpoint is:
https://apiconnect.angelbroking.com/rest/secure/angelbroking/marketData/v1/optionGreek
Method - POST
Headers are same as for all other APIs.The request body is as follows:
{"name":"TCS", // Here Name represents the Underlying stock "expirydate":"25JAN2024"}
Once you pass the underlying and the desired expiry date, it provides you the four greeks, i.e. Delta, Gamma, Theta, Vega and Implied Volatility (IV) for multiple strike prices.
Here is the Sample Response:
{ "status": true, "message": "SUCCESS", "errorcode": "", "data": [ { "name": "TCS", "expiry": "25JAN2024", "strikePrice": "3900.000000", "optionType": "CE", "delta": "0.492400", "gamma": "0.002800", "theta": "-4.091800", "vega": "2.296700", "impliedVolatility": "16.330000", "tradeVolume": "24048.00" }, { "name": "TCS", "expiry": "25JAN2024", "strikePrice": "4000.000000", "optionType": "CE", "delta": "0.239000", "gamma": "0.002200", "theta": "-3.033500", "vega": "1.785400", "impliedVolatility": "22.190000", "tradeVolume": "12976.00" }
There will be multiple JSON objects in the response, each for a specific strike price.
We hope this helps you in your trading journey and makes your daily trading tasks a bit easier than before.
Thank you.
Regards
SmartAPI Team -
@viralpatel Check in market hour, it will work.
-
Hi @viralpatel We have verified the requests (TCS) from our end and are able to retrieve the data successfully. Kindly recheck and let us know if the issue still occurs.
Thanks & Regards,
SmartAPI team -
@Moderator_1 I am not able to get the data yet.
getting below response. Is there any issue from your side?Request: {'name': 'TCS', 'expirydate': '25JUL2024'}, Response: {'status': False, 'message': 'No Data Available', 'errorcode': 'AB9019', 'data': None}
{'status': False, 'message': 'No Data Available', 'errorcode': 'AB9019', 'data': None} -
@piyush24kp Hey does it work only during live market hours, or does it work after the market has closed?
-
-
Hello @piyush24kp,
It is available for live contracts only. We do not provide data for expired options contracts as of now.
You can check which contracts are available from the Scrip master file.
Thank you.
Regards
SmartAPI Team -
@Moderator_1
It is available only in live market? -
@Moderator_1 @Moderator_2 Can you share the logic or code you are using to calculate the option greek. I need options greeks for past expiries but it is not provided by api.
-
There is no data returned for optionGreek
OptionGreeks POST Request Url :: https://apiconnect.angelbroking.com/rest/secure/angelbroking/marketData/v1/optionGreek OptionGreeks POST Request :: {"name":"TCS","expirydate":"25APR2024"} OptionGreeks POST Response :: {"status":false,"message":"No Data Available","errorcode":"AB9019","data":null}
-
@Moderator_1 The option greeks provided by angel one does not match with that of sensibull. Do you know why is that happening and which one would be correct?
-
Hello @piyush24kp,
Data is already available for Greeks and Implied Volatility. Is there anything specific data point you want? Please let us know.
Thank you.
Regards
SmartAPI Team -
@Moderator_1 When the data is going to be available.?
-
Hello @manojtripathi96,
The updated SDKs have been recently released. Please update your SDK to the latest version and try once again and let us know if it is working for you.
Thank you.
Regards
SmartAPI Team -
@Moderator_1 BRO THIS THING DOES NOT WORK
import axios from 'axios';
const requestData = {
"name": "TCS",
"expirydate": "28MAR2024"
};var config = {
method: 'post',
url: 'https://apiconnect.angelbroking.com/rest/secure/angelbroking/marketData/v1/optionGreek',
data: requestData
};axios(config)
.then(function(response) {
console.log(JSON.stringify(response.data));
})
.catch(function(error) {
console.log(error);
});{"success":false,"message":"Invalid Token","errorCode":"AG8001","data":""}
-
Hi @PareshBhatiya,
This data is not available on socket yet. Apologies of inconvenience.
Thank you.
Regards
SmartAPI Team -
Hi @navanecs
Apologies for delayed response.
We have verified on both requests(TCS & Nifty) from our end. And we are able to retrieve the data for the same.
Kindly recheck and let us know if the issue still occurs.Thanks & Regards,
SmartAPI team -
I'm getting the error response for this api as below:
{"status":false,"message":"No Data Available","errorcode":"AB9019","data":null}
for body={
"name":"NIFTY",
"expirydate":"01FEB2024"
}Also tried the with request
{"name":"TCS", // Here Name represents the Underlying stock
"expirydate":"29FEB2024"}got the same error response as
{"status":false,"message":"No Data Available","errorcode":"AB9019","data":null}Please help.
-
I'm getting this as a response:
{'status': False, 'message': 'No Data Available', 'errorcode': 'AB9019', 'data': None}for body={
"name":"NIFTY",
"expirydate":"25JAN2024"
} -
@Moderator_1 said in Announcing Option Greeks API for SmartAPI Users:
{"name":"TCS", // Here Name represents the Underlying stock
"expirydate":"25JAN2024"}can we get this data by socket?