Opportunities


Opportunities are the recommendations that the Lighthouse tests yield when running their audits. Read more about the Lighthouse audits here.

List opportunities

Gets a list of the overall opportunities for the entire website.

GET /{website-id}/opportunities

The result looks like this:

200 OK
{
"result": {
"list": {
"unused-javascript": {
"title": "Reduce unused JavaScript",
"category": "performance",
"description": "Reduce unused JavaScript and defer loading scripts until they are required to decrease bytes consumed by network activity. [Learn how to reduce unused JavaScript](https://developer.chrome.com/docs/lighthouse/performance/unused-javascript/).",
"startDate": "2023-03-17T01:12:20.519Z",
"pages": [
{
"id": "l2o71voacg",
"alias": "Blog overview",
"url": "https://pagevitals.com/blog/",
"device": "mobile"
},
{
"id": "qnd1exf4yo",
"alias": "Docs article",
"url": "https://pagevitals.com/docs/getting-started/the-first-test-results/",
"device": "mobile"
},
{
"id": "jtf0xtvwj4",
"alias": "Pricing",
"url": "https://pagevitals.com/pricing/",
"device": "mobile"
}
]
}
]
}
}

The result.list array shows the opportunities - each of them has these properties:

PropertyDescription
keyThe internal Lighthouse ID of the audit
titleThe display name of the audit
categoryperformance, accessibility, best_practices or seo
descriptionA longer description of what the audit is all about. Provided by Lighthouse.
startDateThe first time the opportunity was triggered
pagesAn array of the pages that the opportunity is valid for

Each page item represents a page-device combination and has these properties:

PropertyDescription
idThe internal ID of the page
deviceThe device of the page
aliasThe page alias
urlThe URL of the page