curl --request POST \
--url https://api.traddocs.com/v1/documents/analyze \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file=@your/path/sample.pdf \
--form url=https://url_to_your_document.pdf
import requests
url = "https://api.traddocs.com/v1/documents/analyze"
headers = {"x-api-key": "<api-key>"}
files = {"file": open("your/path/sample.pdf", "rb")}
// files = {"url": (None, "https://url_to_your_document.pdf")}
response = requests.post(url, headers=headers, files=files)
print(response.json())
[
{
"split": {
"document_type": "<string>",
"pages": [
123
]
},
"extracted": {}
}
]{
"detail": "<string>"
}Analyze Document
Submit a document to this endpoint, which will categorize it into the correct document type. It then returns the document split into its respective type and provides the extracted key-value pairs of essential information for each categorized document.
curl --request POST \
--url https://api.traddocs.com/v1/documents/analyze \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file=@your/path/sample.pdf \
--form url=https://url_to_your_document.pdf
import requests
url = "https://api.traddocs.com/v1/documents/analyze"
headers = {"x-api-key": "<api-key>"}
files = {"file": open("your/path/sample.pdf", "rb")}
// files = {"url": (None, "https://url_to_your_document.pdf")}
response = requests.post(url, headers=headers, files=files)
print(response.json())
[
{
"split": {
"document_type": "<string>",
"pages": [
123
]
},
"extracted": {}
}
]{
"detail": "<string>"
}Analyze Document Endpoint
TheAnalyze Document endpoint processes and analyzes multiple documents to extract important information. Here’s a detailed breakdown of its functionality:
- Document Splitting: The endpoint splits the provided documents into the appropriate types using a document splitter.
- Information Extraction: The endpoint extracts key-value pairs of important information from each split document.
Supported document types
- Bill of Lading
- Letter of Credit
- Document Instruction
- Contract
- Commercial Invoice
- Packing List
- Certificate of Origin
- Certificate of Weight
- Certificate of Quality
- Phytosanitary Certificate
- Fumigation Certificate
- More to come…
curl --request POST \
--url https://api.traddocs.com/v1/documents/analyze \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file=@your/path/sample.pdf \
--form url=https://url_to_your_document.pdf
import requests
url = "https://api.traddocs.com/v1/documents/analyze"
headers = {"x-api-key": "<api-key>"}
files = {"file": open("your/path/sample.pdf", "rb")}
// files = {"url": (None, "https://url_to_your_document.pdf")}
response = requests.post(url, headers=headers, files=files)
print(response.json())
Authorizations
Body
Represents a request for document analysis. The object can contain either a file or a URL pointing to the document to be analyzed. The properties are mutually exclusive, meaning you should provide either a file or a URL, but not both.
A binary file representing the document to be analyzed. This should be provided as a file upload, for example using a multipart/form-data request. The file can be in various formats such as .pdf, .docx, .eml, etc. Example usage: -F 'files=@path/to/your-document.extension'.
A URI pointing to the document to be analyzed. This should be used if the document is hosted at a specific URL and can be accessed directly from the web.
1
