---
title: Analyze results
slug: feature-experimentation/api/bsjx-analyze-results
docTags: 
createdAt: 2026-09-18T02:55:57.882Z
---

::::CodeDrawer{title="Analyze results" isResponseExpanded="true" autoGeneratedAnchorSlug="analyze-results" legacyHash="RAh62yXd9XaTAO48MnyP9"}
:::CodeblockTabsExamples
```javascript
// -------------------------------------------------------------------------- //
//                              Analyze results.                              //
// -------------------------------------------------------------------------- //

// ----------- Get All Experiments in Project => Get Experiment Key ---------- //
GET {{flagsUrl}}/projects/{{projectId}}/rules?rule_types=a/b,mab&archived=false&environments={{environment}}&per_page=100
Content-Type: application/json
Authorization: {{token}}

// Copy the relevant experiment key from the response, if you do not already have it (for example, stock_message_test).

###

// ------------------------- Get Experiment Reports => Get Report Key ------------------------- //
GET {{flagsUrl}}/projects/{{projectId}}/environments/{{environment}}/reports?sort=key:asc&archived=false
Content-Type: application/json
Authorization: {{token}}

// Copy the relevant report key for the experiment of interest (for example, stock_message_test_ff8g3hxNc8EKoE837vVVtR)

###

// -------------------- Get Individual Experiment Report => Get Experiment Results ID -------------------- //
// Replace {{reportKey}} with the report key from the previous response.

GET {{flagsUrl}}/projects/{{projectId}}/environments/{{environment}}/reports/{{reportKey}}
Content-Type: application/json
Authorization: {{token}}

// Copy the relevant experiment results ID from the end of the fetch_results_ui_url key in the response (/experiments/{{experimentResultsId}})

###

// ------------------------- Get Experiment Results ------------------------- //
// Replace {{experimentResultsId}} with the experiment results ID from the previous response.

GET {{baseUrl}}/experiments/{{experimentResultsId}}/results
Content-Type: application/json
Authorization: {{token}}
```
:::

:::CodeblockTabsResponses
```javascript
{"success":true}
```
:::
::::

Use the [List rules](https://docs.developers.optimizely.com/feature-experimentation/reference/list_all_rules_in_project), [List reports](https://docs.developers.optimizely.com/feature-experimentation/reference/list_reports), [Fetch a Single Report](https://docs.developers.optimizely.com/feature-experimentation/reference/fetch_report), and the [Get Experiment results](https://docs.developers.optimizely.com/feature-experimentation/reference/get_experiment_results) API endpoints to get the A/B test's result.

## Prerequisite

Before running this request, you must follow the instructions to configure your [REST API cookbook](https://docs.developers.optimizely.com/feature-experimentation/reference/set-up-visual-basic-to-run-rest-api-calls).

## Create a file

Create a file named `analyze-results.rest` and copy and paste the recipe into the file.

## Copy the experiment key

To get the experiment key (if you do not already have it), make a request to the [List rules](https://docs.developers.optimizely.com/feature-experimentation/reference/list_all_rules_in_project) API endpoint. Copy the experiment key for the next step.

`{{flagsUrl}}`, `{{projectId}}`, `{{environment}}`, and `{{token}}` are defined in the `settings.json` file. Ensure you have configured your Visual Studio Code project correctly. See [Configure the Visual Studio Code REST Client](https://docs.developers.optimizely.com/feature-experimentation/reference/set-up-visual-basic-to-run-rest-api-calls#configure-the-visual-studio-code-rest-client).

Click **Send Request** in Visual Studio Code.

```json
GET {{flagsUrl}}/projects/{{projectId}}/rules?rule_types=a/b,mab&archived=false&environments={{environment}}&per_page=100
Content-Type: application/json
Authorization: {{token}}

// Copy the relevant experiment key from the response, if you do not already have it (for example, stock_message_test).
```

## The `###` delimiter

The REST Client extension delimits multiple requests using `###`. See [Main features in the REST Client documentation](https://marketplace.visualstudio.com/items?itemName=humao.rest-client#main-features).

## Copy the report key

To get the `report key` for the experiment you created in the [Create experiment](https://docs.developers.optimizely.com/feature-experimentation/recipes/6-create-experiment) recipe, make a request to the [List reports](https://docs.developers.optimizely.com/feature-experimentation/reference/list_reports) API endpoint.

Click **Send Request** in Visual Studio Code.

The List reports API endpoint returns an `items` array. Look for the key-value pair with the key `key` and copy the value. This is your report key.

Copy the report key for the next step.

```json
GET {{flagsUrl}}/projects/{{projectId}}/environments/{{environment}}/reports?sort=key:asc&archived=false
Content-Type: application/json
Authorization: {{token}}

// Copy the relevant report key for the experiment of interest (for example, stock_message_test_ff8g3hxNc8EKoE837vVVtR)
```

## Copy the relevant results ID

Use the [Fetch a Single Report](https://docs.developers.optimizely.com/feature-experimentation/reference/fetch_report) API endpoint with the report key from the previous call. Copy the experiment results ID from the end of the `fetch_results_ui_url` key in the response.

Click **Send Request** in Visual Studio Code.

`{{flagsUrl}}`, `{{projectId}}`, `{{environment}}`, and `{{token}}` are defined in the `settings.json` file. Ensure you have configured your Visual Studio Code project correctly. See [Configure the Visual Studio Code REST Client](https://docs.developers.optimizely.com/feature-experimentation/reference/set-up-visual-basic-to-run-rest-api-calls#configure-the-visual-studio-code-rest-client).

```json
// Replace {{reportKey}} with the report key from the previous response.

GET {{flagsUrl}}/projects/{{projectId}}/environments/{{environment}}/reports/{{reportKey}}
Content-Type: application/json
Authorization: {{token}}

// Copy the relevant experiment results ID from the end of the fetch_results_ui_url key in the response (/experiments/{{experimentResultsId}})
```

## Get the experiment results

Use the [Get Experiment results](https://docs.developers.optimizely.com/feature-experimentation/reference/get_experiment_results) API endpoint with the experiment results ID from the previous call to get the A/B test's result.

Click **Send Request** in Visual Studio Code.

`{{baseUrl}}` and `{{token}}` are defined in the `settings.json` file. Ensure you have configured your Visual Studio Code project correctly. See [Configure the Visual Studio Code REST Client](https://docs.developers.optimizely.com/feature-experimentation/reference/set-up-visual-basic-to-run-rest-api-calls#configure-the-visual-studio-code-rest-client).

```json
// Replace {{experimentResultsId}} with the experiment results ID from the previous response.

GET {{baseUrl}}/experiments/{{experimentResultsId}}/results
Content-Type: application/json
Authorization: {{token}}
```
