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

If a docId is passed, no parsing credits will be used. However, if a file or url is used, parsing credits will apply during the split call. The docId will be returned after this call, allowing users to use it in future split requests without incurring additional parsing credits.

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"}]'

Please replace placeholders like <YOUR_API_Key> with actual values.

Headers

Name
Type
Description

X-API-Key*

string

<API-Key>

Request Format

Content type: multipart/form-data

Request Parameters

Parameter
Type
Required
Description

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.

Component
Condition
Credit Calculation

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?