Browse documentation
Guides
Batch jobs
Batch jobs run many daily-summary requests asynchronously from a JSONL file.
JSONL format
Each line must be a complete JSON object. Include a stable custom_id so results can be joined back to your source system.
{"custom_id":"req-1","portfolio":[{"symbol":"RELIANCE","exposure":15.5},{"symbol":"TCS","exposure":10.2}]}
{"custom_id":"req-2","portfolio":[{"symbol":"HDFCBANK","exposure":20.0}]}Lifecycle
- Create a job by uploading a JSONL file.
- Poll the job until it finishes.
- Download results as JSONL.
- Cancel pending or in-progress work when needed.
JSONL request lines
Each line uses the Daily Summary request shape plus a unique custom_id. Set context_window_days independently per Intraday or News request; it accepts 1 to 7 and defaults to 1.
{"custom_id":"intraday-001","mode":"intraday_movements","symbols":["RELIANCE","TCS"],"context_window_days":3}
{"custom_id":"news-001","mode":"news_context","symbols":["HDFCBANK","ICICIBANK"],"context_window_days":7}The window is counted in Asia/Kolkata calendar days and includes today. Batch processing preserves the value on each individual summary request.
SDK upload
import { readFile } from "node:fs/promises"
import { Blob } from "node:buffer"
import { DrishtiClient } from "drishti-sdk"
const client = new DrishtiClient({ apiKey: process.env.DRISHTI_API_KEY! })
const fileBuffer = await readFile("./batch.jsonl")
const fileBlob = new Blob([fileBuffer], { type: "application/jsonl" })
const job = await client.postBatchJobsFile({
file: fileBlob,
filename: "batch.jsonl",
display_name: "Quarterly run",
})See Create batch job, Get batch job, and Get batch results.