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."
}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.
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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The file's name, with an extension Parse supports, such as report.pdf. Names over 200 characters are cut.
"big.pdf"
The file's exact size in bytes, up to 500 MB. The upload link only accepts a file of this size.
1 <= x <= 5242880001000000
Response
The upload link is ready. PUT the file to uploadUrl within expiresIn seconds.
The document's ID. Send it as fileId to POST /parse once the upload is done.
Where to PUT the file's bytes. Don't send your API key to it.
The HTTP method to upload with.
PUT Seconds until uploadUrl stops working.
The steps to finish the upload.
Was this page helpful?

