curl --request POST \
--url https://api.spidra.io/api/parse/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"urls": [
"https://arxiv.org/pdf/1706.03762"
],
"fileIds": [
"0b007010-b3f6-4398-a3ba-e5c2518839c8"
],
"maxPages": 1
}
'import requests
url = "https://api.spidra.io/api/parse/batch"
payload = {
"urls": ["https://arxiv.org/pdf/1706.03762"],
"fileIds": ["0b007010-b3f6-4398-a3ba-e5c2518839c8"],
"maxPages": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
urls: ['https://arxiv.org/pdf/1706.03762'],
fileIds: ['0b007010-b3f6-4398-a3ba-e5c2518839c8'],
maxPages: 1
})
};
fetch('https://api.spidra.io/api/parse/batch', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'urls' => [
'https://arxiv.org/pdf/1706.03762'
],
'fileIds' => [
'0b007010-b3f6-4398-a3ba-e5c2518839c8'
],
'maxPages' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spidra.io/api/parse/batch"
payload := strings.NewReader("{\n \"urls\": [\n \"https://arxiv.org/pdf/1706.03762\"\n ],\n \"fileIds\": [\n \"0b007010-b3f6-4398-a3ba-e5c2518839c8\"\n ],\n \"maxPages\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.spidra.io/api/parse/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"urls\": [\n \"https://arxiv.org/pdf/1706.03762\"\n ],\n \"fileIds\": [\n \"0b007010-b3f6-4398-a3ba-e5c2518839c8\"\n ],\n \"maxPages\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/parse/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"urls\": [\n \"https://arxiv.org/pdf/1706.03762\"\n ],\n \"fileIds\": [\n \"0b007010-b3f6-4398-a3ba-e5c2518839c8\"\n ],\n \"maxPages\": 1\n}"
response = http.request(request)
puts response.read_body{
"status": "estimate",
"documents": [
{
"status": "estimate",
"fileId": "614b6cf9-baab-440a-a1d8-422ce676bb5d",
"fileName": "1706.03762",
"format": "PDF",
"totalPages": 15,
"pagesToParse": 2,
"credits": 2
}
],
"credits": 2
}Parse a batch
Parses up to 50 documents in one request, mixing uploads, links and fileIds, and returns a batchId straight away. Each document becomes its own parse job with the same options. Poll Get a parse batch for progress, or each document’s jobId at Get a parse job.
Send uploads as files parts in a multipart request, links in urls and stored documents in fileIds. In a multipart request, send urls and fileIds as JSON array strings.
Each document is checked and charged on its own. One that can’t be fetched or read, or that your remaining credits can’t cover, comes back in documents with status: "failed" and an error, and the others still run. With dryRun: true you get an estimate for every document and a total, and nothing is parsed.
Credits: 1 per page parsed for each document, plus AI credits when you send a prompt or schema. Failed documents cost nothing.
Rate limits: 60 parse requests a minute, shared with POST /parse.
curl --request POST \
--url https://api.spidra.io/api/parse/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"urls": [
"https://arxiv.org/pdf/1706.03762"
],
"fileIds": [
"0b007010-b3f6-4398-a3ba-e5c2518839c8"
],
"maxPages": 1
}
'import requests
url = "https://api.spidra.io/api/parse/batch"
payload = {
"urls": ["https://arxiv.org/pdf/1706.03762"],
"fileIds": ["0b007010-b3f6-4398-a3ba-e5c2518839c8"],
"maxPages": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
urls: ['https://arxiv.org/pdf/1706.03762'],
fileIds: ['0b007010-b3f6-4398-a3ba-e5c2518839c8'],
maxPages: 1
})
};
fetch('https://api.spidra.io/api/parse/batch', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'urls' => [
'https://arxiv.org/pdf/1706.03762'
],
'fileIds' => [
'0b007010-b3f6-4398-a3ba-e5c2518839c8'
],
'maxPages' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spidra.io/api/parse/batch"
payload := strings.NewReader("{\n \"urls\": [\n \"https://arxiv.org/pdf/1706.03762\"\n ],\n \"fileIds\": [\n \"0b007010-b3f6-4398-a3ba-e5c2518839c8\"\n ],\n \"maxPages\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.spidra.io/api/parse/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"urls\": [\n \"https://arxiv.org/pdf/1706.03762\"\n ],\n \"fileIds\": [\n \"0b007010-b3f6-4398-a3ba-e5c2518839c8\"\n ],\n \"maxPages\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/parse/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"urls\": [\n \"https://arxiv.org/pdf/1706.03762\"\n ],\n \"fileIds\": [\n \"0b007010-b3f6-4398-a3ba-e5c2518839c8\"\n ],\n \"maxPages\": 1\n}"
response = http.request(request)
puts response.read_body{
"status": "estimate",
"documents": [
{
"status": "estimate",
"fileId": "614b6cf9-baab-440a-a1d8-422ce676bb5d",
"fileName": "1706.03762",
"format": "PDF",
"totalPages": 15,
"pagesToParse": 2,
"credits": 2
}
],
"credits": 2
}Authorizations
Body
How to parse a document. The same options apply to POST /parse and to every document in POST /parse/batch.
How pages are read.
auto: reads each page's text, and uses AI only on pages that are scans or images.fast: reads text only. Scanned pages come back empty with anerrorand aren't charged.ocr: reads every page with AI. Slower, and best for scans and handwriting.
auto, fast, ocr Response
dryRun was true. Each document's estimate and the total credits. Nothing was parsed or charged.
Was this page helpful?

