On-Page & Lighthouse
Lighthouse Audit
Run a Google Lighthouse audit — performance, accessibility, SEO, and Core Web Vitals.
Pricing, live playground and use cases: Lighthouse API on YepAPI
POST
$0.05/call/v1/seo/onpage/lighthouseUsage
const res = await fetch('https://api.yepapi.com/v1/seo/onpage/lighthouse', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"url": "https://vercel.com"
}),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/seo/onpage/lighthouse \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://vercel.com"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
url | string | Yes | Full URL to audit | — |
device | string | No | desktop or mobile. Mobile is audited on a throttled phone profile, so scores and timings differ. | "desktop" |
include_audits | boolean | No | Also return every audit the page did not pass (see Audits). | false |
Response
{
"ok": true,
"data": {
"url": "https://www.wikipedia.org/",
"device": "mobile",
"performanceScore": 0.97,
"accessibilityScore": 0.96,
"bestPracticesScore": 0.96,
"seoScore": 1.0,
"firstContentfulPaint": 1120.4,
"largestContentfulPaint": 1960.2,
"cumulativeLayoutShift": 0.0,
"speedIndex": 1480.7,
"totalBlockingTime": 90.0,
"audits": [
{
"id": "mainthread-work-breakdown",
"category": "performance",
"title": "Minimize main-thread work",
"description": "Consider reducing the time spent parsing, compiling and executing JS.",
"score": 0.0,
"displayValue": "2.1 s",
"opportunity": false
},
{
"id": "cache-insight",
"category": "performance",
"title": "Use efficient cache lifetimes",
"description": "A long cache lifetime can speed up repeat visits to your page.",
"score": 0.5,
"displayValue": "Est savings of 27 KiB",
"opportunity": false
}
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.url | string | The URL that was audited |
data.device | string | desktop or mobile |
data.performanceScore | number | Lighthouse performance score (0-1) |
data.accessibilityScore | number | Lighthouse accessibility score (0-1) |
data.bestPracticesScore | number | Lighthouse best practices score (0-1) |
data.seoScore | number | Lighthouse SEO score (0-1) |
data.firstContentfulPaint | number | First Contentful Paint in milliseconds (FCP) |
data.largestContentfulPaint | number | Largest Contentful Paint in milliseconds (LCP) |
data.cumulativeLayoutShift | number | Cumulative Layout Shift score (CLS) |
data.speedIndex | number | Speed Index in milliseconds |
data.totalBlockingTime | number | Total Blocking Time in milliseconds (TBT) |
data.audits | object[] | Audits the page did not pass. Only with include_audits: true. |
Audits
With include_audits: true the response lists every scored audit below
Lighthouse's pass mark (a score under 0.9), grouped by category —
performance first, then accessibility, best practices and SEO. Passed,
informative and not-applicable audits are left out. An empty array means the
page passed everything.
| Field | Type | Description |
|---|---|---|
data.audits[].id | string | Lighthouse audit ID, e.g. mainthread-work-breakdown |
data.audits[].category | string | performance, accessibility, best-practices, or seo |
data.audits[].title | string | What the audit checks |
data.audits[].description | string | Why it matters, with a link to the fix |
data.audits[].score | number | 0–1; lower is worse |
data.audits[].displayValue | string | Lighthouse's one-line result, e.g. "Est savings of 27 KiB" |
data.audits[].opportunity | boolean | true when the audit carries an estimated load-time saving |
data.audits[].savingsMs | number | That estimated saving in milliseconds, when present |
Asking for audits does not change the price, and a second call for the same URL and device is served from the same run.
Under the Hood
Full Lighthouse audit. Scores and Core Web Vitals in one call.