Skip to main content

How to Get ReportStats

ReportStats are aggregations of report template filters on top of raw crawl data. For instance, the "Broken Pages" report template contains a filter similar to "httpStatusCode=404", and when a crawl finishes Lumar will generate the "Broken Pages" report with the basic value being the number of URLs that were broken (matched the report template filter).

The getReportStats query is the primary way to retrieve the high level ReportStat aggregations, and can also be used to get the actual URLs that are part of the report (see Get URL Data)

The following query will show you how to retrieve report data from the Lumar API.

Note: as with the getCrawls guide you will need to provide the Crawl ID for the id parameter.

Use the getReportStats query to retrieve high-level report data for selected ReportTemplates

The sample query below will return 3 properties (reportTemplate.name, reportTemplate.code, basic) for all report templates. For the comprehensive list, inspect type ReportStat.

query GetReportStats($crawlId: ObjectID!) {
getReportStats(
inputs: [
{ crawlId: $crawlId, reportTemplateCode: "200_pages" }
{ crawlId: $crawlId, reportTemplateCode: "301_redirects" }
]
) {
reportTemplateName
reportTemplateCode
basic
}
}

Try in explorer

Use the getCrawl query to retrieve high-level report data for all report templates

The sample query below will return 3 properties (reportTemplate.name, reportTemplate.code, basic) for all report templates. For the comprehensive list, inspect type ReportStat.

query GetCrawlReportStats($crawlId: ObjectID!) {
getCrawl(id: $crawlId) {
reportStats {
reportTemplateName
basic
}
}
}

Try in explorer