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/
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. |
- United States
- Europe
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/?metric_names=speedIndex' | json_pp
curl --location --request GET 'https://api.eu-central-1.saucelabs.com/v2/performance/metrics/?metric_names=speedIndex' | json_pp
Responses
200 | Success. | |
404 | Not found. |
{
"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}/
Parameters
job_id | | PATH | REQUIRED | STRING | The unique identifier of the requested test results. |
full | | QUERY | OPTIONAL | BOOLEAN | Set to |
- United States
- Europe
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/f62eaf7d63c9449eb0424cf7678bf6a9/' | json_pp
curl --location --request GET 'https://api.eu-central-1.saucelabs.com/v2/performance/metrics/f62eaf7d63c9449eb0424cf7678bf6a9/' | json_pp
Responses
200 | Success. | |
404 | Not found. |
{
"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/
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. |
- United States
- Europe
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/assert/?metric_names=speedIndex&order_index=1' | json_pp
curl --location --request GET 'https://api.eu-central-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/assert/?metric_names=speedIndex&order_index=1' | json_pp
Responses
200 | Success. | |
400 | Bad Request.May contain a specific error message, such as "at least one metric_names parameter is required." | |
404 | Job not found. |
{
"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/
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. |
- United States
- Europe
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/baseline/?metric_names=speedIndex&order_index=0' | json_pp
curl --location --request GET 'https://api.eu-central-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/baseline/?metric_names=speedIndex&order_index=0' | json_pp
Responses
200 | Success. | |
400 | Bad Request.May contain a specific error message, such as "at least one metric_names parameter is required." | |
404 | Job not found. |
{
"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/
true
) or not (false
).Parameters
job_id | | PATH | REQUIRED | STRING | The unique identifier of the relevant test. |
- United States
- Europe
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/baseline/reset/' | json_pp
curl --location --request GET 'https://api.eu-central-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/baseline/reset' | json_pp
Responses
200 | Success. | |
404 | Not found. |
{
"result": false
}
Set a New Baseline Point
POST /v2/performance/metrics/{job_id}/baseline/reset/
Parameters
job_id | | PATH | REQUIRED | STRING | The unique identifier of the relevant test. |
- United States
- Europe
curl --location --request POST 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/baseline/reset/' | json_pp
curl --location --request POST 'https://api.eu-central-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/baseline/reset' | json_pp
Responses
201 | Success. | |
404 | Not found. |
A successful response returns no payload.
Get Discarded Test History
GET /v2/performance/metrics/{job_id}/discarded/
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. |
- United States
- Europe
curl --location --request GET 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/discarded/?order_index=0' | json_pp
curl --location --request GET 'https://api.eu-central-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/discarded/?order_index=0' | json_pp
Responses
200 | Success. | |
400 | Bad Request.May contain a specific error message, such as "order_index is a required parameter." | |
404 | Job not found. |
{
"job_ids": []
}
Discard Outliers as Flaky
POST /v2/performance/metrics/{job_id}/discarded/
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. |
- United States
- Europe
curl --location --request POST 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/discarded/?order_index=0' | json_pp
curl --location --request POST 'https://api.eu-central-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/discarded/?order_index=0' | json_pp
Responses
201 | Success. | |
400 | Bad Request.May contain a specific error message, such as "order_index is a required parameter." | |
404 | Job not found. |
A successful response returns no payload.
Get Test History
GET /v2/performance/metrics/{job_id}/history/
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. |
- United States
- Europe
curl --location --request POST 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/history/?order_index=0' | json_pp
curl --location --request POST 'https://api.eu-central-1.saucelabs.com/v2/performance/metrics/0308500535c24468a977b250da266b18/discarded/?order_index=0' | json_pp
Responses
200 | Success. | |
400 | Bad Request.May contain a specific error message, such as "order_index is a required parameter." | |
404 | Job not found. |
{
"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/
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 |
- United States
- Europe
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
curl --location --request GET 'https://api.eu-central-1.saucelabs.com/v2/performance/metrics/b6bee25245724ddca6b852a7ec49f155/regimes/?order_index=0&metric_names=speedIndex,domContentLoaded,lastVisualChange' | json_pp
Responses
200 | Success. | |
400 | Bad Request.May contain a specific error message, such as "at least one metric_names parameter is required." | |
404 | Job not found. |
{
"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/
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. |
- United States
- Europe
curl --location --request POST 'https://api.us-west-1.saucelabs.com/v2/performance/metrics/b6bee25245724ddca6b852a7ec49f155/regimes/acknowledge/?order_index=0' | json_pp
curl --location --request POST 'https://api.eu-central-1.saucelabs.com/v2/performance/metrics/b6bee25245724ddca6b852a7ec49f155/regimes/acknowledge/?order_index=0' | json_pp
Responses
201 | Success. | |
400 | Bad Request.May contain a specific error message, such as "at least one metric_names parameter is required." | |
404 | Job not found. |
A successful response returns no payload.