Browse documentation
Get batch results
GET /v1/batch/jobs/{job_id}/results
Download the JSONL results for a finished batch job by id. Results are available once the job status is succeeded, partial, failed, or cancelled. A cancelled job's results hold only the lines processed before you cancelled.
When to use it
Use this endpoint after polling shows the job has finished, then join each line back to your records by custom_id.
Authentication and billing
- Requires
X-API-Keyorapi_key. - Credit cost: Free. Non-billable download route for completed batch output.
- See pricing for plan allowances and full billing details.
Request
This endpoint does not require a request body.
| Field | Location | Required | Notes |
|---|---|---|---|
job_id | path | Yes | Batch job id. |
api_key | query | No | Optional alternative to the X-API-Key header. Prefer the header for server-side applications. |
Response
Returns JSONL with one line per input line: custom_id, status, response.status_code, response.body (summary and details), and error.
{"id": "req-001", "custom_id": "req-001", "response": {"status_code": 200, "body": {"summary": "Market summary for RELIANCE and TCS..."}}, "error": null}
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;.
results = client.get_batch_jobs_job_id_results(job_id="batch_a1b2c3d4e5f67890")Result lines
Results are available once the job is succeeded, partial, failed, or cancelled; earlier requests return 400 with the current status. The response is JSONL with one line per processed input line. For a cancelled job, lines that weren't reached before the cancel are missing.
| Field | Description |
|---|---|
custom_id | The custom_id from your input line. Use it to join results back to your records. |
id | Same as custom_id. |
status | success, success_no_news, success_no_signal, or failed. Same meaning as the Portfolio Summary statuses. |
response.status_code | 200 for any success status, 500 for failed. |
response.body.summary | Generated markdown summary, or the fallback sentence for no-news / no-signal lines. null when the line failed. |
response.body.details | Same details object as the Portfolio Summary response, including mode and context_window_days. In batch results, details.request_id is your custom_id. |
error | null unless status is failed. Then it's an object with code and message, for example {"code": "generation_failed", "message": "LLM failed to generate summary"}. See Line error codes. |
Line error codes
error.code | Meaning |
|---|---|
no_symbols | The line had no usable symbol. |
generation_failed | The summary couldn't be generated. Resubmit the line in a new job. |
billing_failed | The account couldn't be charged for the line, usually because it ran out of credits. Top up, then resubmit. |
internal_error | Unexpected error while processing the line. Resubmit it; contact support with the custom_id and job id if it keeps failing. |
Failed lines are never billed.
{"id":"user-101","custom_id":"user-101","status":"success","response":{"status_code":200,"body":{"summary":"- **RELIANCE**: ...","details":{"portfolio_size":2,"submitted_symbol_count":2,"symbols_processed":2,"request_id":"req_202610152210114821","mode":"exposure","input_type":"portfolio","context_window_days":1}}},"error":null}
{"id":"user-103","custom_id":"user-103","status":"success_no_signal","response":{"status_code":200,"body":{"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_202610152210129904","mode":"news_context","input_type":"watchlist","context_window_days":7}}},"error":null}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.