How to get report rows with all metrics
warning
Reports
are deprecated, please refer to ReportStat metrics
The rowsWithAllMetrics
field in the Report
object is designed to simplify data retrieval in GraphQL queries.
It allows users to fetch all available metrics for each row within a report, without specifying each metric individually.
This feature is particularly useful in scenarios where comprehensive data analysis is required, and all metrics are of interest.
- Query
- Variables
- Response
- cURL
query GetAllMetrics($input: GetReportInputType!, $after: String) {
getReport(input: $input) {
reportTemplate {
name
code
}
rowsWithAllMetrics(first: 10, after: $after) {
totalCount
pageInfo {
hasNextPage
endCursor
}
nodes
}
}
}
{
"input": {
"crawlId": 1736276,
"reportTypeCode": "Basic",
"reportTemplateCode": "all_pages",
"segmentId": null
},
"after": null
}
{
"data": {
"getReport": {
"reportTemplate": {
"name": "All Pages",
"code": "all_pages"
},
"rowsWithAllMetrics": {
"totalCount": 75,
"pageInfo": {
"hasNextPage": true,
"endCursor": "MTA"
},
"nodes": [
{
"adultRating": false,
"amphtml": false,
"amphtmlReciprocate": false,
"amphtmlValid": false,
"bodyTagsInHeadCount": 0,
"breadcrumbSchemaCount": 0,
"canonicalLinksInCount": 0,
"canonicalizedPage": false,
"contentHtmlRatio": "0.11",
"contentSize": 3925,
"crawlDatetime": "2023-12-08T13:03:35.151Z",
"css": false,
// ....
},
// ...
]
}
}
}
}
curl -X POST -H "Content-Type: application/json" -H "apollographql-client-name: docs-example-client" -H "apollographql-client-version: 1.0.0" -H "x-auth-token: YOUR_API_SESSION_TOKEN" --data '{"query":"query GetAllMetrics($input: GetReportInputType!, $after: String) { getReport(input: $input) { reportTemplate { name code } rowsWithAllMetrics(first: 10, after: $after) { totalCount pageInfo { hasNextPage endCursor } nodes } } }","variables":{"input":{"crawlId":1736276,"reportTypeCode":"Basic","reportTemplateCode":"all_pages","segmentId":null},"after":null}}' https://api.lumar.io/graphql