Skip to main content
An updated version of the A/B testing API (v3) is available. For differences, compatibility, and migration guidance, see A/B testing API v2 vs v3.
  • C#
  • Go
  • Java
  • JavaScript
  • Kotlin
  • PHP
  • Python
  • Ruby
  • Scala
  • Swift
The A/B testing API client is part of the Algolia.Search package. To install this package, run:
dotnet add package Algolia.Search
To use the A/B testing client, import these namespaces:
C#
using Algolia.Search.Clients;
using Algolia.Search.Http;
using Algolia.Search.Models.Abtesting;
To create an instance of the client:
C#
var client = new AbtestingClient(
  new AbtestingConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")
);
Replace ALGOLIA_APPLICATION_REGION with your Algolia application’s analytics region: us for the United States or de for Europe. You can check your analytics region in the Infrastructure > Analytics section of the Algolia dashboard.

Analytics region

The A/B testing API client requires specifying your Algolia application’s analytics region to properly route requests to the correct data center. Replace ALGOLIA_APPLICATION_REGION with your application’s analytics region:
  • us for the United States
  • de for Europe
You can check your analytics region in the Infrastructure > Analytics section of the Algolia dashboard.
I