---
title: Get bandit results
description: "Get what a bandit's refreshes have learned: each arm's estimate and probability of being best from the latest saved refresh, and each arm's point estimate…"
breadcrumbs: Docs > API > Get bandit results
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Get bandit results

{% callout %}
This product or feature is not supported for the following sites: app.ddog-gov.com, us2.ddog-gov.com
{% /callout %}

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                                     |
| ----------------- | -------------------------------------------------------------------------------- |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/experiments/bandits/{bandit_id}/results     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/experiments/bandits/{bandit_id}/results |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/experiments/bandits/{bandit_id}/results |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/experiments/bandits/{bandit_id}/results      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/experiments/bandits/{bandit_id}/results |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/experiments/bandits/{bandit_id}/results |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/experiments/bandits/{bandit_id}/results |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/experiments/bandits/{bandit_id}/results      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/experiments/bandits/{bandit_id}/results  |

### Overview

Get what a bandit's refreshes have learned: each arm's estimate and probability of being best from the latest saved refresh, and each arm's point estimate over time. `filter[from]` and `filter[to]` narrow only `point_estimates`, not the latest estimates. For observation counts, use Get bandit traffic summary. Bandits must be enabled for the organization.

This endpoint requires the `product_analytics_experiments_read` permission.

OAuth apps require the `product_analytics_experiments_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#experiments) to access this endpoint.

### Arguments

#### Path Parameters

| Field                  | Type   | Description             |
| ---------------------- | ------ | ----------------------- |
| bandit_id [*required*] | string | The UUID of the bandit. |

#### Query Strings

| Field        | Type   | Description                                                                                     |
| ------------ | ------ | ----------------------------------------------------------------------------------------------- |
| filter[from] | string | Return only point estimates from refreshes saved at or after this RFC3339 timestamp. Inclusive. |
| filter[to]   | string | Return only point estimates from refreshes saved before this RFC3339 timestamp. Exclusive.      |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response containing a bandit's results.

| Parent field        | Field                                     | Type      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------- | ----------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                     | data [*required*]                         | object    | JSON:API resource containing a bandit's results.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| data                | attributes [*required*]                   | object    | What the bandit's refreshes have learned.                                                                                                                                                                                                                                                                                                                                                                                                                              |
| attributes          | confidence_level [*required*]             | double    | The probability mass of each confidence interval.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| attributes          | config_version [*required*]               | int64     | The configuration version the latest saved refresh used. It can be older than the bandit's, because changes such as a new end date don't invalidate results.                                                                                                                                                                                                                                                                                                           |
| attributes          | data_as_of [*required*]                   | date-time | The timestamp of the most recent warehouse data that the latest saved refresh read.                                                                                                                                                                                                                                                                                                                                                                                    |
| attributes          | desired_change [*required*]               | enum      | The direction the bandit optimizes the metric in. It's fixed when the bandit starts. `null` before the first saved refresh. Allowed enum values: `METRIC_INCREASES`, `METRIC_DECREASES`.                                                                                                                                                                                                                                                                               |
| attributes          | next_refresh_at [*required*]              | date-time | An estimate of when the next scheduled refresh starts. `null` when the bandit isn't running or the time can't be estimated. Only daily and hourly schedules get an estimate.                                                                                                                                                                                                                                                                                           |
| attributes          | optimal_variant_key [*required*]          | string    | The key of the arm most likely to be best, when one arm leads and the bandit is outside warmup. `null` otherwise.                                                                                                                                                                                                                                                                                                                                                      |
| attributes          | optimal_variant_unavailable_reason        | enum      | Why no optimal variant is reported. Absent when one is, or when the cause isn't known. Allowed enum values: `NO_RESULTS_YET`, `WARMUP`, `NOT_ENOUGH_DATA`, `NO_DIFFERENCE`, `STATS_UNAVAILABLE`.                                                                                                                                                                                                                                                                       |
| attributes          | point_estimates [*required*]              | [object]  | Each arm's point estimate from up to the latest 400 saved refreshes in the requested range, oldest first.                                                                                                                                                                                                                                                                                                                                                              |
| point_estimates     | confidence_interval [*required*]          | object    | A central interval around point_estimate at confidence_level.                                                                                                                                                                                                                                                                                                                                                                                                          |
| confidence_interval | lower [*required*]                        | double    | Lower bound of the interval.                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| confidence_interval | upper [*required*]                        | double    | Upper bound of the interval.                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| point_estimates     | data_as_of [*required*]                   | date-time | The timestamp of the most recent warehouse data that the refresh read.                                                                                                                                                                                                                                                                                                                                                                                                 |
| point_estimates     | feature_flag_variant_id [*required*]      | uuid      | The arm's variant ID on the flag.                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| point_estimates     | point_estimate [*required*]               | double    | The arm's estimated mean of the metric, in the metric's units.                                                                                                                                                                                                                                                                                                                                                                                                         |
| point_estimates     | refresh_id [*required*]                   | uuid      | The refresh the estimate comes from.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| point_estimates     | results_last_updated [*required*]         | date-time | When the refresh saved its results.                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| point_estimates     | variant_key [*required*]                  | string    | The arm's variant key.                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| attributes          | refresh_id [*required*]                   | uuid      | The latest refresh that saved results. The estimates come from it.                                                                                                                                                                                                                                                                                                                                                                                                     |
| attributes          | results_last_updated [*required*]         | date-time | When the latest saved refresh saved its results.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| attributes          | state [*required*]                        | enum      | `WAITING_FOR_FIRST_REFRESH` until a refresh saves results. `STATS_UNAVAILABLE` when the latest saved refresh has no complete probabilities of being optimal. `ENDED` after the bandit is stopped or completed, and its last estimates are kept. Otherwise, `WARMUP` or `OPTIMIZING` indicates which policy the bandit serves. A paused bandit keeps its state. Allowed enum values: `WAITING_FOR_FIRST_REFRESH`, `WARMUP`, `OPTIMIZING`, `STATS_UNAVAILABLE`, `ENDED`. |
| attributes          | statistics_status                         | enum      | Whether the latest saved refresh calculated its statistics. Absent for older refreshes. Allowed enum values: `calculated`, `failed`.                                                                                                                                                                                                                                                                                                                                   |
| attributes          | variants [*required*]                     | [object]  | One row per arm, in arm order.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| variants            | confidence_interval [*required*]          | object    | A central interval around point_estimate at confidence_level. `null` when the estimate is unavailable.                                                                                                                                                                                                                                                                                                                                                                 |
| confidence_interval | lower [*required*]                        | double    | Lower bound of the interval.                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| confidence_interval | upper [*required*]                        | double    | Upper bound of the interval.                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| variants            | data_status                               | enum      | Where the arm's reward variance came from, or why it's unavailable. Allowed enum values: `usable`, `insufficient_data`, `zero_variance`, `pooled_within_variance`, `pooled_total_variance`.                                                                                                                                                                                                                                                                            |
| variants            | feature_flag_variant_id [*required*]      | uuid      | The arm's variant ID on the flag.                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| variants            | mature_observations [*required*]          | int64     | The arm's valid observations whose aggregation window has closed. The estimate uses these.                                                                                                                                                                                                                                                                                                                                                                             |
| variants            | point_estimate [*required*]               | double    | The arm's estimated mean of the metric, in the metric's units. It isn't a lift.                                                                                                                                                                                                                                                                                                                                                                                        |
| variants            | posterior_unavailable_reason              | enum      | Why the arm's estimate and interval are unavailable. Absent when they are available. Allowed enum values: `no_data`, `insufficient_data`, `zero_variance`.                                                                                                                                                                                                                                                                                                             |
| variants            | probability_of_being_optimal [*required*] | double    | The probability that this arm is the best.                                                                                                                                                                                                                                                                                                                                                                                                                             |
| variants            | variant_key [*required*]                  | string    | The arm's variant key.                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| data                | id [*required*]                           | uuid      | The bandit ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| data                | type [*required*]                         | enum      | Bandit results resource type. Allowed enum values: `bandit-results`. Default: `bandit-results`.                                                                                                                                                                                                                                                                                                                                                                        |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "confidence_level": 0.95,
      "config_version": 2,
      "data_as_of": "2026-10-30T00:00:00Z",
      "desired_change": "METRIC_INCREASES",
      "next_refresh_at": "2026-10-31T02:00:00Z",
      "optimal_variant_key": "green",
      "optimal_variant_unavailable_reason": "NOT_ENOUGH_DATA",
      "point_estimates": [
        {
          "confidence_interval": {
            "lower": 39.9,
            "upper": 42.5
          },
          "data_as_of": "2026-10-30T00:00:00Z",
          "feature_flag_variant_id": "770e8400-e29b-41d4-a716-446655440001",
          "point_estimate": 41.2,
          "refresh_id": "bb0e8400-e29b-41d4-a716-446655440000",
          "results_last_updated": "2026-10-30T02:15:00Z",
          "variant_key": "blue"
        }
      ],
      "refresh_id": "bb0e8400-e29b-41d4-a716-446655440000",
      "results_last_updated": "2026-10-30T02:15:00Z",
      "state": "OPTIMIZING",
      "statistics_status": "calculated",
      "variants": [
        {
          "confidence_interval": {
            "lower": 39.9,
            "upper": 42.5
          },
          "data_status": "usable",
          "feature_flag_variant_id": "770e8400-e29b-41d4-a716-446655440001",
          "mature_observations": 4120,
          "point_estimate": 41.2,
          "posterior_unavailable_reason": "no_data",
          "probability_of_being_optimal": 0.08,
          "variant_key": "blue"
        }
      ]
    },
    "id": "4b1f3c2e-8d5a-4f6b-9c7e-1a2b3c4d5e6f",
    "type": "bandit-results"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Malformed bandit ID (not a valid UUID), or filter[from] or filter[to] isn't an RFC3339 timestamp, or filter[from] isn't before filter[to].

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="401" %}
Missing or invalid authentication (dd-api-key + dd-application-key headers, or a valid user session).

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Bandits are not enabled for the organization, or the caller lacks the product_analytics_experiments_read permission.

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
No bandit with this ID exists for the organization.

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export bandit_id="4b1f3c2e-8d5a-4f6b-9c7e-1a2b3c4d5e6f"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/experiments/bandits/${bandit_id}/results" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
