Api'S FOR STOCK

Others 94 views 1 replies

Hi

 

Im working on installing API's to retrieve stock data from NSE into spreadsheets. I've tried several but not working because they are all foreign API's for their stocks. Is there any API which works in India, free to use and easy to install and run?

 

Reg

Replies (1)

You're on the right track — many APIs out there (like Yahoo Finance, Alpha Vantage, IEX Cloud) mainly serve US/global markets, and retrieving NSE (India) stock data is tricky due to restrictions.

But yes, there are a few India-based APIs (some free, some limited) that can help you pull NSE stock data into spreadsheets.


✅ Best APIs for NSE (India) Stock Data

🔹 1. NSE India (Official Website) – Unofficial API

While NSE doesn't officially offer a public API, developers use web-scraping or unofficial endpoints.

Example Endpoint:

 
https://www.nseindia.com/api/quote-equity?symbol=INFY

❗ You'll need to set custom headers (like user-agent) and use it via Python, Apps Script, etc.

🔧 How to Use:

  • Write a Google Apps Script (for Google Sheets) or Python scriptt

  • Include headers to mimic a browser request

Limitations:

  • Can break anytime (not officially supported)

  • Rate-limited

  • NSE blocks bots aggressively


🔹 2. Groww / Zerodha Kite / Upstox APIs (For Trading + Data)

These are broker-backed APIs — need account & token.

Platform Access Type Notes
Zerodha Kite Connect Paid ₹2000/month for access, very powerful
Upstox API Free/Paid Good documentation
Groww API Beta/invite-based Use with Groww account

✅ Includes live prices, historical data, orders, etc.
⚠ Requires you to be a customer and go through API token setup.


🔹 3. RapidAPI – Unofficial NSE API

Some developers have hosted NSE stock APIs on RapidAPI.

Example:

  • NSE Stock API – returns quotes, option chains, etc.

  • Needs API key (free tier usually available)


🔹 4. Value Research / Screener.in (For Fundamentals)

While they don't offer real-time data:

  • Screener.in allows export to Excel

  • Great for financials, P&L, balance sheet, ratios

Use it for analysis, not price tracking.


🔹 5. Google Sheets Add-ons (Limited Support)

  • =GOOGLEFINANCE("NSE:INFY") used to work, but now inconsistent for Indian stocks.

  • You can try:

    • MoneyControl Scraper

    • Yahoo Finance (via Apps Script) — also limited for Indian stocks


✅ Recommendation (Free & Practical)

If you want free + spreadsheet integration, try this:

📌 Method: Google Sheets + Apps Script + NSE Unofficial API

  1. Go to Google Sheets > Extensions > Apps Script

  2. Paste this code:

 
function getNSEPrice(symbol) { var url = "https://www.nseindia.com/api/quote-equity?symbol=" + symbol; var options = { "method": "get", "headers": { "User-Agent": "Mozilla/5.0" } }; var response = UrlFetchApp.fetch(url, options); var json = JSON.parse(response.getContentText()); return json["priceInfo"]["lastPrice"]; }
  1. Save it, then use:

 
=getNSEPrice("INFY")

in your sheet.

⚠ You may need to run it manually first to authorize the scriptt.


🧠 Summary

API Type Source Free? Best For
Unofficial NSE nseindia.com Basic live prices
Broker APIs Zerodha, Upstox Live trading + data
Screener / ValueResearch Screener.in Financials & ratios
RapidAPI Community APIs ✅ (limited) Options & quotes
GoogleFinance Google Sheets ❌ (Inconsistent) Hit or miss for NSE


CCI Pro

Leave a Reply

Your are not logged in . Please login to post replies

Click here to Login / Register