Opportunities
Get list of opportunities
GET /{website-id}/pages/{page-id}/opportunities?device={device}
The result looks like this:
{
"result": {
"lighthouseVersion": "10.1.1",
"list": {
"csp-xss": {
"id": "csp-xss",
"title": "Ensure CSP is effective against XSS attacks",
"category": "best-practices"
},
"uses-long-cache-ttl": {
"id": "uses-long-cache-ttl",
"title": "Serve static assets with an efficient cache policy",
"displayValue": "6 resources found",
"category": "performance"
},
...
}
}
}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 |
| displayValue | Value summary shown next to the title, if applicable |
Opportunity details
GET /{website-id}/pages/{page-id}/opportunities/{opportunity-id}?device={device}
Note that the opportunity-id is the internal Lighthouse ID such as errors-in-console. The device is either desktop or mobile. The result uses the same format as the Lighthouse software, and the best way to find out more about the format is to visit the Lighthouse documentation.