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:
Property | Description |
---|---|
key | The internal Lighthouse ID of the audit |
title | The display name of the audit |
category | performance , accessibility , best_practices or seo |
description | A longer description of what the audit is all about. Provided by Lighthouse. |
startDate | The first time the opportunity was triggered |
pages | An array of the pages that the opportunity is valid for |
Each page item represents a page-device combination and has these properties:
Property | Description |
---|---|
id | The internal ID of the page |
device | The device of the page |
alias | The page alias |
url | The URL of the page |