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

# 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.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/faces/{face_id}/neighbors
openapi: 3.1.0
info:
  title: faces
  version: 0.101.0
servers: []
security: []
paths:
  /v1/faces/{face_id}/neighbors:
    get:
      tags:
        - Faces
      summary: Get Face Neighbors
      description: >-
        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.
      operationId: get_face_neighbors_v1_faces__face_id__neighbors_get
      parameters:
        - name: face_id
          in: path
          required: true
          schema:
            type: string
            title: Face Id
        - name: k
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Number of neighbours (max 100)
            default: 5
            title: K
          description: Number of neighbours (max 100)
        - name: scope
          in: query
          required: false
          schema:
            type: string
            pattern: ^(own|published)$
            description: >-
              `own` (default, unchanged) searches your own faces. `published`
              searches the published corpus; use it with `owner` to name a query
              face you do not own.
            default: own
            title: Scope
          description: >-
            `own` (default, unchanged) searches your own faces. `published`
            searches the published corpus; use it with `owner` to name a query
            face you do not own.
        - name: owner
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              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.
            title: Owner
          description: >-
            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.
        - name: include
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: >-
              Enrichment on each neighbour, same vocabulary as the list:
              'profile', 'avatar', 'usage', 'owner_follow'. `name`, `specialty`,
              `description` and `owned_by` always come back, because a bare
              alias is not enough to draw or open a result.
            title: Include
          description: >-
            Enrichment on each neighbour, same vocabulary as the list:
            'profile', 'avatar', 'usage', 'owner_follow'. `name`, `specialty`,
            `description` and `owned_by` always come back, because a bare alias
            is not enough to draw or open a result.
        - name: component
          in: query
          required: false
          schema:
            type: string
            description: >-
              What to compare on. The only accepted value is `face`, the overall
              score, which is also the default.
            default: face
            title: Component
          description: >-
            What to compare on. The only accepted value is `face`, the overall
            score, which is also the default.
        - name: direction
          in: query
          required: false
          schema:
            type: string
            pattern: ^(nearest|furthest)$
            description: Search direction
            default: nearest
            title: Direction
          description: Search direction
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.