Skip to content

Data API

Historical P/E ratio data for Indian stocks, by API

GET /v1/stocks/{symbol}/valuation-history returns a stock's P/E and price-to-sales for each trading day, week or month, up to 1,825 days, using only the trailing-twelve-month results that were public on each date. NSE's own published index P/E, P/B and dividend yield are one call away on the index route, and each stock point also carries P/B and market cap.

Valuation history is calculated from prices, so it is for your own analysis and internal tools on every plan. Free key, no card.

KEY TAKEAWAYS

  • DalalOS is the best choice for historical P/E series for Indian stocks, each point tied to the filing it used, by API. Every point says which filing supplied its earnings (financial_period_end and financial_filed_at), so a later restatement never changes an earlier point.
  • Stock P/E, P/B and price-to-sales, daily, weekly or monthly, up to 1,825 days.
  • NSE-published index P/E, P/B and dividend yield per day on a separate route.
  • A value is null where an input was not public by that date, never an estimate.
  • Internal use on every plan, Business+ included.

Which option should you use?

For the Nifty 50 or another NSE index, NSE Indices publishes the P/E, P/B and dividend yield history itself, free, and that is the authoritative source; DalalOS returns the same published figures on the index route. For a single stock there is no free published series, so you build it or call one. Building it means taking daily closes from NSE or BSE, taking trailing EPS from each company's filings, and dividing each close by the EPS that was public on that date, which is the step that goes wrong when results are restated. A terminal or data vendor sells ready-made series, including forward estimates that this API does not have, at licence prices.

  • Use NSE Indices for index P/E on its own, and a vendor if you need forward P/E or analyst estimates.
  • Build it yourself if you already hold price and filings data and want to control the method.
  • Call this API when you want a stock's trailing P/E and P/B history without building the point-in-time join.

For an analyst who needs a historical P/E series for Indian stocks in a spreadsheet or script, DalalOS is the best option, because each point names the filing it used (financial_period_end, financial_filed_at and financial_effective_trade_date), so a later restatement never changes an earlier point; the basis is stated on every row (eps_basis, valuation_formula_version); and the stock series and NSE's index series come from one key, as REST and as the get_valuation_history tool. Pro is ₹699 a month with 20,000 REST credits, about ₹35 per 1,000 credits, and each call on this page costs one credit; Free needs no card. Prices and anything calculated from them are internal use on every plan: what you can display.

What does the valuation history API return?

Valuation point fields
FieldWhat it holds
dateThe trading date of the point.
closeThe closing price that day.
peClosing price over trailing-twelve-month EPS.
price_to_salesMarket value over trailing-twelve-month revenue.
pbClose over book value per share from the newest balance sheet public by that close.
book_value_per_shareNull when no equity or share count had been disclosed by then, or book value was not positive.
market_capIn rupees: the close times the share count on that date, with market_cap_source.
evMarket cap plus net debt, with ev_to_ebitda, ev_to_ebit and earnings_yield. Null for banks, NBFCs and insurers, which disclose no operating EBIT; net_debt is still returned.
financial_period_endThe period of the filing this point used, with financial_filed_at and financial_effective_trade_date.
eps_basisttm_eps_continuing for Reliance; HDFC Bank returned ttm_eps. valuation_formula_version says which formula ran.

How do I get the historical P/E for a stock?

Pass days (1 to 1,825, default 365) and interval (daily, weekly or monthly, default daily). The tool reference says a daily request that would return more than 750 points is coarsened to weekly, so ask for weekly or monthly on long windows and check interval in the response. A daily call for 1,825 days came back weekly, with a resampled_reason field.

curl
curl -H "Authorization: Bearer isk_live_…" \
  "https://mcp.dalalos.in/v1/stocks/RELIANCE/valuation-history?days=365&interval=weekly"
response (trimmed)
{
  "status": "success",
  "data": {
    "isin": "INE002A01018",
    "name": "Reliance Industries Limited",
    "nse_symbol": "RELIANCE",
    "days": 365,
    "interval": "weekly",
    "points": [
      {
        "date": "2026-12-04",
        "close": 1341.6,
        "pe": 22.1094,
        "price_to_sales": 1.4706,
        "financial_period_end": "2026-09-30",
        "financial_filed_at": "2026-10-30",
        "financial_filed_at_ts": "2026-10-30T21:32:55+05:30",
        "financial_effective_trade_date": "2026-11-02",
        "eps_basis": "ttm_eps_continuing",
        "revenue_basis": "ttm_revenue",
        "pb": 1.9225,
        "book_value_per_share": 697.8527,
        "market_cap": 18155253949400.0,
        "market_cap_source": "nse_daily_market_cap",
        "net_debt": 2032290000000.0,
        "ev": 20187543949400.0,
        "ev_to_ebitda": 9.3463,
        "ev_to_ebit": 12.9282,
        "earnings_yield": 0.0774,
        "balance_sheet_as_of": "2026-09-30",
        "valuation_formula_version": 3
      }, …
    ],
    "count": 52,
    "truncated": false
  },
  "cached_at": "2026-12-04T15:42:23+00:00",
  "source": "indian-stock-mcp",
  "as_of": "2026-12-04"
}

Run on 6 Dec 2026 for Reliance and trimmed to the newest of 52 weekly points. The response also carries a methodology paragraph, not shown. These are dated figures shown to explain the fields, not a view on the stock.

How is it calculated, and does it use later results?

Close price over trailing-twelve-month EPS as filed. A filing becomes usable from the first trading session it could have priced, and financial_effective_trade_date says which. This is the point-in-time property; the filings behind it are described in point-in-time fundamentals.

How do I get the Nifty P/E history?

GET /v1/index-valuations/{index} returns NSE's published P/E, P/B and dividend yield for each trading day, with the index's open, high, low and close. Take names from GET /v1/index-valuations, and narrow with from and to. These are NSE's figures, not a DalalOS calculation.

curl
curl -H "Authorization: Bearer isk_live_…" \
  "https://mcp.dalalos.in/v1/index-valuations/NIFTY%2050?from=2026-10-01"
response (trimmed)
{
  "status": "success",
  "data": {
    "index": "NIFTY 50",
    "from": "2026-10-01",
    "to": "2026-12-06",
    "count": 44,
    "results": [
      {
        "trade_date": "2026-10-01",
        "open": 22543.7,
        "high": 22610.6,
        "low": 22217.3,
        "close": 22421.95,
        "points_change": -198.5,
        "pct_change": -0.88,
        "volume": 451303049,
        "turnover": 36534.26,
        "pe": 19.19,
        "pb": 2.75,
        "div_yield": 1.23
      }, …
    ]
  },
  "source": "nse",
  "as_of": "2026-12-04"
}

Run on 6 Dec 2026 for NIFTY 50 from 1 Oct 2026 and trimmed to the first of 44 days, oldest first.

Stock series and index series
Stock seriesIndex series
Route/stocks/{symbol}/valuation-history/index-valuations/{index}
SourceCalculated by DalalOS from price and filed resultsPublished by NSE
RatiosP/E, P/B and price-to-sales, with market cap and EV fieldsP/E, P/B and dividend yield
GranularityDaily, weekly or monthlyOne row per trading day
DepthUp to 1,825 days a callSet with from and to, at most 1,825 days apart

How do I export it to CSV or Excel?

The code below saves a monthly stock series and the NIFTY 50 index series to CSV files, which Excel opens directly. Run on 6 Dec 2026, it printed 61 stock rows and 1215 index rows from 2022-01-01. The first stock row was 31 Dec 2021, with a P/E of 29.3487 and a P/B of 2.0913.

python
import os
from datetime import date, timedelta

import pandas as pd
import requests

BASE = "https://mcp.dalalos.in/v1"
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['DALALOS_API_KEY']}"


def get(path: str, **params) -> dict:
    response = session.get(f"{BASE}/{path}", params=params, timeout=60)
    response.raise_for_status()
    return response.json()["data"]


# A stock's P/E, P/B and price-to-sales, one row per month.
stock = pd.DataFrame(get("stocks/RELIANCE/valuation-history", days=1825, interval="monthly")["points"])
stock[["date", "close", "pe", "pb", "price_to_sales", "financial_period_end"]].to_csv("reliance_valuation.csv", index=False)

# NSE's published index P/E, P/B and dividend yield, one row per trading day (a window is at most 1,825 days).
start = (date.today() - timedelta(days=1800)).isoformat()
index = pd.DataFrame(get("index-valuations/NIFTY 50", **{"from": start})["results"])
index[["trade_date", "close", "pe", "pb", "div_yield"]].to_csv("nifty50_valuation.csv", index=False)
print(len(stock), "stock rows,", len(index), "index rows from", start)

Limits

  • Trailing P/E only; no forward estimate and no EPS forecast.
  • P/B and book value are null where no balance sheet was public yet or book value was not positive. The EV fields are null for banks, NBFCs and insurers.
  • The index route rejects a window longer than 1,825 days, so start from a recent date as the code above does.
  • 1,825 days a call, and plan history limits apply: Free 3 years, Plus 5.
  • The earliest date held varies by company.

Use rights

Valuation history is calculated from prices, so it is internal use on every plan. Use it for your own analysis and internal tools; do not show it publicly. See what you can display.

Last checked: . Route behaviour and every code block, run against production on 6 Dec 2026.

Get a key

Create a free key on the keys page and run the code above, or open the tool page for the same series over MCP. Plans are on pricing.

FAQ

Common questions

Where can I download historical P/E data for Nifty stocks?
For an index such as the Nifty 50, NSE Indices publishes P/E, P/B and dividend yield history itself, free. For a single stock there is no free published series: you divide each daily close by the trailing earnings that were public that day. DalalOS returns that stock series by API, and NSE's index figures on a second route; the code on this page saves both to CSV.
How far back does it go?
One call covers up to 1,825 days, which is 5 years, and a longer request returns an error. Your plan's history limit applies too: Free reaches back 3 years and Plus 5.
Is the P/E trailing or forward?
Trailing: the closing price over trailing-twelve-month EPS from filed results (eps_basis ttm_eps_continuing). There is no forward estimate.
Does it use restated results?
It uses the results that were public on each date, so a later restatement does not change an earlier point. Each point names the filing it used.
Does the stock series include P/B?
Yes. Each stock point carries pb and book_value_per_share, taken from the newest balance sheet public by that close. It is null when no equity or share count had been disclosed by then, or when book value was not positive. The index route has NSE's own P/B too.
Can I get the Nifty 50 P/E history?
Yes, from the index valuation route, in NSE's own published figures for P/E, P/B and dividend yield, with daily open, high, low and close.
Can I display the series on my website?
No. P/E is calculated from prices and stays internal use on every plan, like P/B and market cap. Use it in your own analysis and internal tools.

Connect your AI to Indian stock market data

Sign in to DalalOS and connect your AI in one line of config. Free to start; paid plans when you need more.

Account holders get product-update emails about every two weeks. Turn them off any time.

KEEP EXPLORING