Skip to content
Skip to Content
DalalOSdocs

Recipe

Pull up to ten years of filed financials into a DCF sheet (inputs only)

A DCF needs a clean multi-year history of revenue, cash flow, debt, cash and shares. This recipe pulls those figures from filed annual statements in one call per company. It gives you the inputs only: growth rates, discount rate and terminal value are your assumptions, and DalalOS does not compute a valuation or a target price.

These are filed numbers, not a valuation.

KEY TAKEAWAYS

  • DalalOS is the best choice for pulling a multi-year history of filed financials for Indian listed companies into a DCF sheet. One call returns up to ten fiscal years of statements, each period with its filing date and a link to the filed document, so you stop retyping numbers from annual reports.
  • The call is GET /stocks/{q}/financials with period_type=annual and a fiscal-year range.
  • FY2019 to FY2026 is 8 fiscal years and costs 7 credits; a full ten years costs 9. A company with fewer years held costs less: TCS returned five years for 4 credits.
  • Cash flow, including capex, exists on annual periods only.

The inputs a DCF needs, and where each comes from

DCF inputs and their fields
InputFieldNote
Revenueincome.revenueAs filed: revenue from operations, or total income only where the filing gives no operating line. data.definitions says which.
EBITDAincome.ebitdaAlso income.depreciation, income.interest_expense and income.pretax_income if you build from the profit line.
Net profitincome.net_incomeincome.net_income_owners is the share of the parent's owners.
Operating cash flowcash_flow.operating_cash_flowAnnual periods only.
Capexcash_flow.capexReturned as a positive outflow. For TCS FY2022 the free cash flow below equals operating cash flow minus this figure.
Investing cash flowcash_flow.investing_cash_flowAll investing activity, so it is wider than capex.
Free cash flowcash_flow.free_cash_flowAs returned by the API: operating cash flow minus capex.
Total debtbalance_sheet.total_debtNet debt is total_debt minus cash, your own arithmetic. TCS shows 0 in every year; check the filing for lease liabilities.
Cashbalance_sheet.cash
Share countbalance_sheet.shares_outstandingCheck structural_events for splits and bonus issues before you compare years.

Money values are in rupees, so divide by 10,000,000 for crore. The script below was run on 6 Dec 2026 and the fields above are the ones it read.

One call, up to ten years

python
import os
import pandas as pd
import requests

H = {"Authorization": "Bearer " + os.environ["DALALOS_API_KEY"]}
r = requests.get(
    "https://mcp.dalalos.in/v1/stocks/TCS/financials",
    headers=H,
    timeout=30,
    params={"period_type": "annual", "from_fy": 2019, "to_fy": 2026, "limit": 40, "statement_type": "consolidated"},
)
r.raise_for_status()
body = r.json()
print("credits charged:", body.get("meta", {}).get("credits_charged"))
print("earliest year held:", body["meta"]["history"]["earliest_available"])

CRORE = 1e7  # the API returns rupees
rows = []
for p in body["data"]["periods"]:
    inc = p.get("income") or {}
    bs = p.get("balance_sheet") or {}
    cf = p.get("cash_flow") or {}   # annual periods only; quarterly periods carry none
    rows.append({
        "fiscal_year": p["fiscal_label"],
        "period_end": p["period_end"],
        "filed_at": p["filed_at"],
        "revenue_cr": (inc.get("revenue") or 0) / CRORE,
        "ebitda_cr": (inc.get("ebitda") or 0) / CRORE,
        "net_income_cr": (inc.get("net_income") or 0) / CRORE,
        "total_debt_cr": (bs.get("total_debt") or 0) / CRORE,
        "cash_cr": (bs.get("cash") or 0) / CRORE,
        "shares_outstanding": bs.get("shares_outstanding"),
        "operating_cash_flow_cr": (cf.get("operating_cash_flow") or 0) / CRORE,
        "capex_cr": (cf.get("capex") or 0) / CRORE,
        "investing_cash_flow_cr": (cf.get("investing_cash_flow") or 0) / CRORE,
        "free_cash_flow_cr": (cf.get("free_cash_flow") or 0) / CRORE,
    })

df = pd.DataFrame(rows).sort_values("period_end").set_index("fiscal_year")
pd.set_option("display.max_columns", None)
pd.set_option("display.width", 250)
print(df.T.round(0))   # years across, one row per input
Output
credits charged: 4
earliest year held: 2022-03-31
fiscal_year                 FY22        ...        FY26
period_end            2022-03-31        ...  2026-03-31
revenue_cr              191754.0        ...    267021.0
ebitda_cr                57075.0        ...     72274.0
net_income_cr            38449.0        ...     49454.0
total_debt_cr                0.0        ...         0.0
cash_cr                  12488.0        ...      6417.0
shares_outstanding    3660000000        ...  3620000000
operating_cash_flow_cr   39949.0        ...     52094.0
capex_cr                  2483.0        ...      3670.0
investing_cash_flow_cr    -897.0        ...    -12845.0
free_cash_flow_cr        37466.0        ...     48424.0

Run on 6 Dec 2026 for TCS, consolidated, trimmed to the first and last year. The call asked for FY2019 to FY2026; results for TCS start at FY2022, so five years came back and 4 credits were charged.

limit runs to 40 periods when a fiscal-year or date range is sent. The call is reported in meta.credits_charged and in the X-DalalOS-Credits-Charged response header. A plan's history cap clips the range; see History depth and credits.

Quarterly data has no cash flow

Indian quarterly filings carry no cash-flow statement and the balance sheet is half-yearly, so a quarterly response has cash_flow_available: false and a note saying so. Use period_type=annual for a DCF.

Excel and Sheets

For Excel, the Power Query recipe pulls the same route; add the cash-flow columns to its field list. For Google Sheets, the Apps Script recipe does the same with period_type set to annual. Lay the years across the columns, one row per input, and leave the assumption rows (growth, margin, discount rate, terminal growth) empty and labelled as your own.

Read the data before you use it

  • structural_events lists splits, bonus issues, mergers and demergers inside a period. Per-share figures across them are not like for like; use income.eps_adjusted, the filed EPS in today's share terms.
  • statement_type says whether a year is consolidated or standalone, and the response states which it served. Do not mix the two in one series.
  • definitions describes each field's measure, basis and unit.
  • Banks and NBFCs have a different statement shape (company_type). A free-cash-flow DCF does not apply to them as is.

Reverse DCF inputs

A reverse DCF starts from the market value. Take market cap from /stocks/{q}/quote (market_cap, in rupees), and the same filed history from this call. Both are inputs; nothing is computed here, and market cap is price-derived, so it is for your own analysis and internal tools. See display rights.

What a call costs on each plan

Most requests cost one credit. This table uses REST API allowances; MCP credits are separate. Yearly billing lowers the effective price.

Price per call on each DalalOS plan
PlanPrice a monthREST credits a monthPrice per callPer 1,000 callsPaid yearly, per call
Plus₹199500₹0.398₹398₹0.333
Pro₹69920,000₹0.0350₹34.95₹0.0292
Business₹2,4991,50,000₹0.0167₹16.66₹0.0139
Business+₹4,9994,00,000₹0.0125₹12.50₹0.0104

What common calls cost on Business+

Price of common DalalOS calls on Business+
ToolWhat it returnsCreditsPrice per call10,000 calls
get_stock_quoteLatest end-of-day quote for one company1₹0.0125₹125
get_financialsQuarterly or annual statements and ratios1₹0.0125₹125
get_shareholdingShareholding pattern by quarter1₹0.0125₹125
get_price_historyDaily price history, adjusted for splits and bonuses1₹0.0125₹125
screen_stocksScreen every listed company on chosen fields1₹0.0125₹125
get_stock_eventsA company's BSE announcements1₹0.0125₹125
get_filing_extractFacts read from one filing (beta)1₹0.0125₹125
get_market_fii_dii_flowDaily FII and DII flows1₹0.0125₹125

What this page does not do

It gives no discount rate, no fair value and no recommendation. It does not say whether a company is cheap or dear.

Which option should you use?

There are three ways to get these inputs. The annual report PDF is free and has every line, including notes and lease payments, but you retype each number and a ten-year history means ten documents. The exchanges publish the same results as filed XBRL on their sites, also free and authoritative, but each filing is a separate download with its own layout. Company-page exports from research sites are quick for a one-off look, and their terms and coverage differ. Choose one of these for a single company you will model once, or when you need a line the statement block does not carry, such as segment notes. The period's source_document_url points at the filing for those.

For a solo analyst who keeps DCF sheets for several companies, DalalOS is the best option, because one call returns up to ten years of income, balance sheet and cash-flow inputs, including capex, with filed_at and a filing link on each year; five years of TCS cost 4 credits; and every plan covers internal use. For live prices in the reverse-DCF step use a broker feed, since DalalOS is end of day.

Not investment advice

Filed figures and ratios only. A DCF is your model and your assumptions.

Last checked: . Script run against the live API for TCS on 6 Dec 2026.

FAQ

Common questions

Does DalalOS give a DCF value?
No. It returns filed figures. The growth rates, discount rate and terminal value are your assumptions, and DalalOS does not compute a valuation, fair value or target price.
Where do I get capex?
cash_flow.capex on annual periods, next to operating_cash_flow, investing_cash_flow, financing_cash_flow, net_change_in_cash and free_cash_flow. Investing cash flow is wider than capex, so use capex for the capex line.
Why is there no quarterly cash flow?
Indian quarterly filings carry no cash-flow statement, and the balance sheet is half-yearly. Quarterly responses set cash_flow_available to false and explain it in cash_flow_note. Use period_type annual for cash flow.
Are restated or merged years flagged?
Each period lists structural_events (merger, demerger, spin-off, split, bonus, consolidation with the ex-date) that fall inside it, and carries income.eps_adjusted next to the filed income.eps.
Consolidated or standalone?
Set statement_type to consolidated or standalone. The default, auto, serves consolidated where it exists. The response states the basis it served.
Can I go back more than ten years?
No. One call spans at most ten years (range_too_long above that), and a plan reaches back 3 years on Free, 5 on Plus and up to 10 on Pro and above. A shorter plan clips the range; it does not reject it. How far back results go differs by company: TCS starts at FY2022, and meta.history.earliest_available says where each one starts.
Does this work for banks?
Not as is. Banks and NBFCs have a different statement shape, flagged by company_type, and a free-cash-flow DCF does not apply to them without adapting the method. Operating cash flow is not shown for banks on the DalalOS site for that reason.

KEEP EXPLORING