Lookup a Person by Name
Endpoint
GET https://api.verifik.co/v2/face-recognition/persons/lookup
Finds persons already stored for your client by name (required) and optional date of birth. Use this when create returns 412 person_already_set, or before you enroll, so you can get the person _id and collection code values without running a 1:N face search.
This is a Mongo metadata lookup, not a face match. Digits in name are stripped the same way as create ("Maria 123" becomes "Maria"). Name match is case-insensitive contains (Maria finds Maria Perez Gonzalez). Use at least 3 characters.
Use collections[].code (36-character UUID) as collection_id on face search. Do not send the Mongo collection _id.
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Params
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Partial or full name (min 3 characters after stripping digits). Case-insensitive contains. |
date_of_birth | string | No | YYYY-MM-DD. When set, narrows to that day. |
page | number | No | Page number (default: 1). |
limit | number | No | Page size (default: 20, max: 100). |
Request
- Node.js
- PHP
- Python
- Go
const fetch = require("node-fetch");
async function run() {
const params = new URLSearchParams({
name: "Maria Perez",
date_of_birth: "1994-02-07",
page: "1",
limit: "20",
});
const res = await fetch(`https://api.verifik.co/v2/face-recognition/persons/lookup?${params}`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
});
console.log(await res.json());
}
run();
<?php
$query = http_build_query([
"name" => "Maria Perez",
"date_of_birth" => "1994-02-07",
"page" => 1,
"limit" => 20,
]);
$ch = curl_init("https://api.verifik.co/v2/face-recognition/persons/lookup?" . $query);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . getenv("VERIFIK_TOKEN"),
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os, requests
url = "https://api.verifik.co/v2/face-recognition/persons/lookup"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_TOKEN')}",
}
params = {"name": "Maria Perez", "date_of_birth": "1994-02-07", "page": 1, "limit": 20}
r = requests.get(url, headers=headers, params=params)
print(r.json())
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
url := "https://api.verifik.co/v2/face-recognition/persons/lookup?name=Maria%20Perez&date_of_birth=1994-02-07&page=1&limit=20"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIFIK_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Response
- 200
- 409
- 401/403
{
"data": [
{
"_id": "693c646dfd68b59e4e8d1d58",
"name": "Maria Perez",
"date_of_birth": "1994-02-07",
"gender": "F",
"collections": [
{
"_id": "6612a020a55c329bfb3f62e6",
"code": "ed27d231-b437-42c5-94c5-a2130c447d1e",
"name": "CholloApp"
}
]
}
],
"total": 1
}
An unknown name returns 200 with "data": [] and "total": 0. That is not a 404.
{
"message": "name is required",
"code": "MissingParameter"
}
or "message": "name_too_short" when the name has fewer than 3 characters after stripping digits.
{
"message": "Authentication required",
"code": "UNAUTHORIZED"
}
Notes
- Prefer this helper (or the
dataobject on412 person_already_set) over a 1:N search when you know part of the name and optional date of birth. - A first name alone is enough (
name=Maria). Adddate_of_birthwhen many people share that given name. POST /v2/face-recognition/personsuniqueness is also name + date of birth in a collection, not face similarity.collections[].codeis the value face search expects ascollection_id.