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

# Get a variant

> Get the variant that would be picked for a given user ID.  This is useful for debugging.  Note that this assumes all traffic is routed to the experiment.



## OpenAPI

````yaml /api-reference/5.9/fusion-api-query.json get /experiments/{id}/variant
openapi: 3.0.1
info:
  title: Fusion Query API
  description: >-
    A Lucidworks Fusion microservice for machine-learning-enhanced ranking and
    retrieval.
  contact:
    name: Lucidworks
    url: www.lucidworks.com
    email: support@lucidworks.com
  license:
    name: License of API
    url: https://lucidworks.com/legal/developer-license-agreement/
  version: '5.9'
servers:
  - url: https://{FUSION HOST}/api
    description: Fusion
    variables:
      FUSION HOST:
        default: FUSION_HOST
        description: Your environment host.
  - url: https://{FUSION HOST}/api/apps/{APP_NAME}
    description: Fusion app
    variables:
      FUSION HOST:
        default: FUSION_HOST
        description: Your environment host.
      APP_NAME:
        default: APP_NAME
        description: The name of your Fusion app.
security:
  - Basic auth: []
  - API key: []
tags:
  - name: Custom Rule Type API
    description: Endpoints to define and manage custom rule type definitions.
  - name: Experiments API
    description: >-
      Use the Experiments API to compare different configuration variants and
      determine which ones are most successful.
  - name: Query Pipelines API
    description: >-
      Use these endpoints to view and manage your query pipelines.  You can also
      send queries using this API, though the Query Profiles API is recommended
      instead.
  - name: Query Profiles API
    description: >-
      The Query Profiles API provides static endpoints that you can consistently
      point to when querying your collections.  Query profiles allow you to
      change the query pipelines or collections behind them without changing the
      endpoint you use for your search queries.  See the Query Profiles CRUD API
      for endpoints that create and modify query profiles.
  - name: Query Profiles CRUD API
    description: >-
      Use these endpoints to create and modify query profiles.  Query profiles
      allow you to change the query pipelines or collections behind them without
      changing the endpoint you use for your search queries.  See the Query
      Profiles API for the query endpoints.
  - name: Query Rewrite API
    description: >-
      The Query Rewrite API manages documents used for query rewriting to
      improve relevancy using AI-generated data. Primarily for internal use.
  - name: Query Stage API
    description: >-
      Use these endpoints to view the available query pipeline stages and their
      configuration parameters.
  - name: Query Stage Plugins API
    description: >-
      Use these endpoints to view, install, and manage custom query stages
      developed with the Query Stage SDK.
  - name: Signal Indexing API
    description: Endpoints to index signals.
  - name: Experience Manager API
    description: API only for internal use by the Experience Manager Springboard system
  - name: Query Pipeline Template API
    description: Used internally to generate query pipelines from a template.
externalDocs:
  description: Lucidworks Documentation.
  url: https://doc.lucidworks.com/
paths:
  /experiments/{id}/variant:
    get:
      tags:
        - Experiments API
      summary: Get a variant
      description: >-
        Get the variant that would be picked for a given user ID.  This is
        useful for debugging.  Note that this assumes all traffic is routed to
        the experiment.
      operationId: getVariant
      parameters:
        - name: id
          description: >-
            The ID of the experiment from which to pick a variant.  Use
            `/experiments` to get experiment IDs.
          in: path
          required: true
          schema:
            type: string
        - name: userId
          description: >-
            The name of the field containing the user ID for which to pick a
            variant.
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExperimentVariant'
components:
  schemas:
    ExperimentVariant:
      type: object
      properties:
        id:
          description: The experiment variant ID.
          type: string
        name:
          description: The experiment variant name.
          type: string
        collection:
          description: The data collection associated with this experiment variant.
          type: string
        queryPipeline:
          description: The query pipeline associated with this experiment variant.
          type: string
        params:
          type: array
          items:
            $ref: '#/components/schemas/ParamAndValue'
        weight:
          description: This variant's traffic weight.
          type: number
          format: double
    ParamAndValue:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
        policy:
          type: string
          enum:
            - replace
            - append
            - remove
            - default
  securitySchemes:
    Basic auth:
      type: http
      scheme: basic
    API key:
      name: x-api-key
      type: apiKey
      in: header

````