Split
Identify sections in PDF documents based on provided descriptions. Split analyzes the document and returns which pages contain each section, along with confidence levels. Use this endpoint when you need to locate specific sections within a document.
POST https://pdf.ai/api/v2/split
Returns JSON schema and citations given a docId , url , or file.
Caching
Sample Code
Below are examples of how to use the split endpoint with different programming languages.
curl -X POST https://pdf.ai/api/v2/split \
-H "X-API-Key: YOUR_API_KEY" \
-F "docId=your-document-id" \
-F 'split_description=[{"name":"Introduction","description":"Opening section"},{"name":"Conclusion","description":"Summary section"}]'import requests
import json
url = "https://pdf.ai/api/v2/split"
headers = {"X-API-Key": "YOUR_API_KEY"}
split_description = [
{"name": "Introduction", "description": "Opening section"},
{"name": "Conclusion", "description": "Summary section"}
]
data = {
"docId": "your-document-id",
"split_description": json.dumps(split_description)
}
response = requests.post(url, headers=headers, data=data)
print(response.json())Please replace placeholders like <YOUR_API_Key> with actual values.
Headers
X-API-Key*
string
<API-Key>
Request Format
Content type: multipart/form-data
Request Parameters
split_description
string (JSON)
Yes
JSON array of section descriptions to find. Each object must have a name and optionally a description.
docId
string
No
Document ID for caching parsed results.
url
string
No
URL of the PDF to parse (alternative to file upload).
file
File
No
PDF file to upload (alternative to URL).
quality
string
No
Quality to use: 'standard' or 'advanced' (default: 'standard').
lang_list
array
No
List of languages to detect (default: ['en']).
Split Description Format
The split_description parameter must be a JSON array of objects:
Response format
Credit Usage
Before splitting data from a PDF, the document must be parsed, which will incur credit usage unless a cached parsed result is available. See parse credit usage here.
Split Credits
Always charged
2 credits × page count
Total Credit Formula
Total credits = Parse credits + Split credits
Examples
10-page document, cached
Parse Credits: 0 credits (cached)
Split Credits: 2 × 10 = 20 credits
Total: 20 credits
5-page document, not cached, advanced quality
Parse Credits: 2 × 5 = 10 credits
Split Credits: 2 × 5 = 10 credits
Total: 20 credits
Last updated
Was this helpful?