Getting Started
Authentication
The Extend API uses Bearer token authentication for all API requests. You’ll need to use your API token when instantiating the client if you’re using the SDK or in the Authorization
header of each request if you’re using the API directly.
Log in to the Extend dashboard and obtain an Extend API key from the Developer Settings page.
Example Usage
Installing the Extend SDK
In the following getting started guide we will provide sample code using both cURL requests and our Typescript and Python SDKs. If you wish to follow along with Typescript or Python, you should install the SDKs as follows:
Typescript:
Python:
Creating an Extractor Processor
Learn how to use the Extend API to extract data from documents.
Extractors are processors that pull out structured data from documents. To create an extractor, we will use the Create Processor endpoint.
Extractors take in a schema, which describes the shape of the data to extract. For this example, we will create an extractor that can pull out an invoice number and table of line items from this sample invoice document.
Execute the following code in your preferred environment and language to create your first extractor. Be sure to replace YOUR_API_KEY_HERE
with your actual API key.
Once the code is executed you should see a response object logged to your console. Your returned extractor will contain a processor.id
field, which uniquely references this extractor. This will be used later to run the extractor against a document.
You can view the Processors page in the Extend dashboard to see your new Extractor. You can click on the processor to view the details.
In the details view, you can see the id
of the processor on the left, which matches the processor.id
field in the response object of your API call. You can also click into the build tab at the top to edit the processor.
In the build tab, you can see that the schema
we passed in is reflected in the UI. Continued configuration of the processor can be done either in the UI or via the API.
Let’s run the extractor against the sample document using the API. To do this, we will use the Run Processor endpoint. Be sure to replace YOUR_API_KEY_HERE
with your actual API key and YOUR_PROCESSOR_ID
with the processor.id
from the previous response / UI.
Once the above code is executed you should see a response object logged to your console. Your returned object will contain a processor_run.id
field, which uniquely references this execution of the extractor against a document. The run processor endpoint is asynchronous, so you won’t see the extracted results immediately in the response.
If you navigate to the history tab of your processor in the UI, you can see the status of the run. The “run ID” should match the processor_run.id
field in the response object. You can click into the run to see the extracted details.
The extracted details:
Finally, let’s call the Get Processor Run endpoint to fetch the status and results of the processor run via the API.
Once the above code is executed, you should see a response object logged with the full details of the extracted data.
Next Steps
- View our Product Documentation to learn more about orchestrating processors together, and evaluating performance of your processors.
- Try out our SDKs in multiple languages