Get Face Neighbors
curl --request GET \
--url https://api.example.com/v1/faces/{face_id}/neighborsimport requests
url = "https://api.example.com/v1/faces/{face_id}/neighbors"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/faces/{face_id}/neighbors', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/faces/{face_id}/neighbors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/faces/{face_id}/neighbors"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/faces/{face_id}/neighbors")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/faces/{face_id}/neighbors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Faces
Get Face Neighbors
Find faces most (or least) similar to a given face.
Each similarity is rounded to one decimal place when either face is not yours.
When it is, rows are ordered, and the top k chosen, on the rounded score, and
rows with the same score are listed by owner and alias.
GET
/
v1
/
faces
/
{face_id}
/
neighbors
Get Face Neighbors
curl --request GET \
--url https://api.example.com/v1/faces/{face_id}/neighborsimport requests
url = "https://api.example.com/v1/faces/{face_id}/neighbors"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/faces/{face_id}/neighbors', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/faces/{face_id}/neighbors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/faces/{face_id}/neighbors"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/faces/{face_id}/neighbors")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/faces/{face_id}/neighbors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Query Parameters
The account that owns the QUERY face, when it is not you. The same thing as the <owner>:<alias> handle in the path: /v1/faces/head:socrates/neighbors and /v1/faces/socrates/neighbors?owner=head are one request. Sending both and disagreeing is a 422. This scopes the QUERY face only; scope decides what is searched. The resolved owner comes back as owned_by on the response, so a bare alias can be checked.
Response
Successful Response