How to fetch live options chain data in google sheets

How to fetch live options chain data in google sheets… pls help

Try from niftyinvest.com … do web scrapping through Google sheet… importhtml function and parameters with website url, table no. 1

Try this…

=IMPORTHTML(~https://niftyinvest.com/option-chain/NIFTY?expiry=03JUN2021,“table”,1)
Don’t put ~ sign as I have done it from changing it to shortened url

Here you can replace with desired expiry date…eg changing to 10JUN2021 to view 10th june’s expiry…

Thanks to my 12 yr baby :baby: to provide me this feed…

3 Likes

How to do that from nse

1 Like

It is no longer possible to pull option chain data directly from the NSE website to Google Sheets (Refer to Option data importing from google finance (open interest & implied volatility)). You can still pull data from the NSE website but it requires your own server (Refer to Option Chain API). The alternative is pulling data from 3rd party sources (like suggested in the above answer). In case you are interested, there is a video explaining how to pull option chain data from Moneycontrol and updating it at regular interval -

2 Likes

@Prayag In how many minutes the data will be updated if pulled from moneycontrol

1 Like

bhai jawab to do… kitne time mein update hoga agar fetch karenge to

1 Like

Apologises I haven’t tested so I can’t tell. There will likely be some delay. There is an old thread which mentions about it but best to test once and confirm -

How to add last updated timestamp in google sheets… suppose anything is edited or updated in the entire spreadsheet, date should be shown is specific cell e.g. F7

You could modify the Google App Script shared in the second video to achieve this -

function getNFTdata() 
{
var queryString = Utilities.formatDate(new Date(), "GMT", "yyyyMMddHHmmss");
// Nifty Data
var cellFunctionDataNft = '=IMPORTHTML("https://www.moneycontrol.com/india/indexfutures/nifty/9/2021-05-20/OPTIDX/CE/12800.00/true?' + queryString + '","table",6)';
SpreadsheetApp.getActiveSpreadsheet().getSheetByName("NFT").getRange('A3').setValue(cellFunctionDataNft);

SpreadsheetApp.getActiveSpreadsheet().getSheetByName("NFT").getRange('F7').setValue(queryString);

}

Date format can be changed to your liking. Refer to this documentation

The delay will be almost of 8 to 10 minutes from the nse website … i have my own dashboard for analysis but find the data is with a lag of almost 8 to 10 minutes.

You can get it live from nse website to sheet, delay can be 1-2 minutes, alternatively you can get it using kite websocket and update it live

Hello all team member i want to record oi data on Google sheet.

Record means all data with time for every 5min

You will have to write a py script to scrape the data from NSE website.