Price data from Indian stock exchanges

I am sharing, a link to github.com page which has API for the purpose.

Hope this can be implemented in PP for Indian users.

**

It was heartening that Andreas quickly implemented import of kfintech CAS pdf import and then fetching historic NAV. A BIG thanks for the same! :clap: :clap: :pray: :pray:

**

1 Like

Can this API be implemented, as yahoo finance is not always stable, which keep changing its policy
Thanks

Is this something different than the one described in the docs?

Yes AMFI is the source if Mutual Fund NAV, which has been very well implemented.

What I am referring to is the stock price, traded in two stock exchange namely
Bombay Stock Exchange and National Stock Exchange.

So yes, both are different!

The Net Asset Value (NAV) of Mutual Fund (we call it mutual fund in India perhaps in place of ETF), which is a group of many stocks is obtained from AMFI, which has already been implemented in PP

How ever latest or Historic price of individual stock (e. g. Siemens) has to be obtained from stock exchange, which I mentioned in my earlier posts and for which I shared GITHUB project for API link.
Thanks

Hi,
I think that it is possible to retrieve the prices from NSE through the JSON Quote Feed Provider. See the docs in the how-to section JSON.

In the image below, you find the info for the different parameters.

Feed URL: https://www.nseindia.com/api/historical/cm/equity?symbol=SIEMENS&from=07-06-2024&to=07-10-2024
Path to Date: $.data[*].CH_TIMESTAMP
Path to Close: $.data[*].CH_CLOSING_PRICE

If you leave out the from & to dates, then (I think) the last month of prices will be given.

Can you check if this is correct and works for you?

1 Like

Thanks for your kind help.
I tried as guided by you, with date as well as without date, but it fails to fetch the file.
I tried two scripts

  1. Reliance (Reliance.ns for yahoo)
  2. M&M (M&M.ns for yahoo)

Both fails to fetch data with nseindia API while Yahoo could fetch.

Thanks
Paras

Hi @ProgFriese, maybe you can help with this. The feed URL and path to Date and Close are sometimes giving results in PortfolioPerformance (see image above). The feed URL always return valid JSON in the browser. Maybe it depends on having the browser already opened that page before PP can retrieve the data? What do you think?

1 Like

Hi @hug-sch,
if I havenโ€™t completely lost my way during testing, you need several prerequisites for reliably reproducible responses from www.nseindia.com/api/historical: A cookie set by www.nseindia.com, which also contains an โ€œnseappidโ€, with which you can then ask the API for historical prices, but this is only successful if you make a request with the appropriate referrer for the respective security. All very unpleasant, I lost the desire to deal with it further during testing.

@Pd03 Have you tried this successfully?

EDIT: I donโ€™t think so, see all end points are dead ยท Issue #51 ยท maanavshah/stock-market-india ยท GitHub

1 Like

No, when I tried to follow the instruction to install npm express, and tnen create port, it comes with error message that object not found.

I think there is a free API from upstox as well, but being a non technical person, I could not follow half of the instruction.

I was hoping to have a stable source of data, as yahoo keeps changing its offering.

It appears as of now, have to rely upon available API only.

But my heartfelt thanks to you all for your valuable time and kind support.
Paras

I was afraid, it would be something like that. Itโ€™s a pity. Thanks anyway.