Run SQL Interface Query
Stay organized with collections
Save and categorize content based on your preferences.
Version 4.0.25.14 (latest)
Run a saved SQL interface query.
This runs a previously created SQL interface query.
The 'result_format' parameter specifies the desired structure and format of the response.
Supported formats:
result_format |
Description |
json_bi |
Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query |
Request
GET
/sql_interface_queries/{query_id}/run/{result_format}
Expand HTTP Path definition...
query_id
integer
Integer id of query
result_format
string
Format of result, options are: ["json_bi"]
Response
200: Query Result
metadata
lock
Metadata about the query
Expand JsonBiMetadata definition...
big_query_metadata
lock
Metadata returned from Bigquery. Null if any other dialect.
Expand JsonBiBigQueryMetadata definition...
total_bytes_processed
lock
integer
Total bytes processed by the BigQuery job
backend_cache_hit
lock
boolean
Return whether or not query results were served from the BigQuery cache.
Expand JsonBiFields definition...
Expand JsonBiPivots definition...
key
lock
string
Pivot Column Value
data
lock
object
Pivot Data
sort_values
lock
object
Pivot Sort Values
is_total
lock
boolean
If the value is a total
has_subtotals
lock
boolean
If the query has subtotals
has_totals
lock
boolean
If the query has totals
columns_truncated
lock
string
If the query results hit the maximum column limit and additional columns were truncated
filter_expression
lock
string
Filter expression applied to the query results
filters
lock
object
Filters applied to the query results
sql
lock
string
Raw sql query. Null if user does not have permission to view sql
400: Bad Request
message
lock
string
Error details
documentation_url
lock
string
Documentation link
403: Permission Denied
message
lock
string
Error details
documentation_url
lock
string
Documentation link
404: Not Found
message
lock
string
Error details
documentation_url
lock
string
Documentation link
422: Validation Error
message
lock
string
Error details
Expand ValidationErrorDetail definition...
field
lock
string
Field with error
code
lock
string
Error code
message
lock
string
Error info message
documentation_url
lock
string
Documentation link
documentation_url
lock
string
Documentation link
429: Too Many Requests
message
lock
string
Error details
documentation_url
lock
string
Documentation link
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[],[],null,["# Run SQL Interface Query\n\nVersion 4.0.25.14 (latest)\n\n### Run a saved SQL interface query.\n\nThis runs a previously created SQL interface query.\n\nThe 'result_format' parameter specifies the desired structure and format of the response.\n\nSupported formats:\n\nRequest\n-------\n\nGET /sql_interface_queries/{query_id}/run/{result_format} \nDatatype \nDescription \nRequest \nHTTP Request \npath \nHTTP Path \nExpand HTTP Path definition... \nquery_id \ninteger \nInteger id of query \nresult_format \nstring \nFormat of result, options are: \\[\"json_bi\"\\]\n\nResponse\n--------\n\n### 200: Query Result\n\nDatatype \nDescription \n(object) \n[JsonBi](/looker/docs/reference/looker-api/latest/types/JsonBi) \nmetadata \n*lock* \n[JsonBiMetadata](/looker/docs/reference/looker-api/latest/types/JsonBiMetadata) \nMetadata about the query\nExpand JsonBiMetadata definition... \nbig_query_metadata \n*lock* \n[JsonBiBigQueryMetadata](/looker/docs/reference/looker-api/latest/types/JsonBiBigQueryMetadata) \nMetadata returned from Bigquery. Null if any other dialect.\nExpand JsonBiBigQueryMetadata definition... \ntotal_bytes_processed \n*lock* \ninteger \nTotal bytes processed by the BigQuery job \nbackend_cache_hit \n*lock* \nboolean \nReturn whether or not query results were served from the BigQuery cache. \nfields \n*lock* \n[JsonBiFields](/looker/docs/reference/looker-api/latest/types/JsonBiFields) \nFields\nExpand JsonBiFields definition... \ndimensions \n[JsonBiField](/looker/docs/reference/looker-api/latest/types/JsonBiField)\\[\\] \nmeasures \n[JsonBiField](/looker/docs/reference/looker-api/latest/types/JsonBiField)\\[\\] \npivots \n[JsonBiField](/looker/docs/reference/looker-api/latest/types/JsonBiField)\\[\\] \ntable_calculations \n[JsonBiTableCalc](/looker/docs/reference/looker-api/latest/types/JsonBiTableCalc)\\[\\] \npivots \n[JsonBiPivots](/looker/docs/reference/looker-api/latest/types/JsonBiPivots)\\[\\] \nExpand JsonBiPivots definition... \nkey \n*lock* \nstring \nPivot Column Value \ndata \n*lock* \nobject \nPivot Data \nsort_values \n*lock* \nobject \nPivot Sort Values \nis_total \n*lock* \nboolean \nIf the value is a total \nhas_subtotals \n*lock* \nboolean \nIf the query has subtotals \nhas_totals \n*lock* \nboolean \nIf the query has totals \ncolumns_truncated \n*lock* \nstring \nIf the query results hit the maximum column limit and additional columns were truncated \nfilter_expression \n*lock* \nstring \nFilter expression applied to the query results \nfilters \n*lock* \nobject \nFilters applied to the query results \nsql \n*lock* \nstring \nRaw sql query. Null if user does not have permission to view sql \nrows \nstring\\[\\] \n\n### 400: Bad Request\n\nDatatype \nDescription \n(object) \n[Error](/looker/docs/reference/looker-api/latest/types/Error) \nmessage \n*lock* \nstring \nError details \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\n### 403: Permission Denied\n\nDatatype \nDescription \n(object) \n[Error](/looker/docs/reference/looker-api/latest/types/Error) \nmessage \n*lock* \nstring \nError details \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\n### 404: Not Found\n\nDatatype \nDescription \n(object) \n[Error](/looker/docs/reference/looker-api/latest/types/Error) \nmessage \n*lock* \nstring \nError details \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\n### 422: Validation Error\n\nDatatype \nDescription \n(object) \n[ValidationError](/looker/docs/reference/looker-api/latest/types/ValidationError) \nmessage \n*lock* \nstring \nError details \nerrors \n[ValidationErrorDetail](/looker/docs/reference/looker-api/latest/types/ValidationErrorDetail)\\[\\] \nExpand ValidationErrorDetail definition... \nfield \n*lock* \nstring \nField with error \ncode \n*lock* \nstring \nError code \nmessage \n*lock* \nstring \nError info message \ndocumentation_url \n*lock* \nstring \nDocumentation link \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\n### 429: Too Many Requests\n\nDatatype \nDescription \n(object) \n[Error](/looker/docs/reference/looker-api/latest/types/Error) \nmessage \n*lock* \nstring \nError details \ndocumentation_url \n*lock* \nstring \nDocumentation link"]]