Skip to main content

Performance API Endpoints

The Performance API methods allow you to manage your front-end performance testing as programmatic data so you can represent them in a custom dashboard that is meaningful for your organization.

Refer to Getting Started for Authentication and Server information.

Get Performance Test Results

GET /v2/performance/metrics/

Retrieves the results of performance tests run by the requesting account and returns the metric values for those tests.

Parameters

page_url

| QUERY | OPTIONAL | STRING |

Filter results to return only tests run on a specific URL.

metric_names

| QUERY | OPTIONAL | ARRAY of STRINGS |

Provide a list of specific metric values to return. If omitted, the result includes all metrics. See Performance Metric Values for a list of supported metrics.

start_date

| QUERY | OPTIONAL | DATE_TIME STRING |

Filter results based on tests run on or after this date.

end_date

| BODY | OPTIONAL | DATE-TIME STRING |

Filter results based on tests run on or before this date.

Sample Request
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/?metric_names=speedIndex' | json_pp

Responses

200Success.
404Not found.
Sample Response
{
"items": [
{
"job_id": "0308500535c24468a977b250da266b18",
"job_owner": "jim.smith",
"job_name_hash": "05833b66a7c1ac61342cdcedca58b07e28298d23",
"metric_data": {
"speedIndex": 5645
},
"page_url": "https://saucelabs.com/",
"order_index": 0,
"job_creation_time": "2021-04-15T01:24:11Z",
"load_id": "2ad6fbe41070fe02b9cc2fc0271ec65d736acd88",
"loader_id": "DAC987D7B5A17D680DD6EB966B13AA56",
"error": null
},
{
"job_id": "b6bee25245724ddca6b852a7ec49f155",
"job_owner": "jim.smith",
"job_name_hash": "05833b66a7c1ac61342cdcedca58b07e28298d23",
"metric_data": {
"speedIndex": 5668
},
"page_url": "https://saucelabs.com/",
"order_index": 0,
"job_creation_time": "2021-04-15T01:23:27Z",
"load_id": "85b9dd1c20dc7347a598566bcbca171cf9f525d3",
"loader_id": "4F399131AA5741C0345752C066BDA29C",
"error": null
}
],
"links": {
"next": null,
"previous": null
}
}

Get Performance Results for a Specific Test

GET /v2/performance/metrics/{job_id}/

Retrieves the results of a specific performance test run by the requesting account.

Parameters

job_id

| PATH | REQUIRED | STRING |

The unique identifier of the requested test results.

full

| QUERY | OPTIONAL | BOOLEAN |

Set to false to return only basic job data, excluding metric values. Defaults to true.

Sample Request
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/f62eaf7d63c9449eb0424cf7678bf6a9/' | json_pp

Responses

200Success.
404Not found.
Sample Response
{
"items": [
{
"job_id": "f62eaf7d63c9449eb0424cf7678bf6a9",
"job_owner": "jim.smith",
"job_name_hash": "05833b66a7c1ac61342cdcedca58b07e28298d23",
"metric_data": {
"rtt": 0,
"load": 15802,
"score": 0.5,
"maxRtt": 78,
"numFonts": 6,
"numTasks": 443,
"xhr_size": 930,
"font_size": 103884,
"xhr_count": 4,
"firstPaint": 5098,
"font_count": 6,
"image_size": 309548,
"numScripts": 18,
"other_size": 2184,
"speedIndex": 5279,
"throughput": 1424892.2246980143,
"image_count": 31,
"numRequests": 66,
"other_count": 1,
"script_size": 1099203,
"firstCPUIdle": 9657,
"requestsSize": 2041741,
"script_count": 18,
"document_size": 126423,
"requestsCount": 66,
"totalTaskTime": 2098,
"document_count": 2,
"numStylesheets": 4,
"stylesheet_size": 399569,
"timeToFirstByte": 577,
"totalByteWeight": 1520499,
"domContentLoaded": 9501,
"firstInteractive": 9657,
"lastVisualChange": 6867,
"maxServerLatency": 769,
"numTasksOver10ms": 27,
"numTasksOver25ms": 15,
"numTasksOver50ms": 9,
"stylesheet_count": 4,
"firstVisualChange": 5101,
"numTasksOver100ms": 4,
"numTasksOver500ms": 0,
"totalBlockingTime": 316,
"serverResponseTime": 577,
"firstContentfulPaint": 5098,
"firstMeaningfulPaint": 5098,
"cumulativeLayoutShift": 0,
"estimatedInputLatency": 46,
"largestContentfulPaint": 5098,
"mainDocumentTransferSize": 18951
},
"page_url": "https://saucelabs.com/",
"order_index": 0,
"job_creation_time": "2021-04-15T01:23:25Z",
"load_id": "e96abdb4f49bd6f116f7e004f7d6d20ac69287c8",
"loader_id": "58977153A6246AEDCF40874D39299AA1",
"error": null,
"links": {...}
}
]
}

Get Test Assertions

GET /v2/performance/metrics/{job_id}/assert/

Returns information about any outliers values in the test for the specified metrics.

Parameters

job_id

| PATH | REQUIRED | STRING |

The unique identifier of the relevant test.

metric_names

| QUERY | REQUIRED | ARRAY of STRINGS |

Provide a list of specific metric values to return. See Performance Metric Values for a list of supported metrics.

order_index

| QUERY | REQUIRED | INTEGER |

Return results beginning with this record number.

Sample Request
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/assert/?metric_names=speedIndex&order_index=1' | json_pp

Responses

200Success.
400Bad Request.

May contain a specific error message, such as "at least one metric_names parameter is required."
404Job not found.
Sample Response
{
"speedIndex": {
"baseline": 5399.909090909091,
"lower_boundary": 4867.525754835426,
"upper_boundary": 5932.292426982756,
"real_value": 5645,
"job_id": "0308500535c24468a977b250da266b18",
"datetime": "2021-04-15T01:24:11Z",
"order_index": 0,
"outlier": {
"status": false,
"reason": null
}
}
}

Get Test Baseline

GET /v2/performance/metrics/{job_id}/baseline/

Returns acceptable upper and lower border values for specified metrics as determined by the baseline used for the test.

Parameters

job_id

| PATH | REQUIRED | STRING |

The unique identifier of the relevant test.

metric_names

| QUERY | REQUIRED | ARRAY of STRINGS |

Provide a list of specific metric values to return. If omitted, the result includes all metrics. See Performance Metric Values for a list of supported metrics.

order_index

| QUERY | REQUIRED | INTEGER |

Return results beginning with this record number.

regime_start

| QUERY | OPTIONAL | INTEGER |

Filter results to those occurring on or after this regime.

regime_end

| QUERY | OPTIONAL | INTEGER |

Filter results to those occurring on or before this regime.

Sample Request
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/baseline/?metric_names=speedIndex&order_index=0' | json_pp

Responses

200Success.
400Bad Request.

May contain a specific error message, such as "at least one metric_names parameter is required."
404Job not found.
Sample Response
{
"speedIndex": {
"upper_boundary": 5932.292426982756,
"lower_boundary": 4867.525754835426,
"baseline": 5399.909090909091,
"values": [
{
"real_value": 5242,
"datetime": "2021-04-15T01:23:25Z",
"job_id": "4a8634a5332b48ca89984d34866cadf6"
},
{
"real_value": 5482,
"datetime": "2021-04-15T01:23:25Z",
"job_id": "49584bc7aaa04643ab8718b66ab90d35"
},
{
"real_value": 5645,
"datetime": "2021-04-15T01:24:11Z",
"job_id": "0308500535c24468a977b250da266b18"
}
]
}
}

Get Test Baseline Reset History

GET /v2/performance/metrics/{job_id}/baseline/reset/

Indicates whether the baseline has been reset for the specified job (true) or not (false).

Parameters

job_id

| PATH | REQUIRED | STRING |

The unique identifier of the relevant test.

Sample Request
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/baseline/reset/' | json_pp

Responses

200Success.
404Not found.
Sample Response
{
"result": false
}

Set a New Baseline Point

POST /v2/performance/metrics/{job_id}/baseline/reset/

Resets the point from which the baseline for the specified job is calculated. Any tests prior to the reset point are ignored.

Parameters

job_id

| PATH | REQUIRED | STRING |

The unique identifier of the relevant test.

Sample Request
curl --location --request POST 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/baseline/reset/' | json_pp

Responses

201Success.
404Not found.
note

A successful response returns no payload.


Get Discarded Test History

GET /v2/performance/metrics/{job_id}/discarded/

Returns a list of tests that have been discarded from the baseline calculation as outliers.

Parameters

job_id

| PATH | REQUIRED | STRING |

The unique identifier of the relevant test.

order_index

| QUERY | REQUIRED | INTEGER |

Return results beginning with this record number.

Sample Request
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/discarded/?order_index=0' | json_pp

Responses

200Success.
400Bad Request.

May contain a specific error message, such as "order_index is a required parameter."
404Job not found.
Sample Response
{
"job_ids": []
}

Discard Outliers as Flaky

POST /v2/performance/metrics/{job_id}/discarded/

Discards outlier results for a job to exclude them from future baseline calculations.

Parameters

job_id

| PATH | REQUIRED | STRING |

Identifies the test for which outliers will be discarded.

order_index

| QUERY | REQUIRED | INTEGER |

Discard outlier tests beginning with this record number.

Sample Request
curl --location --request POST 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/discarded/?order_index=0' | json_pp

Responses

201Success.
400Bad Request.

May contain a specific error message, such as "order_index is a required parameter."
404Job not found.
note

A successful response returns no payload.


Get Test History

GET /v2/performance/metrics/{job_id}/history/

Returns the test history of the specified job.

Parameters

job_id

| PATH | REQUIRED | STRING |

Identifies the test for which outliers will be discarded.

order_index

| QUERY | REQUIRED | INTEGER |

Discard outlier tests beginning with this record number.

limit

| QUERY | OPTIONAL | INTEGER |

The maximum number of results to return.

Sample Request
curl --location --request POST 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/history/?order_index=0' | json_pp

Responses

200Success.
400Bad Request.

May contain a specific error message, such as "order_index is a required parameter."
404Job not found.
Sample Response
{
"items": [
{
"job_id": "b6bee25245724ddca6b852a7ec49f155",
"job_owner": "jim.smith",
"job_name_hash": "05833b66a7c1ac61342cdcedca58b07e28298d23",
"metric_data": {
"rtt": 1,
"load": 13662,
"score": 0.5,
"maxRtt": 75,
"numFonts": 6,
"numTasks": 391,
"xhr_size": 932,
"font_size": 103884,
"xhr_count": 4,
"firstPaint": 5455,
"font_count": 6,
"image_size": 309548,
"numScripts": 18,
"other_size": 2184,
"speedIndex": 5668,
"throughput": 1443800.0594353613,
"image_count": 31,
"numRequests": 66,
"other_count": 1,
"script_size": 1099203,
"firstCPUIdle": 9565,
"requestsSize": 2041743,
"script_count": 18,
"document_size": 126423,
"requestsCount": 66,
"totalTaskTime": 2038,
"document_count": 2,
"numStylesheets": 4,
"stylesheet_size": 399569,
"timeToFirstByte": 586,
"totalByteWeight": 1519988,
"domContentLoaded": 9550,
"firstInteractive": 9565,
"lastVisualChange": 7375,
"maxServerLatency": 818,
"numTasksOver10ms": 31,
"numTasksOver25ms": 14,
"numTasksOver50ms": 4,
"stylesheet_count": 4,
"firstVisualChange": 5453,
"numTasksOver100ms": 4,
"numTasksOver500ms": 0,
"totalBlockingTime": 220,
"serverResponseTime": 586,
"firstContentfulPaint": 5455,
"firstMeaningfulPaint": 5455,
"cumulativeLayoutShift": 0,
"estimatedInputLatency": 29,
"largestContentfulPaint": 5455,
"mainDocumentTransferSize": 18950
},
"page_url": "https://saucelabs.com/",
"order_index": 0,
"job_creation_time": "2021-04-15T01:23:27Z",
"load_id": "85b9dd1c20dc7347a598566bcbca171cf9f525d3",
"loader_id": "4F399131AA5741C0345752C066BDA29C",
"error": null
},
{
"job_id": "a2ae2d14dc064bcbb8fda830205054e5",
"job_owner": "jim.smith",
"job_name_hash": "05833b66a7c1ac61342cdcedca58b07e28298d23",
"metric_data": {...},
"page_url": "https://saucelabs.com/",
"order_index": 0,
"job_creation_time": "2021-04-15T01:23:25Z",
"load_id": "f2dc8ce42ae21239663a026fae86bec19d20023f",
"loader_id": "E5B13DE6FE878E6E4D3A617B76A68CE0",
"error": null
}
]
}

Get Metric Regimes

GET /v2/performance/metrics/{job_id}/regimes/

Returns the starting and ending job counts in the current regime (a set of consecutive tests where the results are unchanged) for each specified metric.

Parameters

job_id

| PATH | REQUIRED | STRING |

The unique identifier of the relevant test.

metric_names

| QUERY | REQUIRED | ARRAY of STRINGS |

A list of specific metrics values for which you want regime info. See Performance Metric Values for a list of supported metrics.

order_index

| QUERY | REQUIRED | INTEGER |

Limit results to those beginning with this record number.

include_baseline

| QUERY | OPTIONAL | BOOLEAN |

Specifies whether the regime should include baseline values. Default value is false.

Sample Request
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/b6bee25245724ddca6b852a7ec49f155/regimes/?order_index=0&metric_names=speedIndex,domContentLoaded,lastVisualChange' | json_pp

Responses

200Success.
400Bad Request.

May contain a specific error message, such as "at least one metric_names parameter is required."
404Job not found.
Sample Response
{
"speedIndex": [
{
"regime_start": 0,
"regime_end": 0,
"baseline_url": "/v2/performance/metrics/b6bee25245724ddca6b852a7ec49f155/baseline/?metric_names=speedIndex&order_index=0",
"active": true
}
],
"domContentLoaded": [
{
"regime_start": 0,
"regime_end": 0,
"baseline_url": "/v2/performance/metrics/b6bee25245724ddca6b852a7ec49f155/baseline/?metric_names=domContentLoaded&order_index=0",
"active": true
}
],
"lastVisualChange": [
{
"regime_start": 0,
"regime_end": 0,
"baseline_url": "/v2/performance/metrics/b6bee25245724ddca6b852a7ec49f155/baseline/?metric_names=lastVisualChange&order_index=0",
"active": true
}
]
}

Acknowlege New Regimes

POST /v2/performance/metrics/{job_id}/regimes/acknowledge/

Confirm values in a new regime (point at which a consecutive number of jobs with an unchanged result posts a different result) are acceptable.

Parameters

job_id

| PATH | REQUIRED | STRING |

The unique identifier of the relevant test.

order_index

| QUERY | REQUIRED | INTEGER |

Limit results to those beginning with this record number.

Sample Request
curl --location --request POST 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/b6bee25245724ddca6b852a7ec49f155/regimes/acknowledge/?order_index=0' | json_pp

Responses

201Success.
400Bad Request.

May contain a specific error message, such as "at least one metric_names parameter is required."
404Job not found.
note

A successful response returns no payload.