The generated API clients are a work in progress, you can also find our stable clients on the Algolia documentation.

Skip to main content

A/B Testing API (1.0.0)

Download OpenAPI specification:Download

API powering the A/B Testing feature of Algolia.

A/B Testing

Manage A/B Tests.

Create a test

Creates a new A/B test with provided configuration. You can set an A/B test on two different indices with different settings, or on the same index with different search parameters by providing a customSearchParameters setting on one of the variants.

Authorizations:
(appIdapiKey)
Request Body schema: application/json
name
required
string (name)

A/B test name.

required
Array of abTestsVariant (object) or abTestsVariantSearchParams (object) (AddABTestsVariant) = 2 items

List of 2 variants for the A/B test.

endAt
required
string (endAt)

End date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "variant": [
    ],
  • "endAt": "string"
}

Response samples

Content type
application/json
{
  • "index": "string",
  • "abTestID": 0,
  • "taskID": 0
}

List all tests

Fetch all existing A/B tests for App that are available for the current API Key. When no data has been processed, the metrics will be returned as null.

Authorizations:
(appIdapiKey)
query Parameters
offset
integer
Default: 0

Position of the starting record. Used for paging. 0 is the first record.

limit
integer
Default: 10

Number of records to return. Limit is the size of the page.

indexPrefix
string

Filters the returned ab tests by any indices starting with the provided prefix that are assigned to either variant of an ab test.

indexSuffix
string

Filters the returned ab tests by any indices ending with the provided suffix that are assigned to either variant of an ab test.

Responses

Response samples

Content type
application/json
{
  • "abtests": [
    ],
  • "count": 0,
  • "total": 0
}

Get a test

Returns metadata and metrics for an A/B test.

Authorizations:
(appIdapiKey)
path Parameters
id
required
integer

The A/B test ID.

Responses

Response samples

Content type
application/json
{
  • "abTestID": 0,
  • "clickSignificance": 0,
  • "conversionSignificance": 0,
  • "endAt": "string",
  • "updatedAt": "string",
  • "createdAt": "string",
  • "name": "string",
  • "status": "string",
  • "variants": [
    ]
}

Delete a test

Delete a test.

Authorizations:
(appIdapiKey)
path Parameters
id
required
integer

The A/B test ID.

Responses

Response samples

Content type
application/json
{
  • "index": "string",
  • "abTestID": 0,
  • "taskID": 0
}

Stop a test

Marks the A/B test as stopped. At this point, the test is over and cannot be restarted. As a result, your application is back to normal: index A will perform as usual, receiving 100% of all search requests. Associated metadata and metrics are still stored.

Authorizations:
(appIdapiKey)
path Parameters
id
required
integer

The A/B test ID.

Responses

Response samples

Content type
application/json
{
  • "index": "string",
  • "abTestID": 0,
  • "taskID": 0
}