Browse documentation
API referencePOST/v1/daily-summary/5 credits / request
Try it

Generate portfolio summary

POST /v1/daily-summary/

Turns stock symbols, with optional exposure weights, into a markdown digest of news, filings, events, and price moves over 1 to 7 days. Choose exposure for portfolio digests, intraday_movements for live move scans, or news_context for news without price commentary. context_window_days can include up to seven calendar days of prior context.

When to use it

Use this endpoint for end-of-day portfolio digests, mid-session "why is my watchlist moving?" scans, and news-only briefings. See Choosing a mode below. Increase context_window_days when a move or news catalyst may have started before today. For many summaries at once, use batch jobs.

Authentication and billing

  • Requires X-API-Key or api_key.
  • Credit cost: 5 credits / request. Bills 5 credits only when a summary is generated. Failed and no-news/no-signal responses are not charged.
  • See pricing for plan allowances and full billing details.

Request

Body: A JSON object with one symbol list (symbols, items, or portfolio) and two optional settings: mode and context_window_days. The smallest valid body is {"symbols": ["TCS"]}.

FieldLocationRequiredNotes
symbolsbodyNoSimplest input: an array of NSE symbols such as ["TCS", "INFY"]. Send one of symbols, items, or portfolio.
itemsbodyNoArray of { symbol, exposure?, label? } objects for a symbol set with optional weights. exposure is a percentage, so 12.5 means 12.5%. Send one of symbols, items, or portfolio.
portfoliobodyNoArray of { symbol, exposure?, label? } objects for the reader's own holdings. Same shape as items, but allows "your portfolio" wording, and a missing exposure counts as 0. Send one of symbols, items, or portfolio.
modebodyNoOptional mode: exposure, intraday_movements, or news_context. Defaults to exposure for portfolio input or when any item has exposure, otherwise intraday_movements. See Choosing a mode.
context_window_daysbodyNoOptional context window for any mode. Set an integer from 1 to 7; defaults to 1. Days are Asia/Kolkata calendar days, inclusive of today.
X-Alpha-Content-RetentionheaderNoOptional. Set none to opt out of retained request content when your account policy permits it.
api_keyqueryNoOptional alternative to the X-API-Key header. Prefer the header for server-side applications.

Response

Returns 200 with status, the markdown summary, and a details object describing what was summarized. Check status before you show summary: success is a real digest, and success_no_news or success_no_signal is a one-line fallback. error is always null on a 200. See Response statuses.

Successful Responseapplication/json
{
  "details": {
    "context_window_days": 3,
    "input_type": "watchlist",
    "mode": "intraday_movements",
    "portfolio_size": 3,
    "request_id": "req_7f91ab2c",
    "submitted_symbol_count": 3,
    "symbols_processed": 3
  },
  "status": "success",
  "summary": "- **TCS**: Guidance reaffirmed; AI deal wins noted. Closed yesterday at +0.8%, currently at +1.2%.\n- **RELIANCE**: Jio ARPU trend positive. Closed yesterday at -0.4%, currently at +0.9%.\n"
}

Code examples

SDK examples use a client created as in the Python, JavaScript / TypeScript, Java, PHP, or C# SDK guide. Java examples import com.fasterxml.jackson.databind.JsonNode and in.manasija.drishti.params.*. C# examples use using Manasija.Drishti.Params;.

summary = client.post_daily_summary(
    request={"symbols": ["TCS", "RELIANCE"], "mode": "news_context", "context_window_days": 7},
)

Choosing a mode

mode controls what the summary focuses on, which symbols make it into the text, and how it is worded. If you omit mode, the API picks one from your input: exposure for portfolio-style input with weights, otherwise intraday_movements. details.mode in the response always reports the mode that was used.

01exposurePortfolio digestEnd of dayUses weightsCompleted-day move

Use exposure when the reader owns or tracks a weighted set of stocks and wants to know what changed today. Each stock's exposure (its share of the portfolio) lets the summary say how much a move matters to the holder, for example "Given your 20.0% exposure, today's decrease represents a negative impact on your portfolio."

Best for
End-of-day digests for a portfolio or a weighted symbol set.
Default when
You send portfolio, or any items entry has exposure.
Price context
Latest completed close-to-close % change.
Symbols included
Only symbols with news or updates.
Wording
Uses "your portfolio" language only for portfolio input; items with weights are described as selected symbols. Portfolio impact is emphasised mainly when the completed-day move is 5% or more.
No-signal status
success_no_news

Typical uses: End-of-day portfolio emails, advisor client digests, and wealth-app home screens.

Example request
{
  "mode": "exposure",
  "portfolio": [
    { "symbol": "RELIANCE", "exposure": 18.5 },
    { "symbol": "TCS", "exposure": 12.0 },
    { "symbol": "HDFCBANK", "exposure": 9.5 }
  ]
}
02intraday_movementsWatchlist move scanMarket hoursLive % changeMovers first

Use intraday_movements when the question is "what is moving and why?". The summary leads with the biggest live movers and explains each move with linked news when it exists. Symbols that moved without any news are still reported, so a silent move is never dropped.

Best for
"What is moving on my watchlist right now, and why?" scans during market hours.
Default when
You send symbols, or items without any exposure.
Price context
Yesterday's close % plus the live % change after 9:30 AM IST. Biggest movers are listed first.
Symbols included
Symbols with news or a price move. A mover without news is still reported, with a note that no linked update was found.
Wording
No portfolio, holding, exposure, or PnL language.
No-signal status
success_no_signal

Typical uses: Mid-session watchlist alerts, trading-desk scans, and "why is this stock up?" features. Raise context_window_days when the catalyst may have landed on an earlier day.

Example request
{
  "mode": "intraday_movements",
  "symbols": ["TCS", "INFY", "WIPRO", "HCLTECH"],
  "context_window_days": 3
}
03news_contextNews-only briefingNo pricesFilings & newsWeekly catch-up

Use news_context when you want filings, announcements, events, and news without any price commentary. If a draft mentions prices, the API rewrites it before responding, so price talk doesn't reach your readers.

Best for
News-only briefings where price talk is not wanted.
Default when
Never. Set mode explicitly.
Price context
None. Prices and percentage moves are never mentioned.
Symbols included
Only symbols with news or updates.
Wording
No portfolio, exposure, or price-action language.
No-signal status
success_no_signal

Typical uses: Research notes, compliance-sensitive content, newsletters, and weekly catch-ups with context_window_days set to 7.

Example request
{
  "mode": "news_context",
  "symbols": ["HDFCBANK", "ICICIBANK", "KOTAKBANK"],
  "context_window_days": 7
}

Input shapes

Send exactly one of symbols, items, or portfolio. Symbols are uppercased, and duplicates and empty strings are removed.

FieldShapeinput_typeUse it when
symbols["TCS", "INFY"]watchlistYou only have a list of tickers. Start here.
items[{ symbol, exposure?, label? }]watchlistYou have weights for a symbol set the reader doesn't necessarily own, such as a model basket or an index slice.
portfolio[{ symbol, exposure?, label? }]portfolioThe symbols are the reader's own holdings. Allows "your portfolio" wording in exposure mode.

Rules worth knowing before you send weights:

  • `exposure` is the stock's share of the portfolio's total value, as a percentage, so 18.5 means 18.5%. Work it out as holding value ÷ portfolio value × 100. Don't send fractions such as 0.185: the summary would describe that holding as 0.2% of the portfolio. Weights don't have to add up to 100, and only exposure mode uses them. See What exposure means for a worked example.
  • In `portfolio`, a missing `exposure` counts as `0`. If you don't have weights, send symbols instead.
  • `label` is for your own bookkeeping. It's accepted but doesn't change the summary text and isn't returned in the response.
  • If you send more than one list, only one is used: portfolio first, then items, then symbols. The others are ignored without an error.
  • Unrecognised symbols are skipped, not rejected. A symbol Drishti doesn't know, such as a typo, a test value like TEST1, or a ticker retired after a rename, is dropped and the rest of the request is summarised as normal. ETFs such as SILVERBEES are recognised. A skipped symbol's exposure is dropped with it, and the other weights are used as sent. If every symbol is unrecognised, you get the free no-news answer. Check symbols_processed against submitted_symbol_count to spot skipped symbols.

Context window

context_window_days sets how many Asia/Kolkata calendar days of stored context the summary reads, inclusive of today. It accepts 1 to 7 and defaults to 1.

  • 1 gives a same-day digest and is the fastest path.
  • 2 to 7 reads each day's context in date order, so an earlier catalyst is not overwritten by later news. The price trend also covers the wider window.
  • Use a wider window for Monday catch-ups, moves that started before today, or weekly briefings.

Response statuses

statusMeaning
successA summary was generated. Billed 5 credits.
success_no_newsexposure mode found no news or updates for any symbol. summary contains a short fallback sentence. Not billed.
success_no_signalintraday_movements or news_context mode found no usable news or price signal. summary contains a short fallback sentence. Not billed.

details fields

FieldDescription
portfolio_sizeNumber of unique symbols in the request. Same value as submitted_symbol_count, kept for older clients.
submitted_symbol_countNumber of unique symbols after uppercasing and de-duplication.
symbols_processedNumber of symbols that made it into the summary because they had news (or, in intraday_movements, a price move). 0 for no-signal responses. A value lower than submitted_symbol_count is normal: quiet symbols are left out, and so are symbols Drishti doesn't recognise.
request_idUnique id for this summary. Include it when contacting support.
modeMode actually used, including the default the API chose when you omitted mode.
input_typeportfolio when you sent portfolio; watchlist when you sent symbols or items.
context_window_daysEffective context window, from 1 to 7.

No-signal example

When none of the symbols have news (or, for intraday_movements, a price move), the request still succeeds but returns a fallback sentence and is not billed.

json
{
  "status": "success_no_signal",
  "summary": "No significant news or context updates were found for the selected symbols today.",
  "details": {
    "portfolio_size": 2,
    "submitted_symbol_count": 2,
    "symbols_processed": 0,
    "request_id": "req_202610151642187341",
    "mode": "news_context",
    "input_type": "watchlist",
    "context_window_days": 1
  },
  "error": null
}

Errors

Errors return a non-200 status and an error object with a machine-readable code and a readable message:

json
{
  "error": {
    "code": "http_error",
    "message": "Invalid mode 'weekly'. Expected one of: exposure, intraday_movements, news_context"
  }
}

None of these responses is billed.

Statuserror.codeWhenFix
400http_errormode isn't one of the three modes, or the request has no usable symbol (for example "symbols": []).Read error.message; it names the problem.
401unauthorizedThe API key is missing or wrong.Send the key in the X-API-Key header.
402insufficient_creditsThe account doesn't have 5 credits left.Check usage in the platform console.
403forbiddenPortfolio Summary isn't enabled for this key or account.Check the key's product scope in the platform console.
422validation_errorThe body doesn't match the schema: context_window_days outside 1 to 7 or not an integer, an items or portfolio entry without symbol, or a body that isn't JSON. error.details lists each bad field.Fix the fields named in error.details[].field.
429rate_limit_exceededToo many requests this minute or today for your plan.Wait and retry. For many summaries, use a batch job.
500http_errorThe summary couldn't be generated.Retry after a short wait.

For many summaries at once, use batch jobs. Each JSONL line accepts the same request body and its own mode.

Try it

Send this request from the Drishti API playground with your own API key. It shows the credit cost before you send and gives you the matching cURL command. For schemas and the full OpenAPI contract, use the Scalar API client.