Skip to main content

Quickstart

Get up and running with Structurify in 5 minutes. This guide shows you how to extract data from a document using either Python or Node.js.

Prerequisites

Installation

pip install structurify

Extract Data from a Document

from structurify import Structurify

# Initialize client
client = Structurify(api_key="sk_live_your_api_key")

# Create a project with the invoice template
project = client.projects.create(
name="My First Project",
template_id="tpl_invoice"
)

# Upload a document
doc = client.documents.upload(
project_id=project["id"],
file_path="invoice.pdf"
)

# Run extraction
job = client.extraction.run(project_id=project["id"])

# Wait for completion
completed = client.extraction.wait_for_completion(job["id"])
print(f"Status: {completed['status']}")

# Export results as CSV
export = client.exports.create(
project_id=project["id"],
format="csv"
)
csv_data = client.exports.download(export["export"]["id"])
print(csv_data)

Next Steps

Try it Online

Don't want to write code? Try our web interface at structurify.ai/extract or use our Google Colab notebooks.