How to Use Document Parser with PDF.co API and Postman?

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

  1. Open PDF.co API v.1
  2. Select Document Parser
  3. Select Form-Data
  4. Send Request with cURL or with Postman
  5. Input Invoice URL
  6. Send and Check Status
  7. See Result
  8. Copy and Paste Code to Editor
  9. Video Tutorial: Document Parser with Postman & PDF.co

In this tutorial, we will use this sample PDF Invoice as our source file.

PDF.co Document Parser Sample PDF Invoice
Image of the sample PDF Invoice source file

Step 1: Open PDF.co API v.1

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

PDF.co Postman API

Step 2: Select Document Parser

2a.Look for and click on Document Parser folder

Document Parser Folder

2b. Click on POST /pdf/documentparser

Document Parser Endpoint

Step 3: Select Form-Data


Go to Body tab and select Form-Data

File Upload Body

Step 4: Send Request with cURL or with Postman

Option 1: You can send the request with cURL

curl --location --request POST 'https://api.pdf.co/v1/pdf/documentparser' \
--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/document-parser/sample-invoice.pdf",
"outputFormat": "JSON",
"templateId": "1",
"async": false,
"encrypt": "false",
"inline": "true",
"password": "",
"profiles": "",
"storeResult": false
}'

Option 2: Or you can send it with Postman by setting the inline key to true to see the output in the response body and false to get the downloadable link. In this demo, we will set it to true.

Document Parser Params and Keys

Step 5: Input Invoice URL

Enter the invoice URL in the URL key’s value. To learn how to upload the invoice in the temporary storage click here

Note: You can create a custom template using the Document Parser Template Editor (Windows Only). Another great resource can be found in our Document Parser Video Tutorials here

The template id is set to 1 by default which is the Universal Invoice Parser template. It parses the invoice and extracts basic information.

Document Parser Template ID

Step 6: Send and Check Status

6a. Click on the Send button

Send Button

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

200 OK Status Code

Step 7: See Result

Scroll down to the body response to see the result

Document Parser Inline Body Response

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

PDF To JSON Copy To Clipboard Button

Note: Set inline to false to get the downloadable JSON file result

Document Parser URL To JSON

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.

PDF.co Document Parser JSON Output
Image of the JSON Output

Document Parser with Postman & PDF.co – Video