Get batch status
curl --request GET \
--url https://api.valyu.ai/v1/deepresearch/batches/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.valyu.ai/v1/deepresearch/batches/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.valyu.ai/v1/deepresearch/batches/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valyu.ai/v1/deepresearch/batches/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.valyu.ai/v1/deepresearch/batches/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.valyu.ai/v1/deepresearch/batches/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valyu.ai/v1/deepresearch/batches/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"batch_id": "batch_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "processing",
"mode": "standard",
"created_at": "2024-06-15T10:30:00.000Z",
"counts": {
"total": 10,
"queued": 2,
"running": 3,
"completed": 4,
"failed": 1,
"cancelled": 0
},
"cost": 2.5
}Get Batch Status
Reference for getting batch status via GET /v1/deepresearch/batches/.
GET
/
v1
/
deepresearch
/
batches
/
{id}
Get batch status
curl --request GET \
--url https://api.valyu.ai/v1/deepresearch/batches/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.valyu.ai/v1/deepresearch/batches/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.valyu.ai/v1/deepresearch/batches/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valyu.ai/v1/deepresearch/batches/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.valyu.ai/v1/deepresearch/batches/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.valyu.ai/v1/deepresearch/batches/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valyu.ai/v1/deepresearch/batches/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"batch_id": "batch_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "processing",
"mode": "standard",
"created_at": "2024-06-15T10:30:00.000Z",
"counts": {
"total": 10,
"queued": 2,
"running": 3,
"completed": 4,
"failed": 1,
"cancelled": 0
},
"cost": 2.5
}Inspect batch progress, task counts and aggregate cost. Use this endpoint for a progress dashboard; use List batch tasks for individual results and failures.
Completed processing does not mean every task succeeded. Check the outcome counts before marking the whole batch as successful in your application.
Authorizations
API key for authentication. Get yours at platform.valyu.ai.
Response
Batch status.
Batch status and metadata.
Batch lifecycle status.
open- Batch created, accepting tasksprocessing- Tasks are runningcompleted- All tasks finished successfullycompleted_with_errors- All tasks finished, some failedcancelled- Batch was cancelled
Available options:
open, processing, completed, completed_with_errors, cancelled Example:
"processing"
Was this page helpful?