# PDF Splitter API Documentation


# PDF Splitting API

> **Category**: Image Recognition  
> **Endpoint**: POST [https://api.gugudata.io/v1/imagerecognition/pdf-splitter?appkey={{appkey}}&page_size={{page_size}}&is_zip={{is_zip}}](https://api.gugudata.io/v1/imagerecognition/pdf-splitter?appkey={{appkey}}&page_size={{page_size}}&is_zip={{is_zip}})  
> **Description**: Split PDF files into smaller documents by specified page size with optional ZIP compression.

## Overview

The **PDF Splitting API** by [GuGuData](https://gugudata.io/) is designed to **split large PDF files** into smaller documents based on a defined **page size**. For multiple output files, the service can **optionally compress** them into a **single ZIP archive**, simplifying downloads and storage. Built on a **fast, cloud-based** infrastructure, this API securely processes your PDFs and delivers results via a **nationwide CDN** for minimal latency.

**Key highlights**:

- **Page-based splitting** – Define `page_size` to create multiple smaller PDFs.
- **Optional ZIP output** – Bundle all split files into a single compressed archive.
- **Secure & scalable** – HTTPS connections and cloud-based architecture for fast processing.
- **RESTful interface** – JSON-based responses for easy integration and automation.

## Demo URL

[https://api.gugudata.io/v1/imagerecognition/pdf-splitter/demo](https://api.gugudata.io/v1/imagerecognition/pdf-splitter/demo)

## Request Parameters

Submit a **POST** request to the endpoint, ensuring you set the `appkey`, `page_size`, and `is_zip` query parameters. Attach the PDF file in **form-data**:

| **Parameter** | **Type**  | **Required** | **Default Value** | **Description**                                                         |
| :-----------: | :-------: | :----------: | :---------------: | :---------------------------------------------------------------------- |
|   `appkey`    | `string`  |     Yes      |   `YOUR_APPKEY`   | Your APPKEY from GuGuData's Developer Center.                           |
|  `page_size`  | `integer` |     Yes      |       `N/A`       | Number of pages per split PDF file (e.g., `5`).                         |
|   `is_zip`    | `boolean` |     Yes      |      `false`      | Whether to compress the output into a single ZIP file (`true`/`false`). |
|    `file`     |  `file`   |     Yes      |   `YOUR_VALUE`    | The PDF file to be split, included in **form-data**.                    |

**Example**:

POST [https://api.gugudata.io/v1/imagerecognition/pdf-splitter?appkey={{appkey}}&page_size={{page_size}}&is_zip={{is_zip}}](https://api.gugudata.io/v1/imagerecognition/pdf-splitter?appkey={{appkey}}&page_size={{page_size}}&is_zip={{is_zip}})

Upload the PDF under the field name `file`.

## Response Parameters

Upon success, the API returns a JSON object with metadata and download URLs. Key fields include:

|         **Parameter**          | **Type**  | **Required** |                               **Description**                               |
| :----------------------------: | :-------: | :----------: | :-------------------------------------------------------------------------: |
|    `dataStatus.statusCode`     | `integer` |     Yes      |                   API response status code (e.g., `200`).                   |
|      `dataStatus.status`       | `string`  |     Yes      |                 Overall operation status (e.g., _SUCCESS_).                 |
| `dataStatus.statusDescription` | `string`  |     Yes      |               Additional details about the request's outcome.               |
| `dataStatus.responseDateTime`  | `string`  |     Yes      |                  Timestamp for when the data was returned.                  |
|  `dataStatus.dataTotalCount`   | `integer` |     Yes      |                 Total count of data records (commonly `1`).                 |
|          `data.uuid`           | `string`  |     Yes      |                 Unique identifier for the split operation.                  |
|        `data.num_files`        | `integer` |     Yes      |                     Number of split PDF files produced.                     |
|        `data.pdf_files`        |  `array`  |     Yes      | An array of download URLs for the split files or the resulting ZIP archive. |

## Error Codes

Below are some common error codes:

| **Error Code** |  **Error Content**  | **Notes**                                                       |
| :------------: | :-----------------: | :-------------------------------------------------------------- |
|     `200`      |       Success       | The operation completed successfully.                           |
|     `400`      |   Parameter error   | Missing or invalid `page_size`, `appkey`, or `file` parameters. |
|     `401`      |   Invalid APPKEY    | Ensure your APPKEY is valid and active.                         |
|     `429`      | Rate limit exceeded | Too many requests in a specific time frame.                     |
|     `500`      |    Server error     | An internal issue occurred; try again or contact support.       |

## Features

1. **Split PDF files** based on the specified page range.
2. **Optional ZIP compression** for downloading multiple files at once.
3. **Fast cloud-based processing** – Efficiently handle large documents.
4. **Secure file handling** – Transfer data via HTTPS.
5. **Distributed CDN** – Fast delivery of output files.
6. **Support for large PDFs** – Capable of splitting extensive multi-page files.
7. **Automatic file cleanup** – Temporary data is removed after processing.
8. **RESTful API with JSON** – Simplifies integration with third-party apps or workflows.

## Additional Notes for Developers

- **File size considerations**: Splitting very large PDFs may take slightly longer; ensure client-side timeouts are suitable.
- **Zip usage**: If `is_zip` is set to `true`, you'll receive a single ZIP archive link containing all the split PDF files.
- **Concurrency**: Multiple simultaneous requests are supported, but watch out for rate limits.

## Getting Started

1. **Sign up at [GuGuData.io](https://gugudata.io/)** – Obtain your unique APPKEY.
2. **Construct a POST request** – Include query parameters (`appkey`, `page_size`, `is_zip`) and attach the PDF as `file`.
3. **Parse the JSON response** – Access the `pdf_files` array or ZIP link to download the results.
4. **Integrate** – Incorporate the split PDFs into your workflows, archiving, or document processing pipelines.

## About GuGuData

[**GuGuData**](https://gugudata.io/) excels in providing **reliable data and file processing APIs** for modern businesses and developers. Beyond PDF manipulation, our suite includes [OCR services](https://gugudata.io/), [HTML to PDF conversions](https://gugudata.io/), and more—each designed for **scalability and ease of use**.

**Key Highlights**:

- **Nine years in business** – Long-standing track record of dependable data solutions.
- **4.2k+ APIs** – Continually growing catalog of features for data-intensive projects.
- **95% customer satisfaction** – Top-rated for speed, reliability, and support.

Leverage the **PDF Splitting API** to **efficiently break down multi-page PDFs**, simplifying file distribution, storage, or individual page processing. Explore more of GuGuData's offerings at our [official site](https://gugudata.io/).

