# Classify ## Classify `classify.run(ClassifyRunParams**kwargs) -> ClassifyRunResponse` **post** `/v1/classify` Classify ### Parameters - `file: File` File to classify, either as raw data or a URL - `class FileData: …` - `file_data: str` Raw file data encoded as bytes - `class FileURL: …` - `file_url: str` URL pointing to the file to be processed - `types: Iterable[ClassifyTypeParam]` List of classification types to classify the document into - `description: str` Description of the classified type - `name: str` Name of the classified type ### Returns - `class ClassifyRunResponse: …` - `credit_used: int` Cost in EUR (€) for this classification (per page for PDFs, flat for images) - `result: Result` Classification result for the provided document - `confidence: float` Confidence score between 0 and 1 - `type: str` Type of the classified result ### Example ```python import os from parseocr import Parseocr client = Parseocr( api_key=os.environ.get("PARSEOCR_API_KEY"), # This is the default and can be omitted ) response = client.classify.run( 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", }], ) print(response.credit_used) ``` #### Response ```json { "credit_used": 0, "result": { "confidence": 0.98, "type": "invoice" } } ``` ## Domain Types ### Classify Type - `class ClassifyType: …` - `description: str` Description of the classified type - `name: str` Name of the classified type ### File Data - `class FileData: …` - `file_data: str` Raw file data encoded as bytes ### File URL - `class FileURL: …` - `file_url: str` URL pointing to the file to be processed