How to run Lighthouse API in advanced mode
Siterelic Lighthouse API can accept the following parameters.
-
--screenEmulation
-
--screenEmulation.disabled
-
--emulatedUserAgent
-
--only-audits
-
--only-categories
-
--throttling-method
-
--extra-headers
-
--chrome-flags
-
--no-emulatedUserAgent
-
--blocked-url-patterns
-
--output
-
--preset
In order to use these parameters, pass them in aparameters JSON array in the body of the input.
Let's explore some of the examples.
Run only SEO audit
{ "url": "https://example.com/", "parameters": [ "--only-categories=seo" ] }
Save output in HTML format
{ "url": "https://example.com/", "parameters": [ "--output=html" ] }
Run a single audit
{ "url": "https://example.com/", "parameters": [ "--only-audits=image-alt" ] }
Run Lighthouse using Proxy
{ "url": "https://example.com/", "proxyCountry": "fr", "parameters": [ "--only-categories=seo" ] }
You can also use multiple parameters
{ "url": "https://example.com/", "parameters": [ "--only-categories=seo", "--output=html" ] }