Aug 08, 2025
A/B testing API client (v3)
The A/B testing API client is part of the algoliasearch-client-go package.
To install it, run:
Copy
1
go get github.com/algolia/algoliasearch-client-go
To use the A/B testing client, add this import to your files:
Copy
1
import abtestingV3 "github.com/algolia/algoliasearch-client-go/v4/algolia/abtesting-v3"
To create an instance of the client:
Copy
1
2
3
4
5
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)
}
Make sure to use the region that matches your Algolia application’s analytics region:
abtesting.US for the United States or abtesting.DE for Europe.
You can check your analytics region in the Infrastructure > Analytics section of the Algolia dashboard.
List of methods
Each method makes one request to the A/B testing API.
A/B testing
| client.ListABTests | List all A/B tests |
| client.AddABTests | Create an A/B test |
| client.GetABTest | Retrieve A/B test details |
| client.DeleteABTest | Delete an A/B test |
| client.StopABTest | Stop an A/B test |
| client.ScheduleABTest | Schedule an A/B test |
| client.EstimateABTest | Estimate the sample size and duration of an A/B test |
| client.GetTimeseries | Retrieve timeseries of an A/B test |
Did you find this page helpful?