For the complete documentation index, see llms.txt.

Scenario endpoints

Use these endpoints to manage Speed Analysis Lab scenarios.

POST /v1/speed-analysis/scenario/list

Returns the list of scenarios.

Parameters
name  string  

String pattern to filter your scenarios and return only those that contain the pattern in their name

Request example

Terminal window
curl --location --request POST 'https://api.contentsquare.com/v1/speed-analysis/scenario/list' \
--header 'Authorization: Bearer <your_access_token>'
--data '{
"name": ""
}'

Response example

{
"payload": {
"scenarios": [
{
"id": 1,
"name": ""
}
]
},
"success": true
}

POST /v1/speed-analysis/scenario/report

Returns a scenario report.

Parameters
scenarioId  number  Required

Unique identifier of a scenario.

date  number  Required

Timestamp (in ms) indicating when the report was generated.

Request example

Terminal window
curl --location --request POST 'https://api.contentsquare.com/v1/speed-analysis/scenario/report' \
--header 'Authorization: Bearer <your_access_token>'
--data '{
"scenarioId": 0,
"date": 1542117158294
}'

Response example

{
"payload": {
"scenarioReport": {
"scenarioId": 0,
"name": "",
"resultId": 0,
"date": 0,
"viewOnTheWeb": "https://www.dareboost.com/scenario/[scenarioId]/report/[date]",
"summary": {
"fail": 0,
"unavailableResource": 0,
"browserError": 0,
"sum": {
"firstPaint": 0,
"request": 0,
"startRender": 0,
"lastByte": 0,
"weight": 0,
"domInteractive": 0,
"domContentLoadedEventStart": 0,
"domComplete": 0,
"loadEvent": 0,
"firstContentfulPaint": 0,
"loadTime": 0,
"loadEventStart": 0,
"firstConsistentlyInteractive": 0,
"visuallyComplete": 0,
"speedIndex": 0,
"firstByte": 0,
"domContentLoadedEventEnd": 0,
"domLoading": 0,
"largestContentfulPaint": 0,
"totalBlockingTime": 0,
"maxPotentialFirstInputDelay": 0,
"totalLongTasks": 0,
"lastLongTask": 0,
"nbLongTasks": 0,
"cumulativeLayoutShift": 0
},
"average": {
"firstPaint": 0,
"request": 0,
"startRender": 0,
"lastByte": 0,
"weight": 0,
"domInteractive": 0,
"domContentLoadedEventStart": 0,
"domComplete": 0,
"loadEvent": 0,
"firstContentfulPaint": 0,
"loadTime": 0,
"loadEventStart": 0,
"firstConsistentlyInteractive": 0,
"visuallyComplete": 0,
"speedIndex": 0,
"firstByte": 0,
"domContentLoadedEventEnd": 0,
"domLoading": 0,
"largestContentfulPaint": 0,
"totalBlockingTime": 0,
"maxPotentialFirstInputDelay": 0,
"totalLongTasks": 0,
"lastLongTask": 0,
"nbLongTasks": 0,
"cumulativeLayoutShift": 0
}
},
"steps": [
{
"stepId": 0,
"stepResultId": "",
"name": "",
"description": "",
"fail": 0,
"unavailableResource": 0,
"browserError": 0,
"timings": {
"navigationStart": 0,
"firstByte": 0,
"firstPaint": 0,
"domInteractive": 0,
"loadEvent": 0,
"startRender": 0,
"speedIndex": 0,
"visuallyComplete": 0,
"oldVisuallyComplete": 0,
"loadEventStart": 0,
"lastByte": 0,
"domLoading": 0,
"domContentLoadedEventStart": 0,
"domContentLoadedEventEnd": 0,
"domComplete": 0,
"firstContentfulPaint": 0,
"firstConsistentlyInteractive": 0,
"largestContentfulPaint": 0,
"totalBlockingTime": 0,
"maxPotentialFirstInputDelay": 0,
"totalLongTasks": 0,
"lastLongTask": 0,
"nbLongTasks": 0,
"cumulativeLayoutShift": 0
},
"weight": 0,
"requestsCount": 0,
"loadTime": 0,
"customTimings": [
{
"type": "",
"name": "",
"startTime": 0,
"duration": 0
}
]
}
]
}
},
"success": true
}

POST /v1/speed-analysis/scenario/reports

Returns the scenario reports.

Parameters
scenarioId  number  Required

Unique identifier of a scenario.

limit  number  

Limits the number of reports to return (default: 30). Set to 0 to get all scenario reports.

lastDays  number  

Retrieve reports from the last X days, where X is the value of this parameter.

dateFrom  ISO 8601 date string  

Retrieve audit executed after this date. Must be a date before dateTo.

ISO format in UTC (for example "2021-08-13T12:32:40.000Z") or with a time zone offset ("2021-08-13T12:32:40+02:00" or "2021-08-13T12:32:40%2B+02:00" when encoded in the URL).

dateTo  ISO 8601 date string  

Retrieve audit executed before this date. Must be a date after dateFrom.

ISO format in UTC (for example "2021-08-13T12:32:40.000Z") or with a time zone offset ("2021-08-13T12:32:40+02:00" or "2021-08-13T12:32:40%2B+02:00" when encoded in the URL).

error  boolean  

By default, all results are returned. Set to false to retrieve only executions without error. Set to true to retrieve only executions with error.

Request example

Terminal window
curl --location --request POST 'https://api.contentsquare.com/v1/speed-analysis/scenario/reports' \
--header 'Authorization: Bearer <your_access_token>'
--data '{
"scenarioId": 0,
"limit": 30,
"lastDays": 0,
"dateFrom": "2016-03-11T00:00:00.000+0100",
"dateTo": "2016-03-11T23:59:59.000+0100",
"error": false
}'

Response example

{
"payload": {
"scenario": {
"id": 0,
"name": "",
"reports": [
{
"resultId": 0,
"date": 0,
"viewOnTheWeb": "https://www.dareboost.com/scenario/[scenarioId]/report/[date]",
"summary": {
"fail": 0,
"unavailableResource": 0,
"browserError": 0,
"sum": {
"firstPaint": 0,
"request": 0,
"startRender": 0,
"lastByte": 0,
"weight": 0,
"domInteractive": 0,
"domContentLoadedEventStart": 0,
"domComplete": 0,
"loadEvent": 0,
"firstContentfulPaint": 0,
"loadTime": 0,
"loadEventStart": 0,
"firstConsistentlyInteractive": 0,
"visuallyComplete": 0,
"speedIndex": 0,
"firstByte": 0,
"domContentLoadedEventEnd": 0,
"domLoading": 0,
"largestContentfulPaint": 0,
"totalBlockingTime": 0,
"maxPotentialFirstInputDelay": 0,
"totalLongTasks": 0,
"lastLongTask": 0,
"nbLongTasks": 0,
"cumulativeLayoutShift": 0
},
"average": {
"firstPaint": 0,
"request": 0,
"startRender": 0,
"lastByte": 0,
"weight": 0,
"domInteractive": 0,
"domContentLoadedEventStart": 0,
"domComplete": 0,
"loadEvent": 0,
"firstContentfulPaint": 0,
"loadTime": 0,
"loadEventStart": 0,
"firstConsistentlyInteractive": 0,
"visuallyComplete": 0,
"speedIndex": 0,
"firstByte": 0,
"domContentLoadedEventEnd": 0,
"domLoading": 0,
"largestContentfulPaint": 0,
"totalBlockingTime": 0,
"maxPotentialFirstInputDelay": 0,
"totalLongTasks": 0,
"lastLongTask": 0,
"nbLongTasks": 0,
"cumulativeLayoutShift": 0
}
},
"steps": [
{
"stepId": 0,
"stepResultId": "",
"name": "",
"description": "",
"fail": 0,
"unavailableResource": 0,
"browserError": 0,
"timings": {
"navigationStart": 0,
"firstByte": 0,
"firstPaint": 0,
"domInteractive": 0,
"loadEvent": 0,
"startRender": 0,
"speedIndex": 0,
"visuallyComplete": 0,
"oldVisuallyComplete": 0,
"loadEventStart": 0,
"lastByte": 0,
"domLoading": 0,
"domContentLoadedEventStart": 0,
"domContentLoadedEventEnd": 0,
"domComplete": 0,
"firstContentfulPaint": 0,
"firstConsistentlyInteractive": 0,
"largestContentfulPaint": 0,
"totalBlockingTime": 0,
"maxPotentialFirstInputDelay": 0,
"totalLongTasks": 0,
"lastLongTask": 0,
"nbLongTasks": 0,
"cumulativeLayoutShift": 0
},
"weight": 0,
"requestsCount": 0,
"loadTime": 0,
"customTimings": [
{
"type": "",
"name": "",
"startTime": 0,
"duration": 0
}
]
}
]
}
]
}
},
"success": true
}

POST /v1/speed-analysis/scenario/step/report

Returns the report of the scenario step.

Parameters
stepId  string  Required

Unique identifier of the step result of a scenario. Refers to the stepResultId of /scenario/reports and /scenario/report.

Request example

Terminal window
curl --location --request POST 'https://api.contentsquare.com/v1/speed-analysis/scenario/step/report' \
--header 'Authorization: Bearer <your_access_token>'
--data '{
"stepId": ""
}'

Response example

{
"payload": {
"step": {
"id": "",
"previousStepId": "",
"nextStepId": "",
"stepResultId": 0,
"date": 0,
"timings": {
"firstByte": 0,
"firstPaint": 0,
"domInteractive": 0,
"loadEvent": 0,
"startRender": 0,
"speedIndex": 0,
"visuallyComplete": 0,
"oldVisuallyComplete": 0,
"loadEventStart": 0,
"lastByte": 0,
"domLoading": 0,
"domContentLoadedEventStart": 0,
"domContentLoadedEventEnd": 0,
"domComplete": 0,
"firstContentfulPaint": 0,
"firstConsistentlyInteractive": 0,
"largestContentfulPaint": 0,
"totalBlockingTime": 0,
"maxPotentialFirstInputDelay": 0,
"totalLongTasks": 0,
"lastLongTask": 0,
"nbLongTasks": 0,
"cumulativeLayoutShift": 0
},
"browserError": "[]",
"unavailableResource": "{}",
"actionsResult": [
{
"id": 0,
"time": 0,
"status": "",
"message": ""
}
],
"customTimings": [
{
"type": "",
"name": "",
"startTime": 0,
"duration": 0
}
]
}
},
"success": true
}

POST /v1/speed-analysis/scenario/report/har

Returns the HAR from the analysis.

Parameters
scenarioStepResultId  string  Required

Unique identifier of the scenario step result, obtained when launching a scenario execution.

Request example

Terminal window
curl --location --request POST 'https://api.contentsquare.com/v1/speed-analysis/scenario/report/har' \
--header 'Authorization: Bearer <your_access_token>'
--data '{
"scenarioStepResultId": ""
}'

Response example

{
"payload": {
"har": ""
},
"success": true
}