Split PDF Pages in Python using PDF.co Web API

In this demonstration, we will split PDF pages in Python using the PDF.co Web API. We will use this /v1/pdf/split2 endpoint.

Step 1: Install Requests Module

First, kindly install the requests module. If you already have the requests module. Kindly type the python -m pip install requests in your command line and run to access the pip requests.

Step 2: Add API Key

Add your API key to your sample Python code. You may get your API key at the PDF.co dashboard.

PDF.co API Key

Step 3: Source File and Pages

In lines 22-24, add your source PDF file and enter the pages with separated-comma to split.

Source File and Pages

Step 4: Run Program

You can now run your Python program, and you will see the output PDF in your folder.

Run Program
Output PDF
Output Split PDF

In this tutorial, you learned how to split PDF pages in Python using the PDF.co Web API. You learned how to use the PDF Split Web API to split PDF pages. You also learned how to install the requests module and access the pip install requests.