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

# Compendium Search

> Create or submit compendium search via the Junction API. Requires authentication with your team API key.

<Card horizontal icon="person-digging" color="#57164A">
  This feature is in **closed beta**.

  Interested in this feature? Get in touch with your Customer Success Manager.
</Card>


## OpenAPI

````yaml POST /v3/compendium/search
openapi: 3.1.0
info:
  title: Junction API
  description: https://docs.junction.com/
  version: 0.4.483
servers:
  - url: https://api.us.junction.com
    x-fern-server-name: Production
  - url: https://api.eu.junction.com
    x-fern-server-name: ProductionEU
  - url: https://api.sandbox.us.junction.com
    x-fern-server-name: Sandbox
  - url: https://api.sandbox.eu.junction.com
    x-fern-server-name: SandboxEU
security:
  - apiKeyAuth: []
paths:
  /v3/compendium/search:
    post:
      tags:
        - compendium
      summary: Search Compendium
      operationId: search_compendium_v3_compendium_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchCompendiumBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchCompendiumResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SearchCompendiumBody:
      properties:
        mode:
          $ref: '#/components/schemas/SearchMode'
          description: ℹ️ This enum is non-exhaustive.
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
        cpt_codes:
          items:
            type: string
          type: array
          title: Cpt Codes
        loinc_set_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Loinc Set Hash
        labs:
          anyOf:
            - items:
                $ref: '#/components/schemas/CompendiumSearchLabs'
              type: array
            - type: 'null'
          title: Labs
        include_related:
          type: boolean
          title: Include Related
          default: true
        limit:
          type: integer
          title: Limit
          default: 3
      type: object
      required:
        - mode
      title: SearchCompendiumBody
    SearchCompendiumResponse:
      properties:
        mode:
          $ref: '#/components/schemas/SearchMode'
          description: ℹ️ This enum is non-exhaustive.
        selected_canonical:
          anyOf:
            - $ref: '#/components/schemas/CanonicalCandidate'
            - type: 'null'
        canonical_candidates:
          items:
            $ref: '#/components/schemas/CanonicalCandidate'
          type: array
          title: Canonical Candidates
        per_lab:
          additionalProperties:
            items:
              $ref: '#/components/schemas/PerLabCandidate'
            type: array
          type: object
          title: Per Lab
        related:
          items:
            $ref: '#/components/schemas/RelatedCandidate'
          type: array
          title: Related
      type: object
      required:
        - mode
      title: SearchCompendiumResponse
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
    SearchMode:
      type: string
      enum:
        - canonical
        - crosswalk
      title: SearchMode
      description: ℹ️ This enum is non-exhaustive.
    CompendiumSearchLabs:
      type: string
      enum:
        - labcorp
        - quest
        - bioreference
        - sonora_quest
      title: CompendiumSearchLabs
      description: ℹ️ This enum is non-exhaustive.
    CanonicalCandidate:
      properties:
        loinc_set_hash:
          type: string
          title: Loinc Set Hash
        display_name:
          type: string
          title: Display Name
        aliases:
          items:
            type: string
          type: array
          title: Aliases
        loinc_codes:
          items:
            type: string
          type: array
          title: Loinc Codes
        provider_ids:
          items:
            type: string
          type: array
          title: Provider Ids
        loinc_components:
          items:
            type: string
          type: array
          title: Loinc Components
        loinc_groups:
          items:
            type: string
          type: array
          title: Loinc Groups
        cpt_codes:
          items:
            type: string
          type: array
          title: Cpt Codes
        popularity_score:
          type: number
          title: Popularity Score
        confidence:
          type: number
          title: Confidence
      type: object
      required:
        - loinc_set_hash
        - display_name
        - popularity_score
        - confidence
      title: CanonicalCandidate
    PerLabCandidate:
      properties:
        marker_id:
          type: integer
          title: Marker Id
        lab_id:
          type: integer
          title: Lab Id
        lab_slug:
          anyOf:
            - type: string
            - type: 'null'
          title: Lab Slug
        name:
          type: string
          title: Name
        result_names:
          items:
            type: string
          type: array
          title: Result Names
        provider_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Id
        loinc_set_hash:
          type: string
          title: Loinc Set Hash
        loinc_codes:
          items:
            type: string
          type: array
          title: Loinc Codes
        loinc_components:
          items:
            type: string
          type: array
          title: Loinc Components
        loinc_groups:
          items:
            type: string
          type: array
          title: Loinc Groups
        cpt_codes:
          items:
            type: string
          type: array
          title: Cpt Codes
        relation:
          type: string
          title: Relation
        confidence:
          type: number
          title: Confidence
        reason_codes:
          items:
            type: string
          type: array
          title: Reason Codes
        marker_popularity_score:
          type: number
          title: Marker Popularity Score
      type: object
      required:
        - marker_id
        - lab_id
        - name
        - loinc_set_hash
        - relation
        - confidence
        - marker_popularity_score
      title: PerLabCandidate
    RelatedCandidate:
      properties:
        canonical:
          $ref: '#/components/schemas/CanonicalCandidate'
        relation:
          type: string
          title: Relation
        confidence:
          type: number
          title: Confidence
        reason_codes:
          items:
            type: string
          type: array
          title: Reason Codes
      type: object
      required:
        - canonical
        - relation
        - confidence
      title: RelatedCandidate
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````