How to get the Query ID for an Explore and Quick Start?

I’d like to be able to run queries defined by the quick start objects programmatically through the API to be able to test that all the quick starts are working properly. How can I get the query information from each quick start through the API in order to run the query through the API?

1 2 337
2 REPLIES 2

any update on this?

If you save a particular query as a Look, you can use the API to retrieve that Look's definition. That will include the query object. The query id can be used to rerun that query, or you can use the definition of the query to run a modified query.

The gazer project https://github.com/looker-open-source/gzr allows you to do this easily at the command line. Look at the `gzr look cat` command to get the json definition of the look, and the `gzr query runquery` command to run a query.

cat > query.json <<HERE
{
"model": "aviation",
"view": "aircraft_types",
"fields": ["aircraft_types.description","aircraft_types.count"],
"pivots": null,
"fill_fields": null,
"filters": null,
"filter_expression": null,
"sorts": [
"aircraft_types.description"
],
"limit": "500"
}
HERE
gzr query runquery "$(cat query.json)"