Get audit
Get the lighthouse audit for a project update.
Request
GET or POST https://api.wattspeed.com/v1/audit
Headers
Your API token.
Parameters
The project's URL - should be URL encoded.
The UTC date and time of when a snapshot was generated - should be in ISO-8601 format: yyyy-MM-dd'T'HH:mm:ss
.
Note: To use a date from the Snapshot view in Wattspeed, it may need to be converted to UTC from your local datetime.
Use this to filter by device.
Allowed values: mobile
, desktop
.
Use this to filter by location. When passing multiple locations, include each location in a different parameter using the same name. Example: location=s_carolina&location=tokyo
.
Allowed values: s_carolina
, los_angeles
, frankfurt
, london
, tokyo
, sao_paulo
.
Example request
GET
https://api.wattspeed.com/v1/audit?url=https://wattspeed.com&date=2022-08-01T00:37:21&location=s_carolina&location=london
POST
{
"url": "https://wattspeed.com",
"date": "2022-08-01T00:37:21",
"location": ["s_carolina", "london"]
}
Responses
- 200
- 400
- 401
- 404
- 405
- 406
- 415
- 500
{
"desktop": {
"s_carolina": {
"lighthouse": {
...LIGHTHOUSE_OBJECT,
"crux": {
"url": {
...CRUX_URL_OBJECT
},
"origin": {
...CRUX_ORIGIN_OBJECT
}
},
"date": "2022-08-01T00:37:21", // The UTC date and time for when the audit was generated
"elementCount": 221 // The total number of HTML elements
},
"median": 1,
"locations": [
"s_carolina",
"frankfurt"
],
"defaultLocation": "s_carolina"
}
},
"mobile": {
"london": {
"lighthouse": {
...LIGHTHOUSE_OBJECT,
"crux": {
"url": {
...CRUX_URL_OBJECT
},
"origin": {
...CRUX_ORIGIN_OBJECT
}
},
"date": "2022-08-01T00:37:21", // The UTC date and time for when the audit was generated
"elementCount": 221 // The total number of HTML elements
},
"median": 1,
"locations": [
"london",
"sao_paulo"
],
"defaultLocation": "london"
}
}
}
More information on the actual properties of the lighthouse object can be found here. The CrUX object contains the CWV data for both URL and origin (if exists). The properties of the CrUX URL and origin objects can be found here.
The message
and errors
are subject to change and may include more info than listed here.
{
"status": "BAD_REQUEST",
"message": "Required request header 'Authorization' is not present",
"errors": [
"Required request header 'Authorization' is not present"
]
}
The message
and errors
are subject to change and may include more info than listed here.
{
"status": "UNAUTHORIZED",
"message": "API token not valid. Please enter a valid API token",
"errors": [
"API token not valid. Please enter a valid API token"
]
}
The message
and errors
are subject to change and may include more info than listed here.
If the provided URL does not match with the URL of one of your projects, you will receive the following message:
{
"status": "NOT_FOUND",
"message": "Project not found",
"errors": [
"Project not found"
]
}
If no project update was triggered on the specified date and no audit was generated, you will receive the following message:
{
"status": "NOT_FOUND",
"message": "Audit not found",
"errors": [
"Audit not found"
]
}
The message
and errors
are subject to change and may include more info than listed here.
{
"status": "METHOD_NOT_ALLOWED",
"message": "Request method 'PUT' not supported",
"errors": [
"PUT method is not supported for this request. Supported methods are GET, POST"
]
}
The message
and errors
are subject to change and may include more info than listed here.
{
"status" : "NOT_ACCEPTABLE",
"message" : "No acceptable representation",
"errors" : [
"Media type is not supported. Supported media type is application/json"
]
}
The message
and errors
are subject to change and may include more info than listed here.
{
"status" : "UNSUPPORTED_MEDIA_TYPE",
"message" : "Content-Type 'application/x-www-form-urlencoded' is not supported",
"errors" : [
"application/x-www-form-urlencoded media type is not supported. Supported media type is application/json"
]
}
The message
and errors
are subject to change and may include more info than listed here.
{
"status": "INTERNAL_SERVER_ERROR",
"message": "Something went wrong, please try again",
"errors": [
"Something went wrong, please try again"
]
}