Get a Parse Batch
curl --request GET \
--url https://api.spidra.io/api/parse/batch/{batchId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spidra.io/api/parse/batch/{batchId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spidra.io/api/parse/batch/{batchId}', 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.spidra.io/api/parse/batch/{batchId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.spidra.io/api/parse/batch/{batchId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.spidra.io/api/parse/batch/{batchId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/parse/batch/{batchId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"batchId": "<string>",
"status": "running",
"counts": {},
"creditsUsed": 123,
"documents": [
{
"jobId": "<string>",
"status": "queued",
"fileName": "<string>",
"sourceUrl": "<string>",
"fileId": "<string>",
"format": "<string>",
"totalPages": 123,
"pagesParsed": 123,
"creditsUsed": 123,
"error": "<string>",
"progress": {
"message": "<string>",
"done": 123,
"total": 123
},
"markdown": "<string>",
"pages": [
{
"pageNumber": 123,
"markdown": "<string>",
"method": "text",
"error": "<string>"
}
],
"json": "<unknown>",
"warnings": [
"<string>"
],
"metadata": {
"fileName": "<string>",
"sourceUrl": "<string>",
"format": "<string>",
"totalPages": 123,
"pagesParsed": 123,
"ocrPages": 123
},
"durationMs": 123
}
]
}Parse
Get a parse batch
A parse batch’s progress, counts and every document’s status, optionally with their results.
GET
/
parse
/
batch
/
{batchId}
Get a Parse Batch
curl --request GET \
--url https://api.spidra.io/api/parse/batch/{batchId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spidra.io/api/parse/batch/{batchId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spidra.io/api/parse/batch/{batchId}', 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.spidra.io/api/parse/batch/{batchId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.spidra.io/api/parse/batch/{batchId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.spidra.io/api/parse/batch/{batchId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/parse/batch/{batchId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"batchId": "<string>",
"status": "running",
"counts": {},
"creditsUsed": 123,
"documents": [
{
"jobId": "<string>",
"status": "queued",
"fileName": "<string>",
"sourceUrl": "<string>",
"fileId": "<string>",
"format": "<string>",
"totalPages": 123,
"pagesParsed": 123,
"creditsUsed": 123,
"error": "<string>",
"progress": {
"message": "<string>",
"done": 123,
"total": 123
},
"markdown": "<string>",
"pages": [
{
"pageNumber": 123,
"markdown": "<string>",
"method": "text",
"error": "<string>"
}
],
"json": "<unknown>",
"warnings": [
"<string>"
],
"metadata": {
"fileName": "<string>",
"sourceUrl": "<string>",
"format": "<string>",
"totalPages": 123,
"pagesParsed": 123,
"ocrPages": 123
},
"durationMs": 123
}
]
}Request
curl "https://api.spidra.io/api/parse/batch/bd108121-f10b-407d-99d5-cb40a0939248" \
-H "Authorization: Bearer $SPIDRA_API_KEY"
?include=results to get each finished document’s Markdown too.
Response
{
"batchId": "bd108121-f10b-407d-99d5-cb40a0939248",
"status": "completed",
"counts": { "queued": 0, "running": 0, "completed": 2, "failed": 0 },
"creditsUsed": 2,
"documents": [
{ "jobId": "9cb7e05b-a16c-4fd5-8bae-ce9adf074cbf", "status": "completed", "fileName": "1706.03762", "sourceUrl": "https://arxiv.org/pdf/1706.03762", "fileId": "0b007010-b3f6-4398-a3ba-e5c2518839c8", "format": "PDF", "totalPages": 15, "pagesParsed": 1, "creditsUsed": 1 },
{ "jobId": "60c9f3bb-f43a-4407-a86d-a45107a7c4c8", "status": "completed", "fileName": "1706.03762", "sourceUrl": "https://arxiv.org/pdf/1706.03762", "fileId": "7578d785-660d-44fe-91ec-18bb4fe833b1", "format": "PDF", "totalPages": 15, "pagesParsed": 1, "creditsUsed": 1 }
]
}
status is running until every document has finished, then completed. Each document can also be read on its own with GET /parse/{jobId}.
Errors
| Status | When |
|---|---|
404 | No parse batch with this ID on your account. |
Authorizations
BearerAuthApiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Include each finished document's Markdown.
Available options:
results Was this page helpful?

