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

# Search for embeddings

> Search for embeddings using vector similarity search



## OpenAPI

````yaml /api-reference/specs/embeddings.yaml post /api/v1/embeddings/{indexName}/search
openapi: 3.0.3
info:
  title: EigenDB REST API
  description: REST API for EigenDB.
  version: 1.0.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/v1/embeddings/{indexName}/search:
    post:
      summary: Search for embeddings
      description: Search for embeddings using vector similarity search
      operationId: searchEmbedding
      parameters:
        - name: indexName
          in: path
          description: Name of the index
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - queryVector
                - k
              properties:
                queryVector:
                  type: array
                  items:
                    type: number
                    format: float
                  description: ID of the query vector
                k:
                  type: number
                  format: int
                  description: Number of retrieved embedding desired.
      responses:
        '200':
          description: >-
            The k-nearest embeddings returned in an array along with their rank
            (0 is nearest).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseSchema'
              example:
                status: 200
                message: Similarity search successfully performed.
                data:
                  nearest_neighbors:
                    '21':
                      metadata:
                        foo3: bar4
                      rank: 2
                    '45':
                      metadata:
                        foo7: bar8
                      rank: 4
                    '54':
                      metadata:
                        foo: bar
                      rank: 0
                    '63':
                      metadata:
                        foo5: bar6
                        hello: world
                      rank: 3
                    '98':
                      metadata:
                        foo1: bar2
                        bar: baz
                      rank: 1
        '400':
          description: An error occured when performing similarity search.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseSchema'
              example:
                status: 400
                message: An error occured during the similarity search.
                error:
                  code: SIMILARITY_SEARCH_ERROR
                  description: detailed description of the error...
components:
  schemas:
    responseSchema:
      type: object
      properties:
        status:
          type: integer
          description: Status code of the response
        message:
          type: string
          description: Message giving basic information on the response
        data:
          type: object
          description: Important data to be given to the caller
        error:
          type: object
          description: An error that has occured
          properties:
            code:
              type: string
              description: An error code unique to this type of error
            description:
              type: string
              description: A detailed description of the error
      required:
        - status
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Eigen-API-Key

````