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

# Retrieve timeseries of an A/B test

> Retrieves timeseries for an A/B test by its ID.

**Required ACL:** `analytics`


## OpenAPI

````yaml specs/abtesting-v3.yml get /3/abtests/{id}/timeseries
openapi: 3.1.0
info:
  title: A/B Testing API
  summary: >-
    The Algolia A/B Testing API lets you manage your Algolia A/B tests to
    optimize your search experience
  description: >
    ## Base URLs


    Base URLs for the A/B testing API:


    - `https://analytics.us.algolia.com`

    - `https://analytics.de.algolia.com`

    - `https://analytics.algolia.com` (routes requests to the closest of the
    above servers, based on your geographical location)


    Use the URL that matches your [analytics
    region](https://dashboard.algolia.com/account/infrastructure/analytics).


    **All requests must use HTTPS.**


    ## Availability and authentication


    Access to the A/B testing API is available as part of the [Premium or
    Elevate plans](https://www.algolia.com/pricing).


    Add these headers to authenticate requests:


    - `x-algolia-application-id`. Your Algolia application ID.

    - `x-algolia-api-key`. An API key with the necessary permissions to make the
    request.
      The required access control list (ACL) to make a request is listed in each endpoint's reference.

    You can find your application ID and API key in the [Algolia
    dashboard](https://dashboard.algolia.com/account/api-keys).


    ## Rate limits


    You can make up to **100 requests per minute per app** to the A/B testing
    API.

    The response includes headers with information about the limits.


    ## Parameters


    Query parameters must be
    [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding).

    Non-ASCII characters must be UTF-8 encoded.

    Plus characters (`+`) are interpreted as spaces.


    ## Response status and errors


    The A/B testing API returns JSON responses.

    Since JSON doesn't guarantee any specific ordering, don't rely on the order
    of attributes in the API response.


    Successful responses return `2xx` statuses. Client errors return `4xx`
    statuses. Server errors return `5xx` statuses.

    Error responses have a `message` property with more information.


    ## Version


    The current version of the A/B Testing API is version 3, indicated by the
    `/3/` in each endpoint's URL.
  version: 3.0.0
servers:
  - url: https://analytics.{region}.algolia.com
    variables:
      region:
        enum:
          - us
          - de
        default: us
  - url: https://analytics.algolia.com
security:
  - appId: []
    apiKey: []
tags:
  - name: abtest
    x-displayName: A/B testing
    description: >
      Manage A/B tests.


      A/B tests are configurations one or more indices, usually your production
      index and an index with different settings that you want to test.
externalDocs:
  url: https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing
  description: A/B testing.
paths:
  /3/abtests/{id}/timeseries:
    get:
      tags:
        - abtest
      summary: Retrieve timeseries of an A/B test
      description: Retrieves timeseries for an A/B test by its ID.
      operationId: getTimeseries
      parameters:
        - $ref: '#/components/parameters/ID'
        - $ref: '#/components/parameters/EndDate'
        - in: query
          name: metric
          description: >-
            List of metrics to retrieve. If not specified, all metrics are
            returned.
          schema:
            type: array
            items:
              $ref: '#/components/schemas/MetricName'
        - $ref: '#/components/parameters/StartDate'
      responses:
        '200':
          description: OK
          headers:
            x-ratelimit-limit:
              $ref: '#/components/headers/x-ratelimit-limit'
            x-ratelimit-remaining:
              $ref: '#/components/headers/x-ratelimit-remaining'
            x-ratelimit-reset:
              $ref: '#/components/headers/x-ratelimit-reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Timeseries'
        '400':
          $ref: '#/components/responses/BadRequest'
        '402':
          $ref: '#/components/responses/FeatureNotEnabled'
        '403':
          $ref: '#/components/responses/MethodNotAllowed'
        '404':
          $ref: '#/components/responses/IndexNotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |-
            // Initialize the client
            var client = new AbtestingV3Client(
              new AbtestingV3Config(
                "ALGOLIA_APPLICATION_ID",
                "ALGOLIA_API_KEY",
                "ALGOLIA_APPLICATION_REGION"
              )
            );

            // Call the API
            var response = await client.GetTimeseriesAsync(42);

            // print the response
            Console.WriteLine(response);
        - lang: dart
          label: Dart
          source: |-
            // Initialize the client
            final client = AbtestingV3Client(
                appId: 'ALGOLIA_APPLICATION_ID',
                apiKey: 'ALGOLIA_API_KEY',
                region: 'ALGOLIA_APPLICATION_REGION');

            // Call the API
            final response = await client.getTimeseries(
              id: 42,
            );

            // print the response
            print(response);
        - lang: go
          label: Go
          source: >-
            // Initialize the client with your application region, eg.
            abtestingV3.ALGOLIA_APPLICATION_REGION

            client, err := abtestingV3.NewClient("ALGOLIA_APPLICATION_ID",
            "ALGOLIA_API_KEY", abtestingV3.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            response, err :=
            client.GetTimeseries(client.NewApiGetTimeseriesRequest(
              42))
            if err != nil {
              // handle the eventual error
              panic(err)
            }



            // print the response

            print(response)
        - lang: java
          label: Java
          source: >-
            // Initialize the client

            AbtestingV3Client client = new
            AbtestingV3Client("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY",
            "ALGOLIA_APPLICATION_REGION");


            // Call the API

            Timeseries response = client.getTimeseries(42);


            // print the response

            System.out.println(response);
        - lang: javascript
          label: JavaScript
          source: >-
            // Initialize the client

            // Replace 'us' with your Algolia Application Region

            const client = algoliasearch('ALGOLIA_APPLICATION_ID',
            'ALGOLIA_API_KEY').initAbtestingV3({ region: 'us' });


            // Call the API

            const response = await client.getTimeseries({ id: 42 });



            // print the response

            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: |-
            // Initialize the client
            val client =
              AbtestingV3Client(
                appId = "ALGOLIA_APPLICATION_ID",
                apiKey = "ALGOLIA_API_KEY",
                region = "ALGOLIA_APPLICATION_REGION",
              )

            // Call the API
            var response = client.getTimeseries(id = 42)


            // print the response
            println(response)
        - lang: php
          label: PHP
          source: >-
            // Initialize the client

            $client = AbtestingV3Client::create('ALGOLIA_APPLICATION_ID',
            'ALGOLIA_API_KEY', 'ALGOLIA_APPLICATION_REGION');


            // Call the API

            $response = $client->getTimeseries(
                42,
            );



            // print the response

            var_dump($response);
        - lang: python
          label: Python
          source: >-
            # Initialize the client

            # In an asynchronous context, you can use AbtestingV3Client instead,
            which exposes the exact same methods.

            client = AbtestingV3ClientSync(
                "ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION"
            )


            # Call the API

            response = client.get_timeseries(
                id=42,
            )



            # print the response

            print(response)
        - lang: ruby
          label: Ruby
          source: >-
            # Initialize the client

            client = Algolia::AbtestingV3Client.create("ALGOLIA_APPLICATION_ID",
            "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")


            # Call the API

            response = client.get_timeseries(42)



            # print the response

            puts(response)
        - lang: scala
          label: Scala
          source: |-
            // Initialize the client
            val client = AbtestingV3Client(
              appId = "ALGOLIA_APPLICATION_ID",
              apiKey = "ALGOLIA_API_KEY",
              region = Option("ALGOLIA_APPLICATION_REGION")
            )

            // Call the API
            val response = Await.result(
              client.getTimeseries(
                id = 42
              ),
              Duration(100, "sec")
            )

            // print the response
            println(response)
        - lang: swift
          label: Swift
          source: >-
            // Initialize the client

            let client = try AbtestingV3Client(appID: "ALGOLIA_APPLICATION_ID",
            apiKey: "ALGOLIA_API_KEY", region: .us)


            // Call the API

            let response = try await client.getTimeseries(id: 42)


            // print the response

            print(response)
        - lang: cURL
          label: curl
          source: |-
            curl --request GET \
              --url 'https://analytics.us.algolia.com/3/abtests/224/timeseries?startDate=2022-09-19&endDate=2023-01-21&metric=search_count' \
              --header 'accept: application/json' \
              --header 'x-algolia-api-key: ALGOLIA_API_KEY' \
              --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID'
components:
  parameters:
    ID:
      in: path
      name: id
      description: Unique A/B test identifier.
      required: true
      schema:
        $ref: '#/components/schemas/abTestID'
    EndDate:
      in: query
      name: endDate
      description: End date of the period to analyze, in `YYYY-MM-DD` format.
      schema:
        type: string
        example: '2023-01-21'
    StartDate:
      in: query
      name: startDate
      description: Start date of the period to analyze, in `YYYY-MM-DD` format.
      schema:
        type: string
        example: '2022-09-19'
  schemas:
    MetricName:
      type: string
      enum:
        - search_count
        - tracked_search_count
        - user_count
        - tracked_user_count
        - no_result_count
        - add_to_cart_count
        - purchase_count
        - clicked_search_count
        - converted_search_count
        - click_through_rate
        - conversion_rate
        - add_to_cart_rate
        - purchase_rate
        - average_click_position
        - revenue
    Timeseries:
      type: object
      additionalProperties: false
      properties:
        abTestID:
          $ref: '#/components/schemas/abTestID'
        variants:
          $ref: '#/components/schemas/timeseriesVariants'
      required:
        - abTestID
        - variants
    abTestID:
      type: integer
      description: Unique A/B test identifier.
      example: 224
    timeseriesVariants:
      type: array
      description: >
        A/B test timeseries variants.


        The first variant is your _control_ index, typically your production
        index.

        All of the additional variants are indexes with changed settings that
        you want to test against the control.
      items:
        $ref: '#/components/schemas/timeseriesVariant'
    ErrorBase:
      description: Error.
      type: object
      x-keep-model: true
      additionalProperties: true
      properties:
        message:
          type: string
          example: Invalid Application-Id or API-Key
    timeseriesVariant:
      type: object
      properties:
        dates:
          $ref: '#/components/schemas/metricDates'
    metricDates:
      type: array
      items:
        $ref: '#/components/schemas/metricDate'
    metricDate:
      type: object
      properties:
        date:
          type: string
          description: Date where the metric was updated, in RFC 3339 format.
          example: '2025-06-15'
        metrics:
          $ref: '#/components/schemas/metrics'
    metrics:
      type: array
      description: All ABTest metrics that were defined during test creation.
      items:
        $ref: '#/components/schemas/metricResult'
    metricResult:
      type: object
      properties:
        name:
          type: string
        pValue:
          type: number
          format: double
          description: >-
            PValue for the first variant (control) will always be 0. For the
            other variants, pValue is calculated for the current variant based
            on the control.
        updatedAt:
          type: string
          description: Date and time when the metric was last updated, in RFC 3339 format.
        value:
          type: number
          format: double
        criticalValue:
          type: number
          format: double
          description: >
            The value that was computed during error correction. It is used to
            determine significance of the metric pValue.

            The critical value is calculated using Bonferroni or
            Benjamini-Hochberg corrections, based on the given

            configuration during the A/B test creation.
        dimension:
          type: string
          description: Dimension defined during test creation.
        metadata:
          $ref: '#/components/schemas/metricMetadata'
        significant:
          type: boolean
          description: >
            Whether the pValue is significant or not based on the critical value
            and the error correction algorithm used.
        valueCIHigh:
          type: number
          format: double
          description: >
            The upper bound of the 95% confidence interval for the metric value.
            The confidence interval is calculated using

            either the relative ratio or relative difference between the metric
            values for the control and the variant.

            Relative ratio is used for metrics that are ratios (e.g.,
            click-through rate, conversion rate),

            while relative difference is used for continuous metrics (e.g.,
            revenue).
        valueCILow:
          type: number
          format: double
          description: >
            The lower bound of the 95% confidence interval for the metric value.
            The confidence interval is calculated using

            either the relative ratio or relative difference between the metric
            values for the control and the variant.

            Relative ratio is used for metrics that are ratios (e.g.,
            click-through rate, conversion rate),

            while relative difference is used for continuous metrics (e.g.,
            revenue).
      required:
        - name
        - updatedAt
        - value
        - pValue
      example:
        - name: addToCartCount
          updatedAt: '2025-06-15T15:06:44.400601Z'
          value: 5
          pValue: 0.01
        - name: clickThroughRate
          updatedAt: '2025-05-15T17:52:15.644906Z'
          value: 0.20869847452125934
          pValue: 0.004
        - name: revenue
          dimension: USD
          updatedAt: '2025-05-15T17:52:15.644906Z'
          value: 1200.5
          pValue: 0.04
          metadata:
            winsorizedValue: 80.2
        - name: revenue
          dimension: EUR
          updatedAt: '2025-05-15T17:52:15.644906Z'
          value: 999.66
          pValue: 0.04
          metadata:
            winsorizedValue: 888.8
    metricMetadata:
      type: object
      description: Metric specific metadata.
      properties:
        mean:
          type: number
          format: double
          description: Mean value for this metric.
          example: 53.7
        winsorizedValue:
          type: number
          format: double
          description: >
            Only present in case the metric is 'revenue'.

            It is the amount exceeding the 95th percentile of global revenue
            transactions involved in the AB Test. This amount is not considered
            when calculating statistical significance.

            It is tied to a per revenue-currency pair contrary to other

            global filter effects (such as outliers and empty search count).
      example:
        winsorizedValue: 888.8
        mean: 53.7
  headers:
    x-ratelimit-limit:
      description: Number of allowed requests per one minute.
      example: 100
      schema:
        type: integer
    x-ratelimit-remaining:
      description: Number of remaining requests in the current period.
      example: 99
      schema:
        type: integer
    x-ratelimit-reset:
      description: >-
        Timestamp when the rate limit will reset, measured in seconds since the
        Unix epoch.
      example: 1710682486
      schema:
        type: integer
  responses:
    BadRequest:
      description: Bad request or request arguments.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBase'
    FeatureNotEnabled:
      description: This feature is not enabled on your Algolia account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBase'
    MethodNotAllowed:
      description: Method not allowed with this API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBase'
    IndexNotFound:
      description: Index not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBase'
    UnprocessableEntity:
      description: Unprocessable Entity.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBase'
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: x-algolia-application-id
      description: Your Algolia application ID.
    apiKey:
      type: apiKey
      in: header
      name: x-algolia-api-key
      description: >
        Your Algolia API key with the necessary permissions to make the request.

        Permissions are controlled through access control lists (ACL) and access
        restrictions.

        The required ACL to make a request is listed in each endpoint's
        reference.

````