Face Compare API
The Face Compare API allows users to compare two faces to determine their similarity. With this functionality, users can easily measure the resemblance between two facial images, enabling them to identify and analyze similarities or differences.API Overview
The Face Compare API provides a powerful tool for facial similarity analysis with the following capabilities:- Dual Image Comparison: Compare two facial images side by side
- Similarity Scoring: Get precise similarity scores between faces
- High Accuracy: Advanced AI algorithms for reliable comparisons
- Fast Processing: Quick analysis and response times
- Multiple Formats: Support for various image formats
- Privacy Focused: No storage of facial data, only comparison results
Request Parameters
Required Parameters
- originFace: Base64 encoded image of the face to be compared with the targetFace image
- targetFace: Base64 encoded image of the face to be compared with the originFace image
Optional Parameters
- callbackUrl: The URL where the face compare results will be sent upon completion
Authentication
- x-api-key: API key essential for authentication and access control purposes
Response Format
The API returns detailed comparison results including:- apiType: API type identifier
- transactionId: Unique identifier for each request
- result: Object containing the processing result
- face: Recognition result of the originFace
- targetFace: Recognition result of the targetFace
- similarity: Similarity score between the two faces
Use Cases
- Identity Verification: Verify if two photos belong to the same person
- Fraud Detection: Detect identity theft and fake documents
- Access Control: Verify identity for secure entry systems
- Customer Onboarding: Ensure consistent identity across registrations
- Document Verification: Compare ID photos with live captures
Processing Modes
Synchronous Processing
- Immediate response with comparison results
- Best for real-time applications
- Direct API response
Asynchronous Processing
- Use callback URL for delayed results
- Better for batch processing
- Detailed callback response format
Similarity Scoring
The API provides similarity scores that indicate how closely two faces match:- High Score (80-100%): Very likely the same person
- Medium Score (60-79%): Possibly the same person
- Low Score (0-59%): Likely different people
Authorizations
Body
application/json
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=="
The base64 encoded image of the face to be compared with the originFace image.
Example:
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="
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.
Example:
"https://your-domain.com/callback"