If you’re used to working the Unstructured Open Source library but
would like to leverage the advanced capabilities of the Unstructured API services, you can do so without leaving the comfort
and familiarity of the open source library. Whether you’re using the free Unstructured API, the SaaS Unstructured API,
Unstructured API on Azure/AWS or your local deployment of Unstructured API, you can access it from the open source library
through partition_via_api.
Here’s a basic example in which you send an email file to partition via Unstructured API using partition_via_api available
in the Unstructured Open Source library:
Copy
Ask AI
from unstructured.partition.api import partition_via_apielements = partition_via_api( filename="example-docs/eml/fake-email.eml", api_key="YOUR_API_KEY", # you may need to specify your unique API URL # api_url="YOUR_API_URL", content_type="message/rfc822" )
When sending a request to the free Unstructured API, you only need to provide your individual API key.
When sending requests to the SaaS Unstructured API, you need to supply your unique API URL in addition to your API key.
For Unstructured API on Azure/AWS, use the API URL that you configured through those services.