Stay organized with collections
Save and categorize content based on your preferences.
Version 4.0.25.14 (latest)
Get a previously created query by id.
A Looker query object includes the various parameters that define a database query that has been run or
could be run in the future. These parameters include: model, view, fields, filters, pivots, etc.
Query results are not part of the query object.
Query objects are unique and immutable. Query objects are created automatically in Looker as users explore data.
Looker does not delete them; they become part of the query history. When asked to create a query for
any given set of parameters, Looker will first try to find an existing query object with matching
parameters and will only create a new object when an appropriate object can not be found.
This 'get' method is used to get the details about a query for a given id. See the other methods here
to 'create' and 'run' queries.
Note that some fields like 'filter_config' and 'vis_config' etc are specific to how the Looker UI
builds queries and visualizations and are not generally useful for API use. They are not required when
creating new queries and can usually just be ignored.
[[["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,["# Get Query\n\nVersion 4.0.25.14 (latest)\n\n### Get a previously created query by id.\n\nA Looker query object includes the various parameters that define a database query that has been run or\ncould be run in the future. These parameters include: model, view, fields, filters, pivots, etc.\nQuery *results* are not part of the query object.\n\nQuery objects are unique and immutable. Query objects are created automatically in Looker as users explore data.\nLooker does not delete them; they become part of the query history. When asked to create a query for\nany given set of parameters, Looker will first try to find an existing query object with matching\nparameters and will only create a new object when an appropriate object can not be found.\n\nThis 'get' method is used to get the details about a query for a given id. See the other methods here\nto 'create' and 'run' queries.\n\nNote that some fields like 'filter_config' and 'vis_config' etc are specific to how the Looker UI\nbuilds queries and visualizations and are not generally useful for API use. They are not required when\ncreating new queries and can usually just be ignored.\n\nRequest\n-------\n\nGET /queries/{query_id} \nDatatype \nDescription \nRequest \nHTTP Request \npath \nHTTP Path \nExpand HTTP Path definition... \nquery_id \nstring \nId of query \nquery \nHTTP Query \nExpand HTTP Query definition... \nfields \nstring \nRequested fields.\n\nResponse\n--------\n\n### 200: Query\n\nDatatype \nDescription \n(object) \n[Query](/looker/docs/reference/looker-api/latest/types/Query) \ncan \n*lock* \nobject \nOperations the current user is able to perform on this object \nid \n*lock* \nstring \nUnique Id \nmodel \nstring \nModel \nview \nstring \nExplore Name \nfields \nstring\\[\\] \npivots \nstring\\[\\] \nfill_fields \nstring\\[\\] \nfilters \nobject \nFilters will contain data pertaining to complex filters that do not contain \"or\" conditions. When \"or\" conditions are present, filter data will be found on the \\`filter_expression\\` property. \nfilter_expression \nstring \nFilter Expression \nsorts \nstring\\[\\] \nlimit \nstring \nRow limit. To download unlimited results, set the limit to -1 (negative one). \ncolumn_limit \nstring \nColumn Limit \ntotal \nboolean \nTotal \nrow_total \nstring \nRaw Total \nsubtotals \nstring\\[\\] \nvis_config \nobject \nVisualization configuration properties. These properties are typically opaque and differ based on the type of visualization used. There is no specified set of allowed keys. The values can be any type supported by JSON. A \"type\" key with a string value is often present, and is used by Looker to determine which visualization to present. Visualizations ignore unknown vis_config properties. \nfilter_config \nobject \nThe filter_config represents the state of the filter UI on the explore page for a given query. When running a query via the Looker UI, this parameter takes precedence over \"filters\". When creating a query or modifying an existing query, \"filter_config\" should be set to null. Setting it to any other value could cause unexpected filtering behavior. The format should be considered opaque. \nvisible_ui_sections \nstring \nVisible UI Sections \nslug \n*lock* \nstring \nSlug \ndynamic_fields \nstring \nDynamic Fields \nclient_id \nstring \nClient Id: used to generate shortened explore URLs. If set by client, must be a unique 22 character alphanumeric string. Otherwise one will be generated. \nshare_url \n*lock* \nstring \nShare Url \nexpanded_share_url \n*lock* \nstring \nExpanded Share Url \nurl \n*lock* \nstring \nExpanded Url \nquery_timezone \nstring \nQuery Timezone \nhas_table_calculations \n*lock* \nboolean \nHas Table Calculations\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### 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### 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\n\nExamples\n--------\n\n### Python\n\n\n### Ruby"]]