Blog post

Extract key-value pairs from documents with Nutrient Document Web Services API on Zapier

This tutorial shows you how to extract key-value pairs from PDF or image-based documents using the Nutrient Document Web Services API on Zapier. This is useful for automating data capture from receipts, invoices, forms, or contracts.

Illustration: Extract key-value pairs from documents with Nutrient Document Web Services API on Zapier

What is Zapier?

Zapier is an automation platform that connects your favorite apps and services with no code required. You can build “Zaps” to automate repetitive tasks by setting up triggers and actions between apps like Google Drive, Slack, Gmail, and more.

In this tutorial, you’ll learn how to use Zapier to automatically extract plain and structured text from PDF documents using the Nutrient API.

What is the Nutrient API?

Nutrient Document Web Services API enables powerful document processing with simple API calls. With a free account, you get 100 credits to automate actions like:

  • Convert and extract PDF content

  • OCR and recognize text from images

  • Extract tables or key-value pairs

  • Digitally sign, annotate, redact, and more

Nutrient’s key-value pair (KVP) extractor can identify fields like Name: John, Total: $32.00, and Date: 01/01/2025 from unstructured files.

What you’ll need

  • A Zapier account (a pro plan is necessary for multi-step Zaps)

  • A Google Drive account

  • A scanned image or PDF file stored in Google Drive

  • A Nutrient API key — sign up here

Step 1 — Trigger a new file in a Google Drive folder

  1. Select Google Drive as the trigger app.

Choose Google Drive as the trigger app

  1. Choose the New File in Folder trigger event.

New File in Folder selected in trigger step

  1. Connect your Google Drive account.

  2. Configure the trigger:

  • In the Drive field, select your Google Drive.

  • In the Folder field, select or create a folder (e.g. kvp-input).

Folder picker showing selected folder

  1. Test the trigger with a sample PDF or image file.

Test trigger successfully detects a PDF file

Step 2 — Extract key-value pairs action (Nutrient API)

  1. Select Nutrient Document Web Services API as the action app.

Choose Nutrient API as the action app

  1. Choose the Extract Key-Value Pairs From PDF action.

Select Extract KVPs from PDF as the action

  1. Connect your Nutrient account using your API key.

Paste your Nutrient API key

You can find your API key in the Nutrient dashboard.

API key location in Nutrient dashboard

  1. Configure the fields:

  • Image File — Use the file from step 1.

  • File Name — Optional, e.g. extracted_kvp.json.

Map the file URL and output name fields

Make sure the files are publicly accessible or uploaded through a supported trigger like Google Drive.

  1. Run a test to confirm the key-value pairs are extracted.

Test shows JSON with extracted KVPs

Step 3 — Upload the JSON result to Google Drive

  1. Now, add another step by selecting Google Drive as the app and Upload File as the action event. Connect your Google Drive account if needed.

Upload file action for storing the extracted JSON

  1. Configure the following:

  • In the Drive and Folder fields — Choose where to store the extracted data (e.g. kvp-output).

  • In the File field — Map the output from the Nutrient API step.

Choose output location and map the JSON file

To avoid Zap loops, use different folders for input and output.

  1. Run a test to verify the JSON file is uploaded successfully.

Final step confirms JSON file is stored

Conclusion

You’ve just built a Zap that automatically extracts structured key-value pairs from PDFs or scanned image files. With Nutrient API, you can expand this flow to include OCR scanning, table extraction, annotations, and more.

Author
Hulya Masharipov
Hulya Masharipov Technical Writer

Hulya is a frontend web developer and technical writer at Nutrient who enjoys creating responsive, scalable, and maintainable web experiences. She’s passionate about open source, web accessibility, cybersecurity privacy, and blockchain.

Free trial Ready to get started?
Free trial