Get a parse job
curl --request GET \
--url https://api.spidra.io/api/parse/{jobId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spidra.io/api/parse/{jobId}"
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/{jobId}', 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/{jobId}",
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/{jobId}"
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/{jobId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/parse/{jobId}")
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{
"jobId": "c5a8d5a2-b10e-44f5-8c9e-dbbd334d19d1",
"status": "completed",
"fileName": "1706.03762",
"sourceUrl": "https://arxiv.org/pdf/1706.03762",
"fileId": "29273629-c557-4ac8-9e36-14fb96b1018d",
"format": "PDF",
"totalPages": 15,
"pagesParsed": 3,
"creditsUsed": 3,
"markdown": "### Provided proper attribution is provided, Google hereby grants permission to\n\n...",
"pages": [
{
"pageNumber": 1,
"markdown": "### Provided proper attribution is provided, Google hereby grants permission to\n\n...",
"method": "text"
},
{
"pageNumber": 2,
"markdown": "# 1 Introduction\n\nRecurrent neural networks, long short-term memory [13] and gated recurrent [7] neural networks ...",
"method": "text"
},
{
"pageNumber": 3,
"markdown": "Figure 1: The Transformer-model architecture.\n\n...",
"method": "text"
}
],
"warnings": [],
"metadata": {
"fileName": "1706.03762",
"sourceUrl": "https://arxiv.org/pdf/1706.03762",
"format": "pdf",
"totalPages": 15,
"pagesParsed": 3,
"ocrPages": 0
},
"durationMs": 1005
}
Parse
Get a parse job
Returns a parse job’s status and, once it has finished, its Markdown, its extracted json and its warnings. Use it for jobs that Parse answered with 202, or for any document in a batch. Poll every 2 to 5 seconds until status is completed or failed. Polling is free and has no rate limit.
While the job runs, progress says how many pages have been read. Add ?pages=true to get each page’s Markdown on its own in pages.
A failed job answers 200 with status: "failed" and the reason in error. You aren’t charged for it.
GET
/
parse
/
{jobId}
Get a parse job
curl --request GET \
--url https://api.spidra.io/api/parse/{jobId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spidra.io/api/parse/{jobId}"
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/{jobId}', 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/{jobId}",
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/{jobId}"
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/{jobId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/parse/{jobId}")
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{
"jobId": "c5a8d5a2-b10e-44f5-8c9e-dbbd334d19d1",
"status": "completed",
"fileName": "1706.03762",
"sourceUrl": "https://arxiv.org/pdf/1706.03762",
"fileId": "29273629-c557-4ac8-9e36-14fb96b1018d",
"format": "PDF",
"totalPages": 15,
"pagesParsed": 3,
"creditsUsed": 3,
"markdown": "### Provided proper attribution is provided, Google hereby grants permission to\n\n...",
"pages": [
{
"pageNumber": 1,
"markdown": "### Provided proper attribution is provided, Google hereby grants permission to\n\n...",
"method": "text"
},
{
"pageNumber": 2,
"markdown": "# 1 Introduction\n\nRecurrent neural networks, long short-term memory [13] and gated recurrent [7] neural networks ...",
"method": "text"
},
{
"pageNumber": 3,
"markdown": "Figure 1: The Transformer-model architecture.\n\n...",
"method": "text"
}
],
"warnings": [],
"metadata": {
"fileName": "1706.03762",
"sourceUrl": "https://arxiv.org/pdf/1706.03762",
"format": "pdf",
"totalPages": 15,
"pagesParsed": 3,
"ocrPages": 0
},
"durationMs": 1005
}
Authorizations
BearerAuthApiKeyAuth
Query Parameters
Response
The job's status, and its result once it has finished.
A parse job, with its result once it has finished.
queued: waiting to start.running: being parsed.progresssays how far it has got.completed: finished. The result is inmarkdown, andjsonwhen you asked for extraction.failed: couldn't be parsed.errorsays why, and you aren't charged.
Available options:
queued, running, completed, failed Was this page helpful?

