Python SDK for the DeepXL API: fraud detection, document parsing, and ID verification.
Installation
pip install deepxl-python-sdk
Example
Create an API key in the DeepXL Dashboard (Settings → API Keys).
Treat your API key like any environment secret. Do not commit to a public repository or store in plain text.
import os
from deepxl_python_sdk import DeepXLClient
client = DeepXLClient(os.environ["DEEPXL_API_KEY"])
detection = client.detect_file("document", "./file.pdf")
parsed = client.parse_document_file("light", "./id.pdf")
verification = client.verify_files("./id.jpg", "./selfie.jpg")
print(detection["likelihood"], parsed["documentType"], verification["verified"])
Client methods
Account
- check_usage() – GET /v1/account. Returns
UsageResponse (usage and limits). Optional attributes: parsing_usage_limit, parsing_usage.
Models
- get_detection_models() – GET /v1/detection-models. Returns list of model dicts.
- get_parsing_models() – GET /v1/parsing-models. Returns list of model dicts.
Fraud detection
- detect(model_name, file_name, file_data [, tags]) / detect_file(model_name, file [, tags]) – POST /v1/detection. Models:
document, object. Returns result dict.
- get_detection(detection_id) – GET /v1/detection/. Returns single detection result.
- list_detections([limit, offset, sort_by, direction, tag_filter]) – GET /v1/detection. Returns dict with
totalCount, count, data.
Document parsing
- parse_document(model_name, file_name, file_data [, tags]) / parse_document_file(model_name, file [, tags]) – POST /v1/parse. Models:
light, performance. Returns result dict.
- get_parse(parse_id) – GET /v1/parse/. Returns single parse result.
- list_parses([limit, offset, sort_by, direction, tag_filter]) – GET /v1/parse. Returns dict with
totalCount, count, data.
ID verification
- verify(id_file_name, id_file_data, selfie_file_name, selfie_file_data [, tags]) / verify_files(id_file, selfie_file [, tags]) – POST /v1/verification. Returns result dict.
- get_verification(verification_id) – GET /v1/verification/. Returns single verification result.
- list_verifications([limit, offset, sort_by, direction, tag_filter]) – GET /v1/verification. Returns dict with
totalCount, count, data.
File retrieval
- get_file(file_name) – GET /v1/files/. Returns
bytes. Use the file name from the files array in any analysis response.
Errors
Raises DeepXLError for API errors (invalid key, bad request, usage limit, etc.).