import requests
url = "https://api.datagrid.com/v1/batch-predictions/{batch_prediction_id}/results"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.datagrid.com/v1/batch-predictions/{batch_prediction_id}/results', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.datagrid.com/v1/batch-predictions/{batch_prediction_id}/results \
--header 'Authorization: Bearer <token>'"{\"object\":\"batch_prediction.result\",\"batch_id\":\"bpred_abc123\",\"custom_id\":\"drawing_001\",\"status\":\"succeeded\",\"output\":{\"project_name\":\"Alpha Tower\",\"sheet_title\":\"Floor Plan\",\"revision\":\"R3\"},\"error\":null}\n{\"object\":\"batch_prediction.result\",\"batch_id\":\"bpred_abc123\",\"custom_id\":\"drawing_002\",\"status\":\"errored\",\"output\":null,\"error\":{\"type\":\"https://api.datagrid.com/errors/prediction_failed\",\"title\":\"Prediction Failed\",\"status\":422,\"detail\":\"The model returned an invalid response.\"}}\n"{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Retrieve batch prediction results
Streams newline-delimited JSON (NDJSON) result lines for a terminal batch prediction. Read the response body line-by-line and JSON parse each non-empty line. Results are retained for a limited window after batch creation; after cleanup, this endpoint returns 410 Gone.
import requests
url = "https://api.datagrid.com/v1/batch-predictions/{batch_prediction_id}/results"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.datagrid.com/v1/batch-predictions/{batch_prediction_id}/results', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.datagrid.com/v1/batch-predictions/{batch_prediction_id}/results \
--header 'Authorization: Bearer <token>'"{\"object\":\"batch_prediction.result\",\"batch_id\":\"bpred_abc123\",\"custom_id\":\"drawing_001\",\"status\":\"succeeded\",\"output\":{\"project_name\":\"Alpha Tower\",\"sheet_title\":\"Floor Plan\",\"revision\":\"R3\"},\"error\":null}\n{\"object\":\"batch_prediction.result\",\"batch_id\":\"bpred_abc123\",\"custom_id\":\"drawing_002\",\"status\":\"errored\",\"output\":null,\"error\":{\"type\":\"https://api.datagrid.com/errors/prediction_failed\",\"title\":\"Prediction Failed\",\"status\":422,\"detail\":\"The model returned an invalid response.\"}}\n"{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The id of the batch prediction whose results should be streamed.
Response
Batch prediction result stream
One NDJSON result line for a submitted batch item.
The object type, which is always batch_prediction.result.
batch_prediction.result The batch prediction id.
The caller-defined item id from the create request.
Terminal status for an individual result line.
succeeded, errored, canceled, expired The model output when status is succeeded; otherwise null.
Problem details when status is errored, canceled, or expired; otherwise null.
Show child attributes
Show child attributes