Skip to main content

Health Scores

Health scores provide a single numeric summary (0--100) of your site's performance within a report category such as SEO, Accessibility, or Site Speed. They are calculated after every crawl based on the pass/fail results of individual health score tests.

Querying a single health score

Use the getHealthScore query when you need the score for a specific report category and crawl. You can optionally scope the result to a segment.

query GetHealthScore($input: GetHealthScoreInput!) {
getHealthScore(input: $input) {
crawlId
healthScore
categoryWeight
createdAt
healthScoreTestResults(first: 10) {
nodes {
reportCategoryCode
passed
severity
}
}
}
}

Try in explorer

Querying multiple health scores for a crawl

To retrieve scores for several categories at once, use the healthScores field on a Crawl object.

query GetCrawlHealthScores($crawlId: ObjectID!) {
getCrawl(id: $crawlId) {
healthScores(reportCategoryCodes: ["seo", "accessibility", "site_speed"]) {
healthScore
reportCategoryCode
categoryWeight
}
}
}

Try in explorer

The getHealthScoreTrendForCrawl query returns historical health scores across multiple crawls, allowing you to chart improvements or regressions over time.

query GetHealthScoreTrend($crawlId: ObjectID!) {
getHealthScoreTrendForCrawl(crawlId: $crawlId, first: 10) {
nodes {
crawlId
healthScores {
healthScore
reportCategoryCode
}
}
totalCount
}
}

Try in explorer

Creating health score tests

Health score tests define the thresholds that determine whether a report category passes or fails. Use the createHealthScoreTest mutation to add a new test to a test suite.

mutation CreateHealthScoreTest($input: CreateHealthScoreTestInput!) {
createHealthScoreTest(input: $input) {
healthScoreTest {
absoluteThreshold
automaticThresholdEnabled
reportCategoryCode
severity
thresholdPredicate
thresholdType
}
}
}

Try in explorer

Key fields in CreateHealthScoreTestInput:

FieldDescription
reportCategoryCodeThe report category this test targets (e.g., "seo").
absoluteThresholdThe absolute number threshold for pass/fail.
relativeThresholdPercentage change threshold (used when thresholdType is Relative).
thresholdTypeEither Relative or Absolute.
severityFail or Warning -- controls how a breach is reported.
automaticThresholdEnabledWhen true, Lumar adjusts thresholds automatically based on historical results.

Automatic thresholds

When automaticThresholdEnabled is set to true, Lumar will adjust the test threshold based on previous crawl results. You can control the acceptance behaviour for improving and worsening results independently using:

  • automaticThresholdAcceptanceWhenTestResultIsBetter -- whether to automatically accept the new threshold when scores improve.
  • automaticThresholdAcceptanceWhenTestResultIsWorse -- whether to automatically accept the new threshold when scores regress.

Copying tests between projects

Use copyHealthScoreTests to duplicate health score tests from one project to another. Existing tests with the same reportCategoryCode in the target project will be overwritten.

mutation CopyHealthScoreTests($input: CopyHealthScoreTestsInput!) {
copyHealthScoreTests(input: $input) {
healthScoreTests {
reportCategoryCode
absoluteThreshold
severity
}
}
}

Try in explorer