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

# Filings Embeddings Search

> The Filings Embeddings Search API retrieves the nearest chunks of text (based on semantic similarity) from our database for specified filings (earnings transcripts and 10-Ks) for any given user query/prompt in natural langauge. Users can utilize this functionality for various purposes, such as building an AI-search engine, AI-tagging, etc., using the associated text from these filings.



## OpenAPI

````yaml openapi-us post /api/us/v0/documents/embeddings-search
openapi: 3.0.0
info:
  title: stockinsights.ai APIs
  description: All the APIs of stockinsights.ai
  version: 1.0.0
servers:
  - url: https://stockinsights-ai-us-main-f5fd25a.zuplo.app
security:
  - bearerAuth: []
paths:
  /api/us/v0/documents/embeddings-search:
    post:
      summary: Filings Embeddings Search
      description: >-
        The Filings Embeddings Search API retrieves the nearest chunks of text
        (based on semantic similarity) from our database for specified filings
        (earnings transcripts and 10-Ks) for any given user query/prompt in
        natural langauge. Users can utilize this functionality for various
        purposes, such as building an AI-search engine, AI-tagging, etc., using
        the associated text from these filings.
      operationId: documentEmbeddingSearch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
              properties:
                query:
                  type: string
                  description: >-
                    The user query in natural language for which similar chunks
                    of filings text is retrieved using OpenAI embeddings.
                top_k:
                  type: integer
                  default: 10
                  maximum: 100
                  description: >-
                    Number of top matching chunks to return in the response.
                    This parameter is optional and defaults to 20 if not
                    specified. Maximum value is 50
                filters:
                  type: object
                  description: >-
                    Filters to narrow the search scope. For example, the search
                    can be limited to few CIKs only. Without filters, search
                    will be performed across all the filings
                  properties:
                    types:
                      type: array
                      items:
                        type: string
                        enum:
                          - earnings-transcript
                          - 10-K
                      description: >-
                        The type of filings to include in the search. Choose
                        from 'earnings-transcript', '10-K'.
                    ciks:
                      type: array
                      items:
                        type: string
                        example: '0001045810'
                      maxItems: 100
                      description: >-
                        CIKs (Central Index Keys) of companies. Multiple CIKs
                        can be provided separated by commas. Each CIK should be
                        a 10-digit number (include leading zeros if necessary).
                        Get CIKs from [Company
                        Details](https://drive.google.com/file/d/1XQh20CTDEn_uFhRArOQm9jkVesnSkSTI/view).
                    sectors:
                      type: array
                      items:
                        type: string
                      maxItems: 5
                      description: >-
                        Sector classification of the companies. Multiple values
                        can be provided separated by commas. Get valid sector
                        values from [Company
                        Details](https://drive.google.com/file/d/1XQh20CTDEn_uFhRArOQm9jkVesnSkSTI/view).
                    industries:
                      type: array
                      items:
                        type: string
                      maxItems: 5
                      description: >-
                        Industry classification of the companies. Multiple
                        values can be provided separated by commas. Check valid
                        industry values from [Company
                        Details](https://drive.google.com/file/d/1XQh20CTDEn_uFhRArOQm9jkVesnSkSTI/view)
                    years:
                      type: array
                      items:
                        type: string
                        pattern: ^[0-9]{4}$
                      description: >-
                        Fiscal year values in the format YYYY (e.g., 2024,
                        2023). Multiple values can be provided separated by
                        commas. Use this parameter to filter data by specific
                        years.
                    quarters:
                      type: array
                      items:
                        type: string
                        enum:
                          - Q1
                          - Q2
                          - Q3
                          - Q4
                        example: Q4
                      description: >-
                        Fiscal quarter values in the format Q1, Q2, Q3, Q4.
                        Multiple values can be provided separated by commas. Use
                        this parameter to filter by specific quarters.
      responses:
        '200':
          description: >-
            Successful response. Contains the list of chunks for given query
            vector
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status code
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/DocumentChunkWithScore'
              examples:
                example1:
                  value:
                    status: success
                    data:
                      - text: >-
                          It's Second, we laid the foundation to be a three-chip
                          data center scale computing company with GPUs, DPUs
                          and CPUs. Third, AI is the most powerful technology
                          force of our time. We partner with cloud and consumer
                          Internet companies to scale out and commercialize
                          AI-powered services. And we're democratizing AI for
                          every enterprise and every industry.
                        metadata:
                          chunk_num: '18'
                        document:
                          type: earnings-transcript
                          published_date: '2021-05-27T01:40:47.000Z'
                          year: '2022'
                          quarter: Q1
                          link: >-
                            https://stockinsights.ai/us/filings/earnings-transcript/64428b8954ef6b435cdc137c/content
                        company:
                          company_name: Nvidia Corp
                          ticker: NVDA
                          cik: '0001045810'
                        similarity_score: 0.9295221567153931
                      - text: >-
                          And we containerize them into our stack. We call it
                          NVIDIA AI Enterprise. And the way we go to market with
                          it is that think of that NVIDIA AI Enterprise now as a
                          run time like an operating system, it's an operating
                          system for artificial intelligence.
                        metadata:
                          chunk_num: '16'
                        document:
                          type: earnings-transcript
                          published_date: '2024-02-22T10:58:00.000Z'
                          year: '2024'
                          quarter: Q4
                          link: >-
                            https://stockinsights.ai/us/filings/earnings-transcript/65d811ca8ac10234b0fbd253/content
                        company:
                          id: epPs1xy7IL
                          company_name: Nvidia Corp
                          ticker: NVDA
                          cik: '0001045810'
                        similarity_score: 0.9289319515228271
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    DocumentChunkWithScore:
      allOf:
        - $ref: '#/components/schemas/DocumentChunk'
        - type: object
          properties:
            similarity_score:
              type: number
              description: Similarity score
    Error:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              status:
                type: string
                description: Error status
              title:
                type: string
                description: Error description
    DocumentChunk:
      type: object
      properties:
        text:
          type: string
          description: The chunk's text
        metadata:
          type: object
          properties:
            chunk_num:
              type: string
              description: Identifier of the chunk in the document
        document:
          type: object
          properties:
            type:
              type: string
              description: Filing type
            published_date:
              type: string
              format: date-time
              description: Filing date
            year:
              type: string
              description: Year of the filing
            quarter:
              type: string
              enum:
                - Q1
                - Q2
                - Q3
                - Q4
              description: Quarter of the filing
            link:
              type: string
              description: URL of the document
        company:
          type: object
          properties:
            id:
              type: string
              description: Internal representation of ID
            company_name:
              type: string
              description: Company Name
            ticker:
              type: string
              description: Internal ticker of the company
            cik:
              type: string
              description: CIK of the company
              example: '0001045810'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````