---
title: "Get an A/B test"
method: GET
path: "/v1/sites/{site_id}/widgets/ab-tests/{test_id}"
tags: ["Widgets"]
---

# Get an A/B test

`GET /v1/sites/{site_id}/widgets/ab-tests/{test_id}`

## Request

- Base URL: `https://api.getsitecontrol.com`
- URL: `https://api.getsitecontrol.com/v1/sites/{site_id}/widgets/ab-tests/{test_id}`
- Auth: HTTP bearer

One A/B test as List A/B tests gives it. `findings` are facts about the test setup: widgets whose targeting differs (pages, audience, devices, schedule, trigger, frequency), switches after the results started counting, one widget on, a widget without views and what its settings show; tell the user each one with what to do. The widget card's `ab_test_group.id` is the test id.

## Path parameters

- `site_id` integer, required
- `test_id` integer, required: A/B test id from List A/B tests

## Response `200`

Successful Response

- WidgetAbTestDetail
  - `id` integer, required
  - `name` string, required: The admin's slot, shown there as Test 1 … Test 5
  - `leader_id` integer, required: The widget ahead: the highest CTR, ties to the first listed; the one Stop keeps unless told otherwise
  - `widgets` WidgetAbTestWidget[], required: In the admin's order; at least one. Visitors are split evenly between the widgets that are on
    - `id` integer, required
    - `name` string, nullable
    - `is_active` boolean, required: An off widget stays in the test but is not shown; a test shows its widgets that are on
    - `added_at` string, date-time, required: Results counted from: when the widget joined the test or the results were last reset
    - `total` object, required: Counts by event type since `added_at`: `show` (views) and every action the widget has now — `submit` (forms sent), `openUrl`, `showWidget`, `addToCart`, `applyCoupon`, `copyToClipboard` (button clicks); only the keys the widget has
    - `views` integer, required: Times the widget was shown since `added_at`; `total.show`. The admin's Views
    - `actions` integer, required: Forms sent and buttons used since `added_at`: every key of `total` but `show`, summed. The admin's Actions
    - `ctr` number, required: `actions` / `views` as a fraction, the admin's CTR rounded half up to 4 places (0.0325 is 3.25%); 0 while there are no views
  - `findings` WidgetAbTestFinding[], required: Facts the server worked out about the test: targeting that differs between the widgets, one widget on, on/off switches since `added_at`, a widget without views; empty when there is nothing to say
    - `kind` 'targeting_differs' | 'single_widget_on' | 'none_on' | 'switched' | 'no_switch_history' | 'no_views', required: targeting_differs: the widgets differ in the targeting block named in detail; single_widget_on: only one widget of the test is on, every visitor gets it; none_on: no widget of the test is on, the test shows nothing; switched: the widget was turned off or on after its results started counting; no_switch_history: the widget's results count from before on/off history was kept, so switches before that are unknown; no_views: the widget has no views since added_at, detail says what its settings show.
    - `widget_ids` integer[], required: The widgets the finding is about
    - `detail` string, required: One short sentence with the facts, in the user's terms; wording is not stable, do not parse

## Other responses

- `400`: Unsupported GSC-Version
- `401`: Missing or invalid API key or access token
- `403`: Access denied
- `404`: `ab_test_not_found`: the site has no such test, or it was stopped
- `422`: Validation failed
- `429`: Rate limited
- `503`: Temporarily unavailable; retry later

---

[API](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api.md) - [All operations](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api/revisions/084fcad80e75?raw)
