Skip to main content
Use the Split API to split a parsed document into multiple classified sub-documents. Organizations typically use Split when they receive batched documents that contain multiple document types or multiple instances of the same document type. The API classifies each sub-document and returns the full Markdown content for downstream processing. Splitting occurs after parsing but before extraction. You can use Split without performing extraction. Split runs as a synchronous request at https://api.ade.landing.ai/v1/split (EU: https://api.ade.eu-west-1.landing.ai/v1/split) and takes the markdown returned by the Parse API. Each request accepts up to 4 MiB of Markdown and up to 400 pages.

Example Use Cases

  • Financial Services: Financial institutions processing Know Your Customer (KYC) documentation often receive PDFs containing multiple document types for each customer, such as bank statements, utility bills, and identification documents. After parsing the batch, the Split API separates and classifies each document type.
  • Healthcare: Healthcare systems ingesting patient records may receive batched PDFs containing intake forms, pathology reports, and medication lists. The Split API separates these documents by type for routing to appropriate systems.
  • Accounting: Accounting departments processing expense documentation receive PDFs with multiple invoices and receipts. The Split API separates each document and can use identifiers like invoice numbers or dates to create individual splits for each transaction.
  • Academic Research: Research institutions and libraries processing academic articles receive PDFs containing article bodies, references, and supplemental materials. The Split API separates these sections for indexing, citation extraction, or archival purposes.
  • Product Documentation: Organizations managing product catalogs receive PDFs containing specifications for multiple products. The Split API separates each product’s specifications, enabling automated data entry into product databases or comparison tools.
  • Technical Documentation: Companies distributing multilingual instruction manuals receive PDFs with the same content repeated in different languages. The Split API separates the manual by language, allowing each version to be routed to the appropriate regional system or translation workflow.
For credit consumption rates, see Credit Consumption.

Process Overview

Follow these steps to split a document into classified sub-documents:
  1. Parse your document using the Parse API. The Split API requires the Markdown content from Parse as input. Save the top-level markdown field of the parse response for the next step.
  2. Define your Split Rules by creating a set of Split Types that describe the different document types or sections in your file. Learn more about Split Rules.
  3. Run the Split API by passing the parsed Markdown content and your Split Rules. Choose your method:
  4. Use the split results in your downstream workflows. The API returns each classified sub-document with its full Markdown content. Learn more about the response structure.

Split Rules

Split Rules define how the Split API classifies and separates a document into sub-documents. The Split Rules are a collection of all Split Types you define for a single API call. Each Split Rule consists of a:

Split Types

Split Types define how your document is classified into sections, such as pay stubs, bank statements, and W-2s. You can define up to 19 Split Types in one API call. If the API cannot determine which Split Type a page belongs to, it classifies the page as uncategorized.

Descriptions (Optional)

The Description provides additional context about what a Split Type represents. Detailed descriptions help the API identify what information to include in each split and improve classification accuracy. Descriptions can also impact how the API interprets Identifiers. For example, these two descriptions for clinical notes produce different identifier behavior:
  • Less specific description: “A clinical note documenting a patient’s office visit, including history, exam, assessment, and plan, authored by a provider.” The API might consider multiple dates as potential identifiers.
  • More specific description: “A clinical note documenting a patient’s office visit, including history, exam, assessment, and plan, authored by a provider. Each note is separated by office visit date. Do not look at any other dates. Only include date before the words ‘office visit’.” The API only considers dates directly before “office visit” as identifiers.

Identifiers (Optional)

When your document contains multiple instances of the same Split Type, use an Identifier to specify what makes each instance unique, such as invoice number, order ID, or date. The API creates a separate split for each unique value of the Identifier. For example, if your document contains 6 pay stubs and you specify “Pay Stub Date” as the identifier, the API creates 6 separate splits, one for each unique date value.

Example

A document contains 1 bank statement and 6 pay stubs with different dates. You define two Split Types:
  • Bank Statement (no identifier needed)
  • Pay Stub with “Pay Stub Date” as the identifier
The API returns 7 splits: 1 bank statement and 6 pay stubs, each separated by payment date.

Split with the API

Split a document by calling the Split endpoint. In the EU, send the request to https://api.ade.eu-west-1.landing.ai with an EU API key. See European Union (EU). This example splits a document containing bank statements and pay stubs. It assumes you saved the markdown field of the parse response to markdown.md:

Parameters

Get the full parameters from the API reference.
  • markdown (required, or use markdown_url): The Markdown output from the Parse API. You can pass the Markdown content directly or upload it as a file.
  • markdown_url (required, or use markdown): A URL to a Markdown file to split.
  • split_class (required): A JSON array defining the Split Rules. Each Split Type is a JSON object with:
    • name: The Split Type name (required)
    • description: Additional context about the Split Type (optional)
    • identifier: The field that makes each instance unique (optional)
  • model (optional): The model version to use for splitting. If omitted, the API uses the latest version.

Use Split with Our Libraries

Click one of the tiles to learn how to use the Split API with our libraries.

Python Library

Use Split with our Python library.

TypeScript Library

Use Split with our TypeScript library.

Additional Considerations on Splitting

  • Each page in a document can only be assigned to one Split Type. If one page has content that could belong to more than one Split Type, the API chooses the Split Type that the page matches more closely.
  • Split finds page boundaries from the <!-- PAGE BREAK --> markers that Parse places between pages. Pass the markdown field as Parse returns it, without removing those markers.