APIリファレンス
ブラウザ監査
実際のブラウザでページを読み込み、JSエラー、リンク切れ、フォームのアクセシビリティ、Core Web Vitalsを自律的に監査します。
ブラウザ監査は実際のブラウザでバックグラウンド実行されます。POST はすぐに
testId を返し、結果は約30〜90秒後に完成します。スキャンを開始
POST
/api/browser-testバックグラウンドで実行スキャンを開始し、すぐに ID を返します。スキャンはサーバー側で続行されます。
リクエストボディ
| フィールド | 説明 |
|---|---|
urlstring必須 | 開くページ (http:// または https:// から始まる)。 |
credentialIdstring任意 | サインインが必要なページをテストするための保存済みログイン (設定、保存済みログイン)。そのホストにのみ送信されます。 |
レスポンス (即時)
json
{ "testId": "clxyz..." }結果を取得
GET
/api/browser-test?id={testId}結果を待つスキャンを返します。完了するまで数秒ごとにポーリングしてください。
クエリパラメータ
| フィールド | 説明 |
|---|---|
idstring必須 | 上のリクエストが返した testId。 |
レスポンス
json
{
"id": "clxyz...",
"url": "https://example.com",
"status": "done",
"pagesVisited": 3,
"jsErrors": [{ "message": "TypeError: Cannot read properties of undefined", "type": "pageerror" }],
"brokenLinks": [{ "href": "https://example.com/old", "status": 404 }],
"formIssues": [{ "selector": "#email", "issue": "Input has no label" }],
"imgIssues": [{ "src": "/hero.png", "issue": "Missing alt text" }],
"metrics": { "loadTime": 1820, "totalImages": 14, "totalScripts": 9 },
"coreWebVitals": { ... },
"networkStats": { ... },
"a11yIssues": { "axe": { "violations": [] } },
"techStack": [{ "name": "React" }],
"suggestions": ["..."],
"aiSummary": "..."
}status は running の後、done または failed (errorMessage 付き) になります。問題のリストは done になった時点で入ります。
例
# 1. Start the scan: it answers at once with an id
curl -X POST https://www.scanverra.com/api/browser-test \
-H "X-API-Key: $SCANVERRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com"}'
# => {"testId":"clxyz..."}
# 2. Poll every few seconds until status is "done" (or "failed")
curl "https://www.scanverra.com/api/browser-test?id=clxyz..." \
-H "X-API-Key: $SCANVERRA_API_KEY"総合スコアなし
Webサイト監査やセキュリティスキャンと異なり、このエンドポイントは0〜100の数値を1つ返すのではなく、問題のリストを返します: jsErrors (message、type)、brokenLinks (href、status)、formIssues、imgIssues。パイプラインで判定するには、重要な項目がリストにある場合に失敗させます (例: status が 4xx や 5xx の brokenLinks)。CI/CD を参照してください。