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

# Face Compare API

> Compare two facial images to determine their similarity and provide detailed analysis results

# Face Compare API

La API de Face Compare permite a los usuarios comparar dos rostros para determinar su similitud. Con esta funcionalidad, los usuarios pueden medir fácilmente la semejanza entre dos imágenes faciales, permitiéndoles identificar y analizar similitudes o diferencias.

## Descripción General de la API

La API de Face Compare proporciona una herramienta potente para el análisis de similitud facial con las siguientes capacidades:

* **Comparación de Dos Imágenes**: Compare dos imágenes faciales lado a lado
* **Puntuación de Similitud**: Obtenga puntuaciones de similitud precisas entre rostros
* **Alta Precisión**: Algoritmos avanzados de IA para comparaciones confiables
* **Procesamiento Rápido**: Análisis y tiempos de respuesta rápidos
* **Múltiples Formatos**: Soporte para varios formatos de imagen
* **Enfoque en Privacidad**: Sin almacenamiento de datos faciales, solo resultados de comparación

## Parámetros de Solicitud

### Parámetros Requeridos

* **originFace**: Imagen codificada en Base64 del rostro a comparar con la imagen targetFace
* **targetFace**: Imagen codificada en Base64 del rostro a comparar con la imagen originFace

### Parámetros Opcionales

* **callbackUrl**: La URL donde se enviarán los resultados de la comparación facial al completarse

### Autenticación

* **x-api-key**: Clave API esencial para fines de autenticación y control de acceso

## Formato de Respuesta

La API devuelve resultados detallados de comparación que incluyen:

* **apiType**: Identificador del tipo de API
* **transactionId**: Identificador único para cada solicitud
* **result**: Objeto que contiene el resultado del procesamiento
  * **face**: Resultado del reconocimiento del originFace
  * **targetFace**: Resultado del reconocimiento del targetFace
  * **similarity**: Puntuación de similitud entre los dos rostros

## Casos de Uso

* **Verificación de Identidad**: Verifique si dos fotos pertenecen a la misma persona
* **Detección de Fraude**: Detecte robo de identidad y documentos falsos
* **Control de Acceso**: Verifique la identidad para sistemas de entrada seguros
* **Incorporación de Clientes**: Garantice identidad consistente en los registros
* **Verificación de Documentos**: Compare fotos de identificación con capturas en vivo

## Modos de Procesamiento

### Procesamiento Síncrono

* Respuesta inmediata con resultados de comparación
* Mejor para aplicaciones en tiempo real
* Respuesta directa de la API

### Procesamiento Asíncrono

* Use URL de callback para resultados diferidos
* Mejor para procesamiento por lotes
* Formato detallado de respuesta de callback

## Puntuación de Similitud

La API proporciona puntuaciones de similitud que indican qué tan estrechamente coinciden dos rostros:

* **Puntuación Alta (80-100%)**: Muy probablemente la misma persona
* **Puntuación Media (60-79%)**: Posiblemente la misma persona
* **Puntuación Baja (0-59%)**: Probablemente personas diferentes


## OpenAPI

````yaml POST /compare
openapi: 3.1.0
info:
  title: Face Compare API
  description: API for comparing two facial images and determining their similarity
  version: 1.0.0
servers:
  - url: https://idverify-api.argosidentity.com/modules
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /compare:
    post:
      tags:
        - Face Compare
      summary: Compare two facial images
      description: >-
        Compare two facial images to determine their similarity and provide
        detailed analysis results
      operationId: compareFaces
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - originFace
                - targetFace
              properties:
                originFace:
                  type: string
                  description: >-
                    The base64 encoded image of the face to be compared with the
                    targetFace image.


                    * Base64 encoded characters in the payload must not include
                    the MIME type. For example, if the encoded base64 characters
                    are "image/png;base64,/9j/2wBDABQODxIP...", then remove
                    "image/png;base64," and send only the encoded data
                    "/9j/2wBDABQODxIP...".
                  example: >-
                    iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==
                targetFace:
                  type: string
                  description: >-
                    The base64 encoded image of the face to be compared with the
                    originFace image.
                  example: >-
                    iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==
                callbackUrl:
                  type: string
                  description: >-
                    The URL where the face compare results will be sent upon
                    completion. If a callbackUrl is provided, the process works
                    asynchronously. If no callbackUrl is provided, the process
                    operates synchronously.
                  format: uri
                  example: https://your-domain.com/callback
      responses:
        '200':
          description: Successful face comparison
          content:
            application/json:
              schema:
                type: object
                properties:
                  apiType:
                    type: string
                    description: API type identifier
                    example: compare_face
                  transactionId:
                    type: string
                    description: Unique identifier for each request
                    example: txn_123456789
                  result:
                    type: object
                    description: Object containing the processing result
                    properties:
                      face:
                        type: object
                        description: Recognition result of the originFace
                        properties:
                          isAvailable:
                            type: boolean
                            description: Presence of the recognized originFace
                            example: true
                          boundingBox:
                            type: object
                            description: Bounding Box object for the recognized originFace
                            properties:
                              Width:
                                type: number
                                description: >-
                                  Width coordinate of the Bounding Box for
                                  originFace
                                example: 0.42534321546554565
                              Height:
                                type: number
                                description: >-
                                  Height coordinate of the Bounding Box for
                                  originFace
                                example: 0.567890123456789
                              Left:
                                type: number
                                description: >-
                                  Left coordinate of the Bounding Box for
                                  originFace
                                example: 0.12345678901234566
                              Top:
                                type: number
                                description: >-
                                  Top coordinate of the Bounding Box for
                                  originFace
                                example: 0.23456789012345677
                          confidence:
                            type: number
                            description: Confidence score of face detection
                            example: 0.9876543210987654
                      targetFace:
                        type: object
                        description: Recognition result of the targetFace
                        properties:
                          isAvailable:
                            type: boolean
                            description: Presence of the recognized targetFace
                            example: true
                          boundingBox:
                            type: object
                            description: Bounding Box object for the recognized targetFace
                            properties:
                              Width:
                                type: number
                                description: >-
                                  Width coordinate of the Bounding Box for
                                  targetFace
                                example: 0.4567890123456789
                              Height:
                                type: number
                                description: >-
                                  Height coordinate of the Bounding Box for
                                  targetFace
                                example: 0.543210987654321
                              Left:
                                type: number
                                description: >-
                                  Left coordinate of the Bounding Box for
                                  targetFace
                                example: 0.13456789012345677
                              Top:
                                type: number
                                description: >-
                                  Top coordinate of the Bounding Box for
                                  targetFace
                                example: 0.2456789012345679
                          confidence:
                            type: number
                            description: Confidence score of face detection
                            example: 0.9765432109876543
                      similarity:
                        type: object
                        description: Similarity analysis between the two faces
                        properties:
                          score:
                            type: number
                            description: Similarity score between the two faces (0-1 scale)
                            example: 0.854321098765432
                          threshold:
                            type: number
                            description: Threshold used for matching
                            example: 0.8
                          isMatch:
                            type: boolean
                            description: >-
                              Boolean indicating if faces match based on
                              threshold
                            example: true
              examples:
                successful-comparison:
                  summary: Successful face comparison with high similarity
                  value:
                    apiType: compare_face
                    transactionId: txn_123456789
                    result:
                      face:
                        isAvailable: true
                        boundingBox:
                          Width: 0.42534321546554565
                          Height: 0.567890123456789
                          Left: 0.12345678901234566
                          Top: 0.23456789012345677
                        confidence: 0.9876543210987654
                      targetFace:
                        isAvailable: true
                        boundingBox:
                          Width: 0.4567890123456789
                          Height: 0.543210987654321
                          Left: 0.13456789012345677
                          Top: 0.2456789012345679
                        confidence: 0.9765432109876543
                      similarity:
                        score: 0.854321098765432
                        threshold: 0.8
                        isMatch: true
                low-similarity:
                  summary: Face comparison with low similarity
                  value:
                    apiType: compare_face
                    transactionId: txn_987654321
                    result:
                      face:
                        isAvailable: true
                        boundingBox:
                          Width: 0.42534321546554565
                          Height: 0.567890123456789
                          Left: 0.12345678901234566
                          Top: 0.23456789012345677
                        confidence: 0.9876543210987654
                      targetFace:
                        isAvailable: true
                        boundingBox:
                          Width: 0.4567890123456789
                          Height: 0.543210987654321
                          Left: 0.13456789012345677
                          Top: 0.2456789012345679
                        confidence: 0.9765432109876543
                      similarity:
                        score: 0.23456789012345677
                        threshold: 0.8
                        isMatch: false
        '400':
          description: Bad request - Invalid input parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: INVALID_IMAGE
                      message:
                        type: string
                        example: One or both images are invalid or corrupted
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: INVALID_API_KEY
                      message:
                        type: string
                        example: Invalid or missing API key
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: INTERNAL_ERROR
                      message:
                        type: string
                        example: An internal server error occurred
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````