We Offer 3 Products

  1. API - The quickest way to get started for document transformation.
  2. Platform - Entirely no code enterprise platform to get all your data RAG-ready.
  3. Open Source - Best for prototyping.

TLDR

If you’re here to quickly transform your unstructured documents into understandable JSON, here’s the too long didn’t read version:

  1. Get an API Key and Server URL by signing up to the SaaS Unstructured API page on our website.
  2. Copy and run this code to install the Unstructured Python/JavaScript API SDK.
pip install unstructured-client
  1. Copy and run this code, replacing api_key_auth, server_url, and filename with actual values.
from unstructured_client import UnstructuredClient
from unstructured_client.models import shared
from unstructured_client.models.errors import SDKError

# Update here with your api key and server url
client = UnstructuredClient(
    api_key_auth="YOUR_API_KEY",
    server_url="YOUR_API_URL",
)

# Update here with your filename
filename = "sample-docs/YOUR_FILE_NAME.pdf"

with open(filename, "rb") as f:
    files=shared.Files(
        content=f.read(),
        file_name=filename,
    )

# You can choose fast, hi_res or ocr_only for strategy, learn more in the docs at step 4
req = shared.PartitionParameters(files=files, strategy="auto")

try:
    resp = client.general.partition(req)
    pprint(json.dumps(resp.elements, indent=2))
except SDKError as e:
    print(e)
  1. Done! If you’d like a deeper dive on the API, see the detailed API Documentation. For more on what partitioning strategies are and why they are important, check out the Partioning Strategies guide.

Get in touch

If you don’t find the information you’re looking for in the documentation, or require assistance, get in touch with our Support team at support@unstructured.io, or join our Slack where our team and community can help you.

Was this page helpful?