Prepare a large upload
curl --request POST \
--url https://api.spidra.io/api/parse/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "big.pdf",
"size": 1000000
}
'import requests
url = "https://api.spidra.io/api/parse/uploads"
payload = {
"fileName": "big.pdf",
"size": 1000000
}
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({fileName: 'big.pdf', size: 1000000})
};
fetch('https://api.spidra.io/api/parse/uploads', 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/uploads",
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([
'fileName' => 'big.pdf',
'size' => 1000000
]),
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/uploads"
payload := strings.NewReader("{\n \"fileName\": \"big.pdf\",\n \"size\": 1000000\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/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"big.pdf\",\n \"size\": 1000000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/parse/uploads")
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 \"fileName\": \"big.pdf\",\n \"size\": 1000000\n}"
response = http.request(request)
puts response.read_body{
"fileId": "189cfd73-ef28-4ac4-b4b9-31ec0716348b",
"uploadUrl": "https://.../parse/files/189cfd73-ef28-4ac4-b4b9-31ec0716348b?...",
"method": "PUT",
"expiresIn": 900,
"message": "PUT the file's bytes to uploadUrl within 15 minutes, then call POST /api/parse with this fileId. The file can be parsed again for 24 hours."
}Parse
Prepare a large upload
Returns a link to upload a document of up to 500 MB directly, and the fileId to parse it by. Use it for files over the 50 MB limit of a normal upload.
- Call this endpoint with the file’s name and exact size in bytes.
- Send the file’s bytes with a
PUTtouploadUrlwithin 15 minutes, with no API key and the same size. For example,curl -X PUT --upload-file big.pdf "<uploadUrl>". - Parse it with Parse and
{ "fileId": "..." }, or add it to a batch.
Parsing the fileId before the bytes arrive returns 409. The file can be parsed again for 24 hours, then it’s deleted.
Rate limits: 60 requests a minute, shared with POST /parse.
POST
/
parse
/
uploads
Prepare a large upload
curl --request POST \
--url https://api.spidra.io/api/parse/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "big.pdf",
"size": 1000000
}
'import requests
url = "https://api.spidra.io/api/parse/uploads"
payload = {
"fileName": "big.pdf",
"size": 1000000
}
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({fileName: 'big.pdf', size: 1000000})
};
fetch('https://api.spidra.io/api/parse/uploads', 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/uploads",
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([
'fileName' => 'big.pdf',
'size' => 1000000
]),
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/uploads"
payload := strings.NewReader("{\n \"fileName\": \"big.pdf\",\n \"size\": 1000000\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/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileName\": \"big.pdf\",\n \"size\": 1000000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/parse/uploads")
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 \"fileName\": \"big.pdf\",\n \"size\": 1000000\n}"
response = http.request(request)
puts response.read_body{
"fileId": "189cfd73-ef28-4ac4-b4b9-31ec0716348b",
"uploadUrl": "https://.../parse/files/189cfd73-ef28-4ac4-b4b9-31ec0716348b?...",
"method": "PUT",
"expiresIn": 900,
"message": "PUT the file's bytes to uploadUrl within 15 minutes, then call POST /api/parse with this fileId. The file can be parsed again for 24 hours."
}Authorizations
BearerAuthApiKeyAuth
Body
application/json
Response
The upload link is ready. PUT the file to uploadUrl within expiresIn seconds.
Was this page helpful?

