Skip to main content
Authenticate identity by comparing a provided photo against all photos from a Facebook profile using advanced facial recognition.

Method

client.verifyProfilePhoto.verify(params: VerifyProfilePhotoVerifyParams): Promise<VerifyProfilePhotoVerifyResponse>

Parameters

photoUrl
string
URL of the photo to verify. Must be a valid, publicly accessible image URL. Provide either photoUrl or photoBase64, but not both.
photoBase64
string
Base64-encoded image data URI (e.g., data:image/jpeg;base64,...). Use this when you have the image data directly instead of a URL. Provide either photoUrl or photoBase64, but not both.
profileUrl
string
required
Facebook profile URL to compare against. Must be a valid Facebook profile URL (contains ‘facebook.com’).
additionalInstructions
string
Additional instructions to append to the AI prompt for custom verification criteria.

Usage

Using Photo URL

const result = await client.verifyProfilePhoto.verify({
  photoUrl: 'https://example.com/user-photo.jpg',
  profileUrl: 'https://facebook.com/john.doe',
  additionalInstructions: 'Focus on facial features and ignore background'
});

console.log('Match result:', result);

Using Base64 Image

// Convert file to base64
const fileToBase64 = (file: File): Promise<string> => new Promise((resolve, reject) => {
  const reader = new FileReader();
  reader.readAsDataURL(file);
  reader.onload = () => resolve(reader.result as string);
  reader.onerror = reject;
});

const photoBase64 = await fileToBase64(imageFile);

const result = await client.verifyProfilePhoto.verify({
  photoBase64,
  profileUrl: 'https://facebook.com/john.doe'
});

console.log('Match result:', result);

Response

Returns a VerifyProfilePhotoVerifyResponse object.