Sign in to get started with the Unstructured Serverless API

To connect to Unstructured Serverless API you need to obtain the API URL and a unique API key:

  1. Navigate to the Unstructured Serverless API page on our website.
  2. Enter your valid email address to receive a magic link to sign in to your personalized dashboard, or authenticate yourself with either your Google or GitHub account.
  3. Once authenticated either via Google/GitHub, or via the magic link sent to your email, you’ll find your newly generated Unstructured API key in your dashboard.

On the same page as your API key(s), you’ll find the Unstructured API URL. Save your API key and the API URL securely, as you will need them to access the Unstructured Serverless API and integrate it with your applications.

Set up billing

Once you sign up for Unstructured API, you can enjoy a free 14-day trial with usage capped at 1000 pages per day. At the end of the trial, or if you need to exceed the trial’s limit, you need to set up your billing information to proceed using the Unstructured Serverless API.

  1. Log in to your personal dashboard.
  2. Navigate to the Billing tab on the left side of the screen.
  3. Click on the Manage Payment Method button. This will take you to the Stripe page. Specify your credit card details, and click Save card.

Your card will be billed monthly based on the usage. You can see the billing overview for the ongoing month on the Billing page of your dashboard.

Quick Start Example

The following example illustrates how to preprocess an *.eml file using the Unstructured Serverless API. The functionality is similar to the free Unstructured API, the main difference is that in addition to your API key, you must provide the API URL from your dashboard.

There are several ways to use the Unstructured Serverless API, which all lead to the same result, so pick your preferred method.

POST request

Supply your API key, and the file to preprocess. Make sure to copy the complete Unstructured Serverless API URL that you can find in your dashboard on the API keys page:

curl -X 'POST' 'https://API_URL' \
     -H 'accept: application/json' \
     -H 'Content-Type: multipart/form-data' \
     -H 'unstructured-api-key: YOUR_API_KEY' \
     -F 'files=@PATH_TO_FILE'

The result will look something like this:

Sample Output

Unstructured Python/JavaScript SDK

To work with the Unstructured Serverless API in Python or JavaScript, use the Unstructured Python SDK, or JavaScript SDK.

First, install your preferred SDK:

pip install unstructured-client

Next, use it to call the API. Be sure to supply the API URL from your dashboard. Use your Unstructured Serverless API key to authenticate yourself.

import unstructured_client
from unstructured_client.models import operations, shared

client = unstructured_client.UnstructuredClient(
    api_key_auth="YOUR_API_KEY",
    server_url="API_URL",
)

filename = "PATH_TO_FILE"
with open(filename, "rb") as f:
    data = f.read()

req = operations.PartitionRequest(
    partition_parameters=shared.PartitionParameters(
        files=shared.Files(
            content=data,
            file_name=filename,
        ),
        # --- Other partition parameters ---
        strategy=shared.Strategy.AUTO,
        languages=['eng'],
    ),
)

try:
    res = client.general.partition(request=req)
    print(res.elements[0])
except Exception as e:
    print(e)

Calling the Unstructured API from the Unstructured open source library

Finally, you can call the Unstructured Serverless API directly from the Unstructured open source library:

from unstructured.partition.api import partition_via_api

filename = "PATH_TO_FILE"

elements = partition_via_api(
  filename=filename,
  api_key="YOUR_API_KEY",
  api_url="API_URL"
)

Unstructured Serverless API Account Maintenance

Log in to your Unstructured API dashboard to manage your account:

  • Go to the API keys page to generate new API keys, deactivate existing keys.
  • Review the details on the Usage page to understand the breakdown of processed documents.
  • Track your costs, and manage payment methods on the Billing page.

If you need direct assistance, our support team is just an email away. Contact us at support@unstructured.io.