Skip to main content

Pixl Cognitive Services (PCS)

Pixl Cognitive Services (PCS) is a set of RESTful APIs that read structured data out of photos or scans of identity documents. Send an image as a base64 / data-URI string and the response returns the fields extracted from it — no manual data entry required.

Each document type (and, where a document has two sides, each side) has its own endpoint, but they all share the same conventions:

Stateless REST
Every endpoint is a single POST call over HTTPS, request and response bodies are JSON.
Key-based auth
Requests are authenticated with a static key sent in the request header.
Base64 images
The document image is sent as a base64 string or a data URI — no file upload.

Authentication​

Every PCS request must carry your API key in the key request header:

curl <access-url> \
--header 'key: <your-api-key>'

:::note Base URL The base URL is issued per account during onboarding, e.g. https://sandbox. All paths below are relative to it and prefixed with /pcs. :::

Sending the image​

The image field accepts either:

  • A raw base64 string, or
  • A data URI, e.g. data:image/png;base64,<BASE64_STRING>

Requests also take a recordId — a unique identifier of your choosing that is echoed back in the response so you can correlate it with your own records.

APIs covered in this guide​

DocumentSideEndpoint
PassportFrontPOST /pcs/passport/front
PassportBackPOST /pcs/passport/back
PAN Card—POST /pcs/pan1
Aadhaar CardFrontPOST /pcs/aadhaar/front
Aadhaar CardBackPOST /pcs/aadhaar/back
Voter IDFrontPOST /pcs/voter-id/front
Voter IDBackPOST /pcs/voter-id/back
Qatar IDFrontPOST /pcs/QatarId/front
Qatar IDBackPOST /pcs/QatarId/back
Emirates IDFrontPOST /pcs/emiratesId/front
Emirates IDBackPOST /pcs/emiratesId/back
Malaysian ID—POST /pcs/MalaysianId
Malaysian Driving Licence—POST /pcs/MalaysianDL
Mexican Voter IDFrontPOST /pcs/MexicanVoterIdFront
Mexican Voter IDBackPOST /pcs/MexicanVoterIdBack
UAE Visa—POST /pcs/UAEVisa
US Insurance Card—POST /pcs/UsInsuranceCard
QR Code Reader—POST /pcs/QR-Reader

Error handling​

All PCS endpoints share the same HTTP status conventions:

HTTP codeMeaningWhen returned
200 OKSuccessThe request succeeded — see the endpoint's own response shape for the data payload.
401 UnauthorizedAuth errorThe key header is missing or invalid.
422 Unprocessable EntityValidation errorThe request body failed validation (missing field, malformed image, etc).
500 Internal Server ErrorServer errorAn unexpected error occurred while processing the document.

A 422 response follows the standard FastAPI validation-error shape:

{
"detail": [
{
"loc": ["body", "image"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
FieldTypeDescription
detailarrayOne entry per validation failure.
detail[].locarrayLocation of the offending field, e.g. ["body", "image"].
detail[].msgstringHuman-readable description of the failure.
detail[].typestringMachine-readable error type.