> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pruva.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Vision scopes

> Biometric and document checks: face comparison, face detection, and document reading.

Vision scopes work on images rather than identifiers. You send one or more images, and Pruva returns a comparison score, detected faces, or the data read off a document.

## Sending images

Image inputs are sent as base64 data URIs in the JSON body, the same way any other field is sent. Keep in mind that images make requests large; send a reasonably sized image rather than a full resolution photo.

```json theme={null}
{ "image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ..." }
```

<Warning>
  Images are biometric data. Pruva stores any returned images to secure storage and returns them as short lived links, never as raw bytes in the stored record. Do not log full image payloads on your side either.
</Warning>

## Face comparison

`face_compare` compares two faces and returns how closely they match. The common use is matching a live selfie against an ID portrait.

<ParamField body="selfie" type="string" required>
  The first image, as a base64 data URI. Typically the live selfie.
</ParamField>

<ParamField body="idphoto" type="string" required>
  The second image, as a base64 data URI. Typically the ID portrait.
</ParamField>

```bash theme={null}
curl https://api.pruva.africa/v1/face_compare \
  -X POST \
  -H "X-Pruva-Key: pruva_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "selfie": "data:image/jpeg;base64,...", "idphoto": "data:image/jpeg;base64,..." }'
```

The result carries a similarity score and whether the faces are considered a match.

## Face detection

`face_detect` finds faces in a single image and returns each one. This scope is priced **per face**, since one image can contain several. See [per item pricing](/concepts/billing).

<ParamField body="image" type="string" required>
  The image to scan, as a base64 data URI.
</ParamField>

```bash theme={null}
curl https://api.pruva.africa/v1/face_detect \
  -X POST \
  -H "X-Pruva-Key: pruva_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "image": "data:image/jpeg;base64,..." }'
```

The result lists the detected faces, each with its attributes and a cropped image link.

## Document reader

`document_read` reads the data off an identity document, returning the fields it can extract.

<ParamField body="image" type="string" required>
  The document image, as a base64 data URI.
</ParamField>

```bash theme={null}
curl https://api.pruva.africa/v1/document_read \
  -X POST \
  -H "X-Pruva-Key: pruva_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "image": "data:image/jpeg;base64,..." }'
```

The result carries the fields read from the document, which vary by document type.

<Note>
  For collecting selfies and documents from an end user in the browser without handling the images yourself, use the [Widget](/widgets/overview) instead of sending images to these scopes directly.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.