---
title: Get experiment results
description: "Get an experiment's computed results: per-variant statistical analysis for the latest successful run."
breadcrumbs: Documentation > API > Get experiment results
---

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

# Get experiment results

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

## v2 (latest)

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

### Overview

Get an experiment's computed results: per-variant statistical analysis for the latest successful run. A historical run cannot be selected. Unavailable analysis statistics, including `p_value` and `confidence_interval`, are omitted. The `numerator`, `denominator`, and `variant_metric_value` fields can be null when their values are unavailable. Do not treat an omitted or null value as zero. The response includes the selected run ID and, when recorded, EVSI forecast context and unavailable reasons for Bayesian analyses.

This endpoint requires the `product_analytics_experiments_read` permission.

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

### Arguments

#### Path Parameters

| Field                      | Type   | Description                 |
| -------------------------- | ------ | --------------------------- |
| experiment_id [*required*] | string | The UUID of the experiment. |

### Response

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

{% tabs %}
{% tab label="Model" %}
List of variant result resources.

| Parent field        | Field                            | Type      | Description                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------- | -------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                     | data [*required*]                | [object]  | Resources returned in this response.                                                                                                                                                                                                                                                                                                                                                                                             |
| data                | attributes                       | object    | Details of the variant result.                                                                                                                                                                                                                                                                                                                                                                                                   |
| attributes          | assignment_count                 | int64     | Number of subjects assigned to this variant.                                                                                                                                                                                                                                                                                                                                                                                     |
| attributes          | experiment_id                    | string    | ID of the experiment associated with this result.                                                                                                                                                                                                                                                                                                                                                                                |
| attributes          | is_control                       | boolean   | Whether this variant is the experiment's control.                                                                                                                                                                                                                                                                                                                                                                                |
| attributes          | metrics                          | [object]  | Metrics reported for this variant.                                                                                                                                                                                                                                                                                                                                                                                               |
| metrics             | analyses                         | [object]  | Statistical analyses calculated for this metric and variant.                                                                                                                                                                                                                                                                                                                                                                     |
| analyses            | confidence_interval              | object    | Lower and upper bounds of the reported statistical interval.                                                                                                                                                                                                                                                                                                                                                                     |
| confidence_interval | lower                            | double    | Lower bound of the reported interval.                                                                                                                                                                                                                                                                                                                                                                                            |
| confidence_interval | upper                            | double    | Upper bound of the reported interval.                                                                                                                                                                                                                                                                                                                                                                                            |
| analyses            | confidence_level                 | double    | Configured nominal confidence level. Interval bounds can use an adjusted level for multiple testing or hybrid methods.                                                                                                                                                                                                                                                                                                           |
| analyses            | evsi                             | double    | Expected value of sample information: expected reduction in minimum expected regret from additional data over the recorded horizon. Uses the analysis estimand units; relative lift is a fraction, not a percentage. Zero is a valid estimate. Omitted when unavailable or unrecorded.                                                                                                                                           |
| analyses            | evsi_future_se                   | double    | Standard error of the hypothetical additional-data estimate used for EVSI, in the same estimand units and CUPED setting. May be present when EVSI computation failed. Omitted when unavailable or unrecorded.                                                                                                                                                                                                                    |
| analyses            | evsi_unavailable_reason          | enum      | Recorded reason this analysis has no EVSI estimate. Omitted when unrecorded; absence does not establish availability for historical or imported results. Controls and non-Bayesian analyses omit this field. Allowed enum values: `traffic_unavailable`, `insufficient_complete_days`, `no_total_exposures`, `no_lookback_exposures`, `invalid_traffic`, `invalid_standard_error`, `computation_failed`, `analysis_unavailable`. |
| analyses            | expectation_above_zero           | double    | Expected effect when the effect is positive.                                                                                                                                                                                                                                                                                                                                                                                     |
| analyses            | expectation_below_zero           | double    | Expected effect when the effect is negative.                                                                                                                                                                                                                                                                                                                                                                                     |
| analyses            | global_lift                      | double    | Estimated lift across the population. Calculated as metric coverage multiplied by the experiment lift.                                                                                                                                                                                                                                                                                                                           |
| analyses            | global_lift_lower_bound          | double    | Lower bound of the estimated lift across the population.                                                                                                                                                                                                                                                                                                                                                                         |
| analyses            | global_lift_upper_bound          | double    | Upper bound of the estimated lift across the population.                                                                                                                                                                                                                                                                                                                                                                         |
| analyses            | is_cuped_adjusted                | boolean   | Whether CUPED used pre-experiment data to reduce variance in this result.                                                                                                                                                                                                                                                                                                                                                        |
| analyses            | is_unreliable                    | boolean   | Whether the statistical result is marked as unreliable.                                                                                                                                                                                                                                                                                                                                                                          |
| analyses            | lift_type                        | enum      | Whether the reported lift is relative or absolute. Allowed enum values: `RELATIVE`, `ABSOLUTE`, `UNKNOWN`.                                                                                                                                                                                                                                                                                                                       |
| analyses            | method                           | enum      | Statistical method used to calculate this result. Allowed enum values: `FIXED_SAMPLE`, `BAYESIAN`, `SEQUENTIAL`, `SEQUENTIAL_FIXED_HYBRID`, `UNKNOWN`.                                                                                                                                                                                                                                                                           |
| analyses            | minimum_expected_regret          | double    | The smaller expected opportunity cost of choosing treatment or control.                                                                                                                                                                                                                                                                                                                                                          |
| analyses            | p_value                          | double    | Probability, under the no-effect hypothesis, of a result at least as extreme as the observed result.                                                                                                                                                                                                                                                                                                                             |
| analyses            | point_estimate                   | double    | Estimated difference between the variant and control for this metric.                                                                                                                                                                                                                                                                                                                                                            |
| analyses            | probability_above_zero           | double    | Estimated probability that the effect is greater than zero.                                                                                                                                                                                                                                                                                                                                                                      |
| analyses            | probability_below_zero           | double    | Estimated probability that the effect is less than zero.                                                                                                                                                                                                                                                                                                                                                                         |
| analyses            | standard_error                   | double    | Estimated uncertainty in the effect estimate.                                                                                                                                                                                                                                                                                                                                                                                    |
| analyses            | unreliable_reason                | enum      | Reason that the statistical result is marked as unreliable. Allowed enum values: `CONTROL_DENOMINATOR_NEAR_ZERO`, `TREATMENT_DENOMINATOR_NEAR_ZERO`, `CONTROL_AND_TREATMENT_DENOMINATORS_NEAR_ZERO`, `CONTROL_MEAN_NEAR_ZERO`, `ZERO_VARIANCE`, `UNKNOWN`.                                                                                                                                                                       |
| analyses            | variant_metric_value             | double    | Metric value calculated for this variant.                                                                                                                                                                                                                                                                                                                                                                                        |
| analyses            | z_score                          | double    | Standardized statistic used to compare the observed effect with zero.                                                                                                                                                                                                                                                                                                                                                            |
| metrics             | assignment_count                 | int64     | Number of subjects assigned to this variant.                                                                                                                                                                                                                                                                                                                                                                                     |
| metrics             | coverage                         | double    | Estimated share of the global metric total from the eligible population if that population received control. The estimate can exceed 1.                                                                                                                                                                                                                                                                                          |
| metrics             | coverage_summary                 | object    | Population totals and allocation used to calculate metric coverage.                                                                                                                                                                                                                                                                                                                                                              |
| coverage_summary    | control_total                    | double    | Total metric value for the control population in the coverage calculation.                                                                                                                                                                                                                                                                                                                                                       |
| coverage_summary    | coverage                         | double    | Estimated share of the global metric total from the eligible population if that population received control. The estimate can exceed 1.                                                                                                                                                                                                                                                                                          |
| coverage_summary    | coverage_unavailable_reason      | string    | Reason that metric coverage could not be calculated.                                                                                                                                                                                                                                                                                                                                                                             |
| coverage_summary    | eligible_population_total        | double    | Estimated metric total for the eligible population if that population received control.                                                                                                                                                                                                                                                                                                                                          |
| coverage_summary    | experiment_total                 | double    | Total metric value for the experiment population in the coverage calculation.                                                                                                                                                                                                                                                                                                                                                    |
| coverage_summary    | global_metric_total              | double    | Observed metric total across subjects inside and outside the experiment.                                                                                                                                                                                                                                                                                                                                                         |
| coverage_summary    | traffic_allocation               | double    | Fraction of eligible traffic allocated to the experiment, weighted by time.                                                                                                                                                                                                                                                                                                                                                      |
| metrics             | coverage_unavailable_reason      | string    | Reason that metric coverage could not be calculated.                                                                                                                                                                                                                                                                                                                                                                             |
| metrics             | denominator                      | double    | Aggregated denominator value for this metric and variant.                                                                                                                                                                                                                                                                                                                                                                        |
| metrics             | desired_change                   | enum      | Direction of metric change considered desirable. Allowed enum values: `METRIC_INCREASES`, `METRIC_DECREASES`, `UNKNOWN`.                                                                                                                                                                                                                                                                                                         |
| metrics             | metric_id                        | string    | ID of the metric represented by this entry.                                                                                                                                                                                                                                                                                                                                                                                      |
| metrics             | metric_name                      | string    | Display name of the metric represented by this entry.                                                                                                                                                                                                                                                                                                                                                                            |
| metrics             | numerator                        | double    | Aggregated numerator value for this metric and variant.                                                                                                                                                                                                                                                                                                                                                                          |
| metrics             | sub_metric_property_name         | string    | Name of the property used to split this metric result.                                                                                                                                                                                                                                                                                                                                                                           |
| metrics             | sub_metric_property_value        | string    | Property value represented by this split metric result.                                                                                                                                                                                                                                                                                                                                                                          |
| attributes          | variant_key                      | string    | Key that identifies the experiment variant.                                                                                                                                                                                                                                                                                                                                                                                      |
| attributes          | variant_name                     | string    | Display name of the experiment variant.                                                                                                                                                                                                                                                                                                                                                                                          |
| data                | id [*required*]                  | string    | ID of the variant result.                                                                                                                                                                                                                                                                                                                                                                                                        |
| data                | type [*required*]                | enum      | Experiment variant results resource type. Allowed enum values: `experiment-variant-results`. Default: `experiment-variant-results`.                                                                                                                                                                                                                                                                                              |
|                     | meta                             | object    | Selected experiment result run, its recorded EVSI forecast, and results freshness.                                                                                                                                                                                                                                                                                                                                               |
| meta                | evsi_context                     | object    | Forecast horizon and traffic counts used to calculate expected value of sample information (EVSI) for result_run_id. Assumes traffic continues at the rate observed during the lookback window. Omitted if the forecast was not recorded or could not be loaded.                                                                                                                                                                 |
| evsi_context        | elapsed_days [*required*]        | double    | Exact assignment-window duration in days, including fractional days.                                                                                                                                                                                                                                                                                                                                                             |
| evsi_context        | horizon_days [*required*]        | double    | Forecast horizon in days from the original assignment window.                                                                                                                                                                                                                                                                                                                                                                    |
| evsi_context        | horizon_exposures [*required*]   | double    | Projected additional exposures over the horizon, assuming constant traffic.                                                                                                                                                                                                                                                                                                                                                      |
| evsi_context        | lookback_days [*required*]       | int64     | Selected lookback length in complete days.                                                                                                                                                                                                                                                                                                                                                                                       |
| evsi_context        | lookback_exposures [*required*]  | int64     | Exposures across all variants in the eligible lookback buckets.                                                                                                                                                                                                                                                                                                                                                                  |
| evsi_context        | total_exposures [*required*]     | int64     | Experiment-wide exposures across the assignment window, including boundary buckets.                                                                                                                                                                                                                                                                                                                                              |
| evsi_context        | unavailable_reason [*required*]  | enum      | Recorded traffic forecast unavailability reason. Per-analysis reasons are reported separately. Allowed enum values: `traffic_unavailable`, `insufficient_complete_days`, `no_total_exposures`, `no_lookback_exposures`, `invalid_traffic`.                                                                                                                                                                                       |
| evsi_context        | usable_traffic_days [*required*] | int64     | Interior UTC daily buckets excluding both boundary days. Includes zero-traffic days and does not certify ingestion completeness.                                                                                                                                                                                                                                                                                                 |
| meta                | is_stale                         | boolean   | Whether the saved results require a refresh or their freshness cannot be confirmed. See stale_reasons for details.                                                                                                                                                                                                                                                                                                               |
| meta                | result_run_id [*required*]       | uuid      | ID of the successful experiment run that produced these results.                                                                                                                                                                                                                                                                                                                                                                 |
| meta                | results_last_updated             | date-time | Time when the experiment results were last updated.                                                                                                                                                                                                                                                                                                                                                                              |
| meta                | stale_reasons                    | [string]  | Reasons the saved experiment results are stale.                                                                                                                                                                                                                                                                                                                                                                                  |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": [
    {
      "attributes": {
        "assignment_count": "integer",
        "experiment_id": "string",
        "is_control": false,
        "metrics": [
          {
            "analyses": [
              {
                "confidence_interval": {
                  "lower": "number",
                  "upper": "number"
                },
                "confidence_level": "number",
                "evsi": 0,
                "evsi_future_se": 0.0061306,
                "evsi_unavailable_reason": "computation_failed",
                "expectation_above_zero": "number",
                "expectation_below_zero": "number",
                "global_lift": "number",
                "global_lift_lower_bound": "number",
                "global_lift_upper_bound": "number",
                "is_cuped_adjusted": false,
                "is_unreliable": false,
                "lift_type": "string",
                "method": "string",
                "minimum_expected_regret": "number",
                "p_value": "number",
                "point_estimate": "number",
                "probability_above_zero": "number",
                "probability_below_zero": "number",
                "standard_error": "number",
                "unreliable_reason": "string",
                "variant_metric_value": "number",
                "z_score": "number"
              }
            ],
            "assignment_count": "integer",
            "coverage": "number",
            "coverage_summary": {
              "control_total": "number",
              "coverage": "number",
              "coverage_unavailable_reason": "string",
              "eligible_population_total": "number",
              "experiment_total": "number",
              "global_metric_total": "number",
              "traffic_allocation": "number"
            },
            "coverage_unavailable_reason": "string",
            "denominator": "number",
            "desired_change": "METRIC_INCREASES",
            "metric_id": "string",
            "metric_name": "string",
            "numerator": "number",
            "sub_metric_property_name": "string",
            "sub_metric_property_value": "string"
          }
        ],
        "variant_key": "string",
        "variant_name": "string"
      },
      "id": "550e8400-e29b-41d4-a716-446655440000:treatment",
      "type": "experiment-variant-results"
    }
  ],
  "meta": {
    "evsi_context": {
      "elapsed_days": 14.5,
      "horizon_days": 7,
      "horizon_exposures": 10000,
      "lookback_days": 7,
      "lookback_exposures": 10000,
      "total_exposures": 20000,
      "unavailable_reason": "traffic_unavailable",
      "usable_traffic_days": 13
    },
    "is_stale": true,
    "result_run_id": "550e8400-e29b-41d4-a716-446655440004",
    "results_last_updated": "2026-08-05T09:25:00Z",
    "stale_reasons": [
      "ANALYSIS_PLAN_CHANGED"
    ]
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Malformed experiment ID (not a valid UUID), or the experiment is not configured for analysis.

{% 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.

{% 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" %}
Authenticated 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 experiment with this ID exists, or results are not available for it yet.

{% 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="409" %}
The experiment's metrics are incompatible with analysis.

{% 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 experiment_id="550e8400-e29b-41d4-a716-446655440000"

# 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/${experiment_id}/results" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}

{% tab label="Go" %}
```go
// Get experiment results returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
	"github.com/google/uuid"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewExperimentsApi(apiClient)
	resp, r, err := api.GetExperimentResults(ctx, uuid.MustParse("550e8400-e29b-41d4-a716-446655440000"))

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ExperimentsApi.GetExperimentResults`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `ExperimentsApi.GetExperimentResults`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
```
{% /tab %}

{% tab label="Java" %}
```java
// Get experiment results returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ExperimentsApi;
import com.datadog.api.client.v2.model.ExperimentsVariantResultsV2DTOArray;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
    ExperimentsApi apiInstance = new ExperimentsApi(defaultClient);

    try {
      ExperimentsVariantResultsV2DTOArray result =
          apiInstance.getExperimentResults(UUID.fromString("550e8400-e29b-41d4-a716-446655440000"));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ExperimentsApi#getExperimentResults");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
```
{% /tab %}

{% tab label="Python" %}
```python
"""
Get experiment results returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.experiments_api import ExperimentsApi
from uuid import UUID

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
    api_instance = ExperimentsApi(api_client)
    response = api_instance.get_experiment_results(
        experiment_id=UUID("550e8400-e29b-41d4-a716-446655440000"),
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
```
{% /tab %}

{% tab label="Ruby" %}
```ruby
# Get experiment results returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::ExperimentsAPI.new
p api_instance.get_experiment_results("550e8400-e29b-41d4-a716-446655440000")
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" ruby "example.rb"
```
{% /tab %}

{% tab label="Rust" %}
```rust
// Get experiment results returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_experiments::ExperimentsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = ExperimentsAPI::with_config(configuration);
    let resp = api
        .get_experiment_results(
            Uuid::parse_str("550e8400-e29b-41d4-a716-446655440000").expect("invalid UUID"),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
```
{% /tab %}
{% /tabs %}
