How to Extract PDF to JSON with PDF.co API and Postman

Sep 2, 2024·4 Minutes Read

Check out this tutorial to convert PDF to JSON using PDF.co Web API and Postman. Follow this step-by-step tutorial to extract PDF files in JSON format.

IMPORTANT: You need to set up Postman first, use this link to set up PDF.co for Postman.

Step 1: Open PDF.co API v.1

Go to Collections Tab and click on PDF.co API v.1 folder

Postman Collections Tab

Step 2: Select File Uploader

Look for and click on the File Uploader folder

Postman file uploader

Step 3: Select PDF to JSON

Click on PDF to JSON folder and click GET /pdf/convert/tojson

Postman folders

Step 4: Send Request with cURL or with Postman

Option 1: You can send your request with cURL

curl --location --request POST 'https://api.pdf.co/v1/pdf/convert/to/json' \
--header 'Content-Type: application/json' \
--header 'x-api-key: INSERT_YOUR_API_KEY_HERE' \
--data-raw '{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-json/sample.pdf",
"inline": true
}'

Option 2: Or you can send it with Postman by going to the Body tab and select Form-Data

Postman Body tab

Step 5: Set Inline Key and Enter PDF Link

Set the inline key to true and enter your pdf file link on the URL key’s value. To upload your PDF file in the temporary storage use the File Uploader tool from PDF.co.

Postman inline and url values

Step 6: Send and Check the Status

Click on the Send button

Postman Send button

Scroll down and make sure that the Status is 200 OK.

Postman response status

Step 7: See Result

Scroll down to see the generated JSON code result

JSON code result on Postman

Step 8: Copy and Paste Code to Editor

Click on the copy to clipboard icon on the left to copy the code and paste it to your favorite editor.

Copy to clipboard on Postman

Note: If you set the inline key to false, it will allow you to download the output instead.

inline key
Output Postman

NOTE: The JSON file is temporarily stored in the cloud and will expire in an hour. Be sure to download/move it to permanent storage.

Now, you’ve learned how to quickly convert PDF to JSON format using PDF.co Web API and Postman.

Video Guide

Related Tutorials

See Related Tutorials