Extract Data from Images and PDFs Using Rows Vision API

Quick Overview

The Rows Vision API successfully extracts structured data, such as invoice details, from multiple uploaded images and PDFs by making a POST request to the /v1/vision/import endpoint using the Bearer Token authentication and specifying parameters like 'files', 'mode' (set to 'readsimplified' or 'create'), and 'instructions' for targeted extraction.

Key Points: The demonstration uses the Rows Vision API endpoint POST /v1/vision/import to process multiple files (three PDFs in the example) simultaneously. Authentication requires using a Bearer Token, which is retrieved from the Rows API settings dashboard. The API request body must use 'form-data' and include the 'files' parameter containing the images/PDFs, along with the 'mode' parameter set to 'read', 'readsimplified', or 'create'. The 'instructions' parameter allows users to guide the AI extraction, such as requesting specific fields like 'invoice id, invoice date, supplier name, total amount, due date'. When using 'mode=readsimplified', the API returns JSON output containing merged tables with file names, invoice IDs, dates, supplier names, total amounts, and due dates extracted from all processed documents. When using 'mode=create', the API response includes 'spreadsheetid' and 'folderid', indicating a new spreadsheet was automatically generated in the first available folder. The entire process, from API key retrieval to sending the POST request in Postman, is demonstrated to achieve structured data extraction from unstructured documents.

Context: This video provides a technical tutorial on how to utilize the Rows Vision API, which leverages AI to extract structured data (like tables or key values) from unstructured file formats such as images (PNG, JPG, WEBP) and PDFs. The demonstration focuses on configuring a POST request in an API client (Postman) to send multiple invoice files to the API for processing and receiving the extracted data in a structured JSON format.

Detailed Analysis

The tutorial walks through using the Rows Vision API to extract structured data from image and PDF files. First, the presenter navigates to the Rows application settings to retrieve an API key, emphasizing the need to copy this key immediately as it is only visible once. Next, the presenter shifts to Postman to construct the POST request to the /v1/vision/import endpoint. Key configuration steps include setting the request method to POST, pasting the API endpoint URL, and setting the Authorization tab to use a Bearer Token, pasting the copied API key into the token field. In the Body tab, 'form-data' is selected, and required parameters are added: 'files' (uploading three example PDF invoices), 'mode' (initially set to 'read' then changed to 'readsimplified'), 'instructions' (specifying required fields like invoice ID, date, supplier name, etc.), and 'merge' (set to 'true' to combine data). After sending the request, the successful JSON response is shown, containing merged tables with the extracted data structured by columns like filename, invoiceid, suppliername, and dates. The presenter also briefly demonstrates switching the 'mode' to 'create', which results in the creation of a new spreadsheet in the Rows workspace, confirmed by the response containing a 'spreadsheetid' and 'folderid'.

Raw markdown version of this recap