This repository demonstrates how to use the Unstructured API to process and analyze various types of unstructured data, such as PDFs and DOCX files. The goal is to make it easier to extract meaningful information from documents that are often difficult to parse and structure.
In many applications, unstructured data (like scanned documents, emails, and reports) holds valuable information. However, extracting and structuring this information is often challenging. The Unstructured API simplifies this process by providing a robust, flexible solution to convert unstructured data into structured formats, making it easier to analyze and integrate into your applications.
- Data Ingestion: Supports multiple data formats (PDF, DOCX, HTML, etc.).
- Data Processing: Converts unstructured data into structured formats.
- Integration: Examples of integrating the API with Next.js and React.
- Node.js (latest LTS version)
- An API key and URL from Unstructured.io
-
Clone the repository:
git clone https://github.com/brown2020/unstructured-api-demo.git cd unstructured-api-demo
-
Install dependencies:
npm install
-
Create a
.env.local
file by copying.env.example
:cp .env.example .env.local
-
Replace the placeholder values in
.env.local
with your actualUNSTRUCTURED_API_KEY
andUNSTRUCTURED_API_URL
.
-
Development Server:
npm run dev
-
Build for Production:
npm run build npm start
- Navigate to the upload page.
- Drag & drop or select a file to upload.
- The file will be parsed, and the structured data will be displayed.
The core API for parsing unstructured data, enabling the conversion of diverse document formats into structured, machine-readable data.
A powerful React framework for building fast, server-rendered web applications with rich features like static generation, server-side rendering, and server actions.
Server Actions in Next.js 14 allow for seamless integration of server-side logic directly into your React components, improving data handling and performance.
A utility-first CSS framework that enables rapid UI development by providing a set of classes for styling directly in your HTML.
A typed superset of JavaScript that adds static types, making code more robust and easier to debug.
A React component for handling file uploads through drag-and-drop, simplifying user interactions with file input fields.
- Server Actions: Located in
app/actions/parse.ts
, handles file parsing using the Unstructured API. - Components:
UploadAndParse
: Handles file uploads and displays parsed data.
Submit issues and pull requests for enhancements and bug fixes.
This project is licensed under the MIT License.