Skip to content
Skip to Content
DalalOSdocs

Reference

History depth, date ranges and credits

Six datasets take a date range, so one call can reach back to a company's first filing instead of its last few periods. Deep history costs credits by the fiscal year, and a plan decides how far back it may go.

Fields and parameters here are the contract the API is built to. The range inputs appear on each route's reference page and in its playground.

KEY TAKEAWAYS

  • What DalalOS is for: pulling years of Indian company results, shareholding and filings in one call. One range parameter works the same on six datasets, and the response states the range it served and the credits it charged.
  • Send from and to (dates), or from_fy and to_fy on results and shareholding.
  • Up to 2 fiscal years cost 1 credit; each further year adds 1.
  • Free reaches back 3 years, Plus 5; Pro and the Business plans reach as far back as we hold.
  • Every answer from these six routes carries meta.history and meta.credits_charged.

Range parameters

The same names work on the REST routes and, as from_date and to_date, as MCP tool arguments (from is reserved in Python). REST also accepts from_date and to_date.

Range parameters
ParameterTypeMeaning
fromdateStart of the range, inclusive, YYYY-MM-DD.
todateEnd of the range, inclusive. Defaults to today.
from_fyintegerFirst Indian fiscal year, April to March, by the year it ends: 2019 is FY2018-19 (2018-04-01 to 2019-03-31). Results and shareholding only.
to_fyintegerLast fiscal year, same convention. Results and shareholding only.
cursorstringThe meta.next_cursor of the previous page. Announcements and documents only.

The range matches each record's own date: period_end for results and shareholding, filed_at for announcements and documents, ex_date for corporate actions and dividends. When from is left out but to is sent, the range starts the route's default window before to: 2 years for results and shareholding, 30 days for announcements, 365 days for documents, 5 years for corporate actions and dividends. A call with no range parameter answers exactly as before. limit, days and years work as before, and limit can be combined with a range to cap the rows returned, newest first. On results and shareholding its maximum rises from 20 to 40 when a range is given. On announcements and documents a range comes back in pages of limit rows (announcements: default 200, max 1000; documents: default 500, max 1000), and meta.next_cursor fetches the next page.

One style at a time

A call that sends a range together with days or years, or from together with from_fy, answers 400 conflicting_range_params.

Where the range works

Datasets that take a range
DatasetREST routeMCP toolRange matchesCredits
ResultsGET /stocks/{q}/financialsget_financialsperiod_endBy fiscal year
ShareholdingGET /stocks/{q}/shareholdingget_shareholdingperiod_endBy fiscal year
AnnouncementsGET /stocks/{q}/eventsget_stock_eventsfiled_atBy fiscal year
Company documentsGET /stocks/{q}/documentsget_company_documentsfiled_atBy fiscal year
Corporate actionsGET /stocks/{q}/corporate-actionsget_corporate_actionsex_date1, whatever the range
DividendsGET /stocks/{q}/dividendsget_dividendsex_date1, whatever the range

Price history, valuation history and the other history-shaped tools are not part of this change and keep their current windows.

Credits by fiscal year

One call is one company and one dataset. For 4 of the datasets the cost follows the number of Indian fiscal years (April to March) that the range touches: max(1, fiscal_years - 1). The first 2 are in the base credit.

Credits by fiscal years in range
Fiscal years in rangeCredits
Up to 21
32
54
109
  • Charged for the years we hold. The range is first clipped to your plan's history limit, then to the earliest and latest record we hold for that company and dataset. Only the fiscal years left are counted. A range with no data in it costs 1 credit.
  • Corporate actions and dividends are flat. Corporate actions and dividends cost 1 credit whatever the range.
  • Next pages are free. Announcements and documents return meta.next_cursor; a request with a valid cursor costs nothing.
  • No range, same cost. A call without a range parameter costs what it did before.
  • Charged before the work. If your remaining credits are below the cost, the call answers 402 and nothing is run. On a route that carries a higher per-call weight, the weight multiplies the per-year credits.

Example: on Pro, results from from_fy=2019 to to_fy=2026 for a company we hold in full are 8 fiscal years, so 7 credits. If the company's first record is in FY2021-22, the same call counts 5 years and costs 4.

How far back each plan reaches

History depth by plan
PlanHistoryLimit the API applies
Free3 years3 years from today
Plus5 years5 years from today
ProAll available history10 years from today
BusinessAll available history10 years from today
Business+All available history10 years from today

We hold results and shareholding from FY2018-19 for most companies, and add older years over time.

The limit clips; it does not reject. A request that reaches further back is answered from the earliest date the plan allows, and the response says so. Older years and days requests are clipped the same way: on Free, years=5 on corporate actions returns 3 years. Plan prices and monthly credits are on the pricing page.

What the response adds

Inside the usual envelope, meta gains these fields. The REST response also sets the header X-DalalOS-Credits-Charged to the same number as meta.credits_charged.

Fields added to meta
FieldMeaning
meta.history.requested_fromThe range you asked for, start and end (requested_to). requested_from is null on a results or shareholding call without a range, which returns the newest periods.
meta.history.effective_fromThe range actually served, after the plan limit and our coverage (effective_to).
meta.history.earliest_availableThe earliest record we hold for this company and dataset.
meta.history.plan_max_history_yearsHow many years your plan reaches back.
meta.history.clipped_by_planTrue when the plan limit cut off records we hold for this company, so a higher plan would return more. False when we hold nothing older than your plan reaches.
meta.history.noteA plain sentence when the range was clipped or lies before our first record. Without it an empty list would be unexplained.
meta.credits_chargedCredits this call used, on REST and MCP alike, including any per-call weight on the route. 0 on a cursor page.
meta.next_cursorAnnouncements and documents: pass it as cursor for the next page. null on the last page.

A cursor is signed by the server and tied to your account, the route, the company, the clipped range and the filters. It expires after 24 hours.

Errors

Errors for ranges and credits
Statusreason_codeMeaning
400conflicting_range_paramsA range (`from`, `to`, `from_fy`, `to_fy`) was sent together with an older window parameter (`days` or `years`), or `from` with `from_fy` (`to` with `to_fy`). Send one or the other.
400invalid_range`from` is after `to`.
400invalid_argumentA date that is not YYYY-MM-DD, a fiscal year that is not a year such as `2019`, or `from_fy`/`to_fy` on a route other than results and shareholding.
400range_too_longThe range spans more than 10 years, the most one call can cover on any plan.
400invalid_cursorThe cursor is malformed, or it was issued to another account, route, company or set of parameters.
400cursor_expiredThe cursor is older than 24 hours. Repeat the first request to start again.
402quota_exceededYour remaining credits are below what this call costs. The REST body, and the MCP limit reply's `meta`, add `credits_needed` and `credits_remaining`; nothing was run or charged.
MCP tool errorrequest_too_large_to_priceAn MCP request body over 1 MiB cannot be priced, so it is charged 1 credit and a history tool in it refuses a range. Send the ranged call on its own.

The other errors every route can return are on Plans, credits and errors.

Research data only. Answers are disclosed facts and mechanically computed figures, never investment advice.

FAQ

Common questions

How many credits does a ten-year range of results cost?
Nine credits, when we hold all ten fiscal years for the company. We add older years over time, and meta.history.earliest_available says where our records start. The first 2 fiscal years are in the base credit and every further year adds one. A call with no range parameter keeps its usual cost of one credit.
Am I charged for years the company has no data for?
No. The charge counts only the fiscal years inside the range that we hold records for. A range that reaches back past the company's first record, or past your plan's history limit, is shortened first and charged for what is left. A range with no data at all costs one credit.
What happens if I ask for more history than my plan includes?
The request is not rejected. It is answered from the earliest date your plan reaches, and meta.history says so: when we hold older records for the company, clipped_by_plan is true and the note names your plan's limit.
Do the next pages of announcements and documents cost credits?
No. The first page is charged for the whole range. A request that carries a valid cursor from it is free.
What is the longest range one call can cover?
10 years, on every plan. A longer range answers 400 with reason_code range_too_long. Split it into two calls.

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