SeerMarTech 文档控制台

Lighthouse 审计

POST/v3/on_page/lighthouse/live/json

对指定 URL 运行 Lighthouse 审计,返回性能、可访问性、最佳实践、SEO 四项评分及详细指标。

参考价:¥0.0640 / 次(实际以请求返回为准)

请求体

参数类型必填说明
urlstring目标 URL
for_mobileboolean移动端模拟,默认 true

请求示例

curl

curl -X POST "https://api.seermartech.cn/v3/on_page/lighthouse/live/json" \ -H "Authorization: Bearer smt_live_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '[{"url": "https://example.com", "for_mobile": true}]'

Python

import requests resp = requests.post( "https://api.seermartech.cn/v3/on_page/lighthouse/live/json", headers={"Authorization": "Bearer smt_live_YOUR_KEY"}, json=[{"url": "https://example.com", "for_mobile": True}], timeout=120, ) result = resp.json()["tasks"][0]["result"][0] categories = result.get("categories", {}) for name, cat in categories.items(): print(name, cat.get("score"))

TypeScript

const resp = await fetch("https://api.seermartech.cn/v3/on_page/lighthouse/live/json", { method: "POST", headers: { Authorization: "Bearer smt_live_YOUR_KEY", "Content-Type": "application/json" }, body: JSON.stringify([{ url: "https://example.com", for_mobile: true }]), }); const result = (await resp.json()).tasks[0].result[0]; console.log(result.categories);

响应评分

类别说明
performance加载性能
accessibility可访问性
best-practices最佳实践
seoSEO 基础项

业务场景