# One A/B test and who is winning

> Eto API reference for `GET /api/v1/performance/tests/{test_id}`. Base URL `https://eto.tools/api/v1/`. Authenticate with the `X-Eto-API-Key` header.

Part of the [Eto API reference](https://eto.tools/dev/docs/). The full reference in one file is at [llms-full.txt](https://eto.tools/dev/docs/llms-full.txt); the machine-readable schema is at [openapi.json](https://eto.tools/dev/docs/openapi.json).

## GET /api/v1/performance/tests/{test_id}

One A/B test and who is winning

- Operation ID: `ab_test_detail`
- Slug: `ab-test-detail`
- Category: Performance
- Authentication: API key only. Reads or writes data Eto holds for your own account.
- HTML: https://eto.tools/dev/docs/#ep-ab-test-detail
- Markdown: https://eto.tools/dev/docs/performance/ab-test-detail.md

The test (with each listing's label, e.g. "Photo B") and the same comparison as listing_compare, lined up from the day the test started.

━━━ HOW THE NUMBERS ARE MADE ━━━

Every listing on every connected store is read every six hours (00:05, 06:05, 12:05, 18:05 UTC). Views and favourites are GAINS per day in your timezone (Etsy reports lifetime counters and tallies views once a day, so today's views are null until tomorrow). Units and revenue come from your synced orders at the price buyers actually paid; cancelled and fully refunded orders do not count. Conversion = units sold / views gained, only over days whose views are known. Money is integer cents in the listing's currency.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `test_id` | path | `integer` | yes | From ab_tests. |
| `period` | query | `string` | no | The window. Or pass start_date and end_date instead. Default: `30d`. One of: `24h`, `7d`, `30d`, `90d`, `1y`, `ytd`, `all`. |
| `start_date` | query | `string` | no | YYYY-MM-DD, inclusive. With end_date. |
| `end_date` | query | `string` | no | YYYY-MM-DD, inclusive. With start_date. |

### Request

```bash
curl -H "X-Eto-API-Key: eto_your_key" "https://eto.tools/api/v1/performance/tests/12"
```

```python
import requests

url = "https://eto.tools/api/v1/performance/tests/12"
headers = {"X-Eto-API-Key": "eto_your_key"}

response = requests.get(url, headers=headers, timeout=120)
response.raise_for_status()
print(response.json())
```

```javascript
const url = "https://eto.tools/api/v1/performance/tests/12";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "X-Eto-API-Key": "eto_your_key",
  },
});
if (!response.ok) throw new Error(`Eto API ${response.status}`);
const data = await response.json();
```

### Response

`application/json`. This endpoint has no worked response example in the registry yet; the [HTML reference](https://eto.tools/dev/docs/#ep-ab-test-detail) shows the fields it returns.

### Errors

Failures answer with the shared error body described in the Errors section: `{"error": {"code", "status", "message", "hint", "docs"}}`. Branch on `code`, not on the message.
