---
title: Get Experiment results
slug: web-experimentation/api/get-experiment-results
docTags: 
createdAt: 2026-10-02T13:15:18.296Z
---

{
  "id": "TyJGVGM2nQAeaNRdfwQdI",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.optimizely.com/v2/experiments/{experiment_id}/results",
    "servers": [
      {
        "url": "https://api.optimizely.com/v2/experiments/{experiment_id}/results"
      }
    ],
    "name": "Get Experiment results",
    "description": "Get results for a single Experiment",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "experiment_id",
          "type": "integer<int64>",
          "description": "The ID for the Experiment you want results for",
          "format": "int64"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "baseline_variation_id",
          "type": "string<int64>",
          "description": "<p>The ID of the variation to use as the baseline to compare against other variations. Defaults to the first variation if not provided. For an experience in a personalization campaign, the value can also be the string 'holdback'.</p>",
          "format": "int64"
        },
        {
          "kind": "optional",
          "name": "start_time",
          "type": "string<date-time>",
          "description": "<p>The start time of the time interval (beginning time included) used to calculate the results over. If unspecified, defaults to the time that the Experiment was first activated. The start time will be rounded the smallest time modulo 5 minutes larger or equal to start_time.</p>",
          "format": "date-time"
        },
        {
          "kind": "optional",
          "name": "end_time",
          "type": "string<date-time>",
          "description": "<p>The end of the time interval (end time excluded) used to calculate results over. If unspecified, defaults to the current time if the Experiment is still running, otherwise defaults to the time the experiment was last active. The end time will be rounded to the largest time modulo 5 minutes smaller or equal to end_time. The end_time in the response may be earlier than requested if fresher results are not available yet. In this case, the results will continue to calculate in the background and subsequent requests will eventually return the full results.</p>",
          "format": "date-time"
        },
        {
          "kind": "optional",
          "name": "browser",
          "type": "string",
          "description": "<p>Browser to segment results by. This parameter must not be sent with any other segmentation parameters, i.e. any parameters in [device, source, attribute_id, attribute_value].</p>",
          "enum": [
            "firefox",
            "chrome",
            "internet_explorer",
            "opera",
            "safari"
          ]
        },
        {
          "kind": "optional",
          "name": "device",
          "type": "string",
          "description": "<p>Device to segment results by. This parameter must not be sent with any other segmentation parameters, i.e. any parameters in [browser, source, attribute_id, attribute_value].</p>",
          "enum": [
            "desktop",
            "ipad",
            "iphone",
            "mobile",
            "tablet"
          ]
        },
        {
          "kind": "optional",
          "name": "source",
          "type": "string",
          "description": "<p>Source to segment results by. This parameter must not be sent with any other segmentation parameters, i.e. any parameters in [browser, device, attribute_id, attribute_value].\nCampaign: Contains users that arrive on a URL containing a 'utm_campaign,' 'utm_source,' 'gclid,' or 'otm_source' query parameter. If the URL contains one of these parameters, the visitor will count as \"Campaign\" traffic even if they arrived through search.\nDirect:  Includes all users who do not have any external referrer in their URL.\nReferral: Includes all users that come from another URL that doesn't count as Campaign.</p>",
          "enum": [
            "campaign",
            "direct",
            "referral",
            "search"
          ]
        },
        {
          "kind": "optional",
          "name": "attribute_id",
          "type": "integer<int64>",
          "description": "<p>ID of the attribute to segment results by. Requests containing attribute_id will return the results for all visitors that have attribute_value for the attribute represented by attribute_id. If present, the attribute_value parameter must also be present, and it cannot be sent with any other segmentation parameters, i.e. any parameters in [browser, device, source].</p>",
          "format": "int64"
        },
        {
          "kind": "optional",
          "name": "attribute_value",
          "type": "string",
          "description": "<p>UTF-8 encoded value correlating to attribute_id. If present, the attribute_id parameter must also be present. This parameter also requires attribute_id to be set, and cannot be sent with any other segmentation parameters, i.e. any parameters in [browser, device, source].</p>"
        },
        {
          "kind": "optional",
          "name": "segment_conditions",
          "type": "string",
          "description": "<p>(BETA) A string representation of a JSON Segment Conditions Expression. This parameter can be either URL-escaped stringified JSON or Base64-encoded stringified JSON using URL-safe alphabet (preferred).\nSegment Conditions Expressions consist of Logical Expressions and Match Expressions.\nLogical Expressions are represented as an array of the format [, ...], where the supported operators are \"and\", \"or\" and \"not\".\nMatch Expressions are represented as an object of the format {\"attribute_id\": &#x3C;attribute_id>, \"attribute_value\": [, \"match_type\": &#x3C;match_type>]}, where supported values for match_type are \"exact\" match type will match only an exact string match between \"value\" string and the attribute value. \"substring\" match type will match if \"value\" is a substring of the attribute value. \"prefix\" match type will match if \"value\" is a string prefix of the attribute value. \"regex\" match type will match if \"value\" is a regular expression match for the attribute value. The default match_type is \"exact\".</p>"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "apiKey",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        },
        {
          "id": "OAuth2",
          "name": "OAuth2",
          "kind": "optional",
          "type": "oauth2",
          "description": "<p>Write applications that authenticate with the REST API via OAuth 2.0. Or, to authenticate using a personal token, see <a href=\"https://docs.developers.optimizely.com/web/docs/personal-token\" target=\"_blank\">https://docs.developers.optimizely.com/web/docs/personal-token</a></p>",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://app.optimizely.com/oauth2/authorize",
              "tokenUrl": "https://app.optimizely.com/oauth2/token",
              "scopes": {
                "all": "Full access to your account"
              }
            }
          },
          "requiredScopes": [
            "read",
            "write"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Return Experiment results",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ExperimentResults",
            "schema": [
              {
                "name": "confidence_threshold",
                "kind": "optional",
                "type": "number<double>",
                "description": "<p>The significance level at which you would like to declare winning and losing variations. A lower number minimizes the time needed to declare a winning or losing variation, but increases the risk that your results aren't true winners and losers.</p>",
                "example": 0.9,
                "format": "double"
              },
              {
                "name": "end_time",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "<p>End of the time interval (exclusive) used to calculated the results. The time is formatted in ISO 8601.</p>",
                "format": "date-time"
              },
              {
                "name": "experiment_id",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "The unique identifier for the Experiment",
                "example": 3000,
                "format": "int64"
              },
              {
                "name": "is_stale",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>When true, indicates the results were delivered from a cache that is out of date.</p>"
              },
              {
                "name": "metrics",
                "kind": "optional",
                "type": "array",
                "description": "<p>The breakdown of Experiment results by metric. ExperimentMetricResults object ordering in the array is consistent with the order that metrics are attached to the Experiment in the Optimizely UI and REST API (i.e. index 0 is the primary metric, indices 1-4 are secondary metrics, indices 5+ are monitoring metrics). See here for an explantion of the impact of metric ordering on results calculations.</p>",
                "modelRef": "#/components/schemas/ExperimentMetricResults",
                "customType": "ExperimentMetricResults[]",
                "schema": [
                  {
                    "name": "aggregator",
                    "kind": "optional",
                    "type": "string<unique | count | sum | exit | bounce | ratio>",
                    "description": "<p>The aggregation function for the numerator of the metric. 'unique' measures the number of unique visitors/sessions that include the specified Event. 'count' measures the total number of occurrences of Event for the scope (visitor/session). 'sum' is the sum of the 'field' value. 'exit' measures the ratio of sessions with last activation occurring on the target page to the sessions that activated the target page at least once during the session. 'bounce' measures the ratio of sessions that with first and last activation occurring on the target page to the sessions with first activation on the target page. For both 'exit' and 'bounce', the eventId must be the ID of a Page.</p>",
                    "enum": [
                      "unique",
                      "count",
                      "sum",
                      "exit",
                      "bounce",
                      "ratio"
                    ]
                  },
                  {
                    "name": "conclusion",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/ExperimentMetricConclusion",
                    "customType": "ExperimentMetricConclusion",
                    "schema": [
                      {
                        "name": "loser",
                        "kind": "optional",
                        "type": "string",
                        "readOnly": true,
                        "description": "ID of the variation that has reached statistical significance and has performed worse than all other variations."
                      },
                      {
                        "name": "winner",
                        "kind": "optional",
                        "type": "string",
                        "readOnly": true,
                        "description": "ID of the variation that has reached statistical significance and has performed better than all other variations."
                      }
                    ]
                  },
                  {
                    "name": "event_id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "nullable": true,
                    "description": "<p>The ID for the Event to select data from. Omitted for global metrics that are not relative to a specific Event, i.e. \"overall revenue\"</p>",
                    "format": "int64"
                  },
                  {
                    "name": "event_properties",
                    "kind": "optional",
                    "type": "object",
                    "description": "The conditions used to filter the metric on specific event property values.",
                    "modelRef": "#/components/schemas/MetricEventProperties",
                    "customType": "MetricEventProperties",
                    "schema": [
                      {
                        "name": "filter",
                        "kind": "optional",
                        "type": "object",
                        "description": "The set of event property conditions a conversion must match to be counted toward the metric.",
                        "modelRef": "#/components/schemas/MetricFilter",
                        "customType": "MetricFilter",
                        "schema": [
                          {
                            "name": "combine_operator",
                            "kind": "optional",
                            "type": "string<and | or>",
                            "description": "<p>Determines whether all conditions (and) or any condition (or) must be met.</p>",
                            "enum": [
                              "and",
                              "or"
                            ]
                          },
                          {
                            "name": "conditions",
                            "kind": "optional",
                            "type": "array",
                            "description": "defines the event property values and operator used to check whether the conversion meets the condition.",
                            "modelRef": "#/components/schemas/MetricFilterCondition",
                            "customType": "MetricFilterCondition[]",
                            "schema": [
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "description": "The name of the event property to match to."
                              },
                              {
                                "name": "operator",
                                "kind": "optional",
                                "type": "string<equal_to | not_equal_to | greater_than | greater_than_or_equal_to | less_than | less_than_or_equal_to | contains | does_not_contain>",
                                "description": "<p>The type of match to be performed. equal_to and not_equal_to are available for all property types. greater_than, greater_than_or_equal_to, less_than, and less_than_or_equal_to are only available for properties with type number. contains and does_not_contain are only available for properties with type string.</p>",
                                "enum": [
                                  "equal_to",
                                  "not_equal_to",
                                  "greater_than",
                                  "greater_than_or_equal_to",
                                  "less_than",
                                  "less_than_or_equal_to",
                                  "contains",
                                  "does_not_contain"
                                ]
                              },
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string<boolean | number | string>",
                                "description": "The data type of the event property.",
                                "enum": [
                                  "boolean",
                                  "number",
                                  "string"
                                ]
                              },
                              {
                                "name": "value",
                                "kind": "optional",
                                "type": "string",
                                "description": "<p>The value the conversion's property should match, according to the operator.</p>"
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "field",
                    "kind": "optional",
                    "type": "string<revenue | value>",
                    "description": "<p>The field to aggregate for the numerator of the metric. Required when 'aggregator' = 'sum', otherwise omitted</p>",
                    "enum": [
                      "revenue",
                      "value"
                    ]
                  },
                  {
                    "name": "metrics",
                    "kind": "optional",
                    "type": "array",
                    "description": "A list of all metrics that will be used in the calculation of a ratio metric.",
                    "modelRef": "#/components/schemas/CompoundSubMetric",
                    "customType": "CompoundSubMetric[]",
                    "schema": [
                      {
                        "name": "aggregator",
                        "kind": "optional",
                        "type": "string<unique | count | sum>",
                        "description": "<p>The aggregation function for the numerator of the metric. 'unique' measures the number of unique visitors/sessions that include the specified Event. 'count' measures the total number of occurrences of Event for the scope (visitor/session). 'sum' is the sum of the 'field' value.</p>",
                        "default": "unique",
                        "enum": [
                          "unique",
                          "count",
                          "sum"
                        ]
                      },
                      {
                        "name": "event_id",
                        "kind": "optional",
                        "type": "integer<int64>",
                        "nullable": true,
                        "description": "The ID for the Event to select data from.",
                        "format": "int64"
                      },
                      {
                        "name": "event_type",
                        "kind": "optional",
                        "type": "string<custom | click | pageview>",
                        "description": "The type of this Event.",
                        "enum": [
                          "custom",
                          "click",
                          "pageview"
                        ]
                      },
                      {
                        "name": "field",
                        "kind": "optional",
                        "type": "string<revenue | value>",
                        "nullable": true,
                        "description": "<p>The field to aggregate for the numerator of the metric. Required when 'aggregator' = 'sum', otherwise omitted.</p>",
                        "enum": [
                          "revenue",
                          "value"
                        ]
                      },
                      {
                        "name": "scope",
                        "kind": "optional",
                        "type": "string<session | visitor | event>",
                        "description": "<p>Specifies how Events should be grouped. Can also be thought of as the denominator of the metric. 'session' divides by the number of sessions. \"Influenced sessions\", or sessions that do not contain a decision Event but carry a decision from a previous session are not included in counts for numerator or denominator. 'visitor' divides by the number of visitors. 'event' divides by the total occurrences (impressions) of the specified Event.</p>",
                        "default": "visitor",
                        "enum": [
                          "session",
                          "visitor",
                          "event"
                        ]
                      }
                    ]
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "The name of the Metric"
                  },
                  {
                    "name": "results",
                    "kind": "optional",
                    "type": "map",
                    "description": "<p>A map of results for each variation in the Experiment keyed by variation ID. For Personalization Campaigns, the special variant 'baseline' represents visitors that have been held back from any change in experience for the Experiment</p>",
                    "example": "",
                    "customType": "map<string, VariantResults>",
                    "schema": []
                  },
                  {
                    "name": "scope",
                    "kind": "optional",
                    "type": "string<session | visitor | event>",
                    "description": "<p>Specifies how Events should be grouped together. Can also be thought of as the denonimator of the metric. 'session' divides by the number of sessions. \"Influenced sessions\", or sessions that do not contain a decision Event but carry a decision from a previous session are not included in counts for numerator or denominator. 'visitor' divides by the number of visitors. 'event' divides by the total occurrences (impressions) of the specified Event</p>",
                    "enum": [
                      "session",
                      "visitor",
                      "event"
                    ]
                  },
                  {
                    "name": "time_window",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>The maximum amount of time a numerator event can differ from a denominator event in order to be included in a ratio metric. This can be an integer, or an integer followed by a letter denoting the unit of time (d = days, h = hours, m = minutes). If no unit of time is supplied, hours is assumed. If no value is supplied, a time window of 48 hours is assumed.</p>"
                  },
                  {
                    "name": "winning_direction",
                    "kind": "optional",
                    "type": "string<increasing | decreasing>",
                    "description": "The winning direction of this metric",
                    "enum": [
                      "increasing",
                      "decreasing"
                    ]
                  }
                ]
              },
              {
                "name": "reach",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/ExperimentVariationReach",
                "customType": "ExperimentVariationReach",
                "schema": [
                  {
                    "name": "baseline_count",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "Baseline count",
                    "format": "int64"
                  },
                  {
                    "name": "baseline_reach",
                    "kind": "optional",
                    "type": "number<double>",
                    "description": "Baseline reach",
                    "format": "double"
                  },
                  {
                    "name": "total_count",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "Total number of visitors exposed to the Experiment",
                    "format": "int64"
                  },
                  {
                    "name": "treatment_count",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "Treatment count",
                    "format": "int64"
                  },
                  {
                    "name": "treatment_reach",
                    "kind": "optional",
                    "type": "number<double>",
                    "description": "Treatment reach",
                    "format": "double"
                  },
                  {
                    "name": "variations",
                    "kind": "optional",
                    "type": "map",
                    "description": "A map of reach for each variation keyed by variation ID",
                    "example": "",
                    "customType": "map<string, VariationReach>",
                    "schema": []
                  }
                ]
              },
              {
                "name": "start_time",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "<p>Start of the time interval (inclusive) used to calculate the results. The time is formatted in ISO 8601.</p>",
                "format": "date-time"
              },
              {
                "name": "stats_config",
                "kind": "optional",
                "type": "object",
                "description": "Stats Engine configuration settings",
                "modelRef": "#/components/schemas/StatsConfig",
                "customType": "StatsConfig",
                "schema": [
                  {
                    "name": "confidence_level",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "difference_type",
                    "kind": "optional",
                    "type": "string<absolute | relative>",
                    "description": "The type of test to compare the variant to baseline",
                    "enum": [
                      "absolute",
                      "relative"
                    ]
                  },
                  {
                    "name": "epoch_enabled",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "<p>Indicates if epoch-based statistics were used</p>"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/ExperimentResults",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "202",
        "description": "The results request has been received but has not yet finished processing. Wait a bit and try again.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "204",
        "description": "There are no results data for this Experiment yet. Make sure the Experiment is started and try again later",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "default",
        "description": "Unexpected error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "9n1w4d7wnScjc0D3Qupwh",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.optimizely.com/v2/experiments/{experiment_id}/results \\\n     --header 'accept: application/json'"
        },
        {
          "id": "XJjwfpBeuDYkbDjemxk-5",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.optimizely.com/v2/experiments/{experiment_id}/results\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "qqCPgBgoZrqxzQqbWQnfI",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.optimizely.com/v2/experiments/{experiment_id}/results\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "2i_XzeMCXGrukwxEARMaN",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.optimizely.com/v2/experiments/{experiment_id}/results\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "9n1w4d7wnScjc0D3Qupwh"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Return Experiment results\n{\n  \"confidence_threshold\": 0.9,\n  \"end_time\": \"\",\n  \"experiment_id\": 3000,\n  \"is_stale\": false,\n  \"metrics\": [\n    {\n      \"aggregator\": \"\",\n      \"conclusion\": {\n        \"loser\": \"\",\n        \"winner\": \"\"\n      },\n      \"event_id\": \"\",\n      \"event_properties\": {\n        \"filter\": {\n          \"combine_operator\": \"\",\n          \"conditions\": [\n            {\n              \"name\": \"\",\n              \"operator\": \"\",\n              \"type\": \"\",\n              \"value\": \"\"\n            }\n          ]\n        }\n      },\n      \"field\": \"\",\n      \"metrics\": [\n        {\n          \"aggregator\": \"\",\n          \"event_id\": \"\",\n          \"event_type\": \"\",\n          \"field\": \"\",\n          \"scope\": \"\"\n        }\n      ],\n      \"name\": \"\",\n      \"results\": \"\",\n      \"scope\": \"\",\n      \"time_window\": \"\",\n      \"winning_direction\": \"\"\n    }\n  ],\n  \"reach\": {\n    \"baseline_count\": \"\",\n    \"baseline_reach\": \"\",\n    \"total_count\": \"\",\n    \"treatment_count\": \"\",\n    \"treatment_reach\": \"\",\n    \"variations\": \"\"\n  },\n  \"start_time\": \"\",\n  \"stats_config\": {\n    \"confidence_level\": 0,\n    \"difference_type\": \"\",\n    \"epoch_enabled\": false\n  }\n}"
        },
        {
          "id": "response-1-202",
          "language": "202",
          "code": "// The results request has been received but has not yet finished processing. Wait a bit and try again.\n"
        },
        {
          "id": "response-2-204",
          "language": "204",
          "code": "// There are no results data for this Experiment yet. Make sure the Experiment is started and try again later\n"
        },
        {
          "id": "response-3-default",
          "language": "default",
          "code": "// Unexpected error\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}