Version 4.0.24.18 (latest)
Run a saved query.
This runs a previously saved query. You can use this on a query that was generated in the Looker UI or one that you have explicitly created using the API. You can also use a query 'id' from a saved 'Look'.
The 'result_format' parameter specifies the desired structure and format of the response.
Supported formats:
result_format | Description |
---|---|
json | Plain json |
json_bi | (RECOMMENDED) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query. See JsonBi type for schema |
json_detail | (LEGACY) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query |
csv | Comma separated values with a header |
txt | Tab separated values with a header |
html | Simple html |
md | Simple markdown |
xlsx | MS Excel spreadsheet |
sql | Returns the generated SQL rather than running the query |
png | A PNG image of the visualization of the query |
jpg | A JPG image of the visualization of the query |
Request
GET
/queries/{query_id}/run/{result_format}
Datatype
Description
Request
path
Expand HTTP Path definition...
query_id
Id of query
result_format
Format of result
query
Expand HTTP Query definition...
limit
Row limit (may override the limit in the saved query).
apply_formatting
Apply model-specified formatting to each result.
apply_vis
Apply visualization options to results.
cache
Get results from cache if available.
image_width
Render width for image formats.
image_height
Render height for image formats.
generate_drill_links
Generate drill links (only applicable to 'json_detail' format.
force_production
Force use of production models even if the user is in development mode. Note that this flag being false does not guarantee development models will be used.
cache_only
Retrieve any results from cache even if the results have expired.
path_prefix
Prefix to use for drill links (url encoded).
rebuild_pdts
Rebuild PDTS used in query.
server_table_calcs
Perform table calculations on query results
source
Specifies the source of this call.
Response
200: Query
Datatype
Description
(string)
400: Bad Request
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
404: Not Found
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
422: Validation Error
Datatype
Description
(object)
message
lock
Error details
errors
Expand ValidationErrorDetail definition...
field
lock
Field with error
code
lock
Error code
message
lock
Error info message
documentation_url
lock
Documentation link
documentation_url
lock
Documentation link
429: Too Many Requests
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
Examples
Python
Kotlin
https://github.com/looker-open-source/sdk-codegen/blob/main/kotlin/src/test/TestMethods.kt |
https://github.com/looker-open-source/sdk-codegen/blob/main/kotlin/src/test/TestMethods.kt |
TypeScript
Swift