Skip to content
Get started

Classify

POST/v1/classify

Classify

Body ParametersJSONExpand Collapse
file: FileData { file_data } or FileURL { file_url }

File to classify, either as raw data or a URL

One of the following:
FileData = object { file_data }
file_data: string

Raw file data encoded as bytes

FileURL = object { file_url }
file_url: string

URL pointing to the file to be processed

maxLength2083
minLength1
formaturi
types: array of ClassifyType { description, name }

List of classification types to classify the document into

description: string

Description of the classified type

name: string

Name of the classified type

ReturnsExpand Collapse
credit_used: number

Cost in EUR (€) for this classification (per page for PDFs, flat for images)

result: object { confidence, type }

Classification result for the provided document

confidence: number

Confidence score between 0 and 1

maximum1
minimum0
type: string

Type of the classified result

Classify

curl https://api.parseocr.com/v1/classify \
    -H 'Content-Type: application/json' \
    -H "X-API-Key: $PARSEOCR_API_KEY" \
    -d '{
          "file": {
            "file_data": "JVBERi0xLjcKJcfs...KqldOIQo="
          },
          "types": [
            {
              "description": "Invoices request payment for goods or services provided.",
              "name": "invoice"
            },
            {
              "description": "Quotes provide an estimate of costs for goods or services before they are provided.",
              "name": "quote"
            }
          ]
        }'
{
  "credit_used": 0,
  "result": {
    "confidence": 0.98,
    "type": "invoice"
  }
}
Returns Examples
{
  "credit_used": 0,
  "result": {
    "confidence": 0.98,
    "type": "invoice"
  }
}