Stay organized with collections
Save and categorize content based on your preferences.
Version 4.0.25.14 (latest)
Get Async Query Results
Returns the results of an async query task if the query has completed.
If the query task is still running or waiting to run, this function returns 202 Accepted.
If the query task ID is invalid or the cached results of the query task have expired, this function returns 404 Not Found.
Use query_task(query_task_id) to check the execution status of the query task
Call query_task_results only after the query task status reaches "Complete".
You can also use query_task_multi_results() retrieve the
results of multiple async query tasks at the same time.
SQL Error Handling:
If the query fails due to a SQL db error, how this is communicated depends on the result_format you requested in create_query_task().
For json_detail result_format: query_task_results() will respond with HTTP status '200 OK' and db SQL error info
will be in the errors property of the response object. The 'data' property will be empty.
For all other result formats: query_task_results() will respond with HTTP status 400 Bad Request and some db SQL error info
will be in the message of the 400 error response, but not as detailed as expressed in json_detail.errors.
These data formats can only carry row data, and error info is not row data.
[[["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 Async Query Results\n\nVersion 4.0.25.14 (latest)\n\n### Get Async Query Results\n\nReturns the results of an async query task if the query has completed.\n\nIf the query task is still running or waiting to run, this function returns 202 Accepted.\n\nIf the query task ID is invalid or the cached results of the query task have expired, this function returns 404 Not Found.\n\nUse [query_task(query_task_id)](/looker/docs/reference/looker-api/latest/methods/Query/query_task) to check the execution status of the query task\nCall query_task_results only after the query task status reaches \"Complete\".\n\nYou can also use [query_task_multi_results()](/looker/docs/reference/looker-api/latest/methods/Query/query_task_multi_results) retrieve the\nresults of multiple async query tasks at the same time.\n\n#### SQL Error Handling:\n\nIf the query fails due to a SQL db error, how this is communicated depends on the result_format you requested in `create_query_task()`.\n\nFor `json_detail` result_format: `query_task_results()` will respond with HTTP status '200 OK' and db SQL error info\nwill be in the `errors` property of the response object. The 'data' property will be empty.\n\nFor all other result formats: `query_task_results()` will respond with HTTP status `400 Bad Request` and some db SQL error info\nwill be in the message of the 400 error response, but not as detailed as expressed in `json_detail.errors`.\nThese data formats can only carry row data, and error info is not row data.\n\nRequest\n-------\n\nGET /query_tasks/{query_task_id}/results \nDatatype \nDescription \nRequest \nHTTP Request \npath \nHTTP Path \nExpand HTTP Path definition... \nquery_task_id \nstring \nID of the Query Task\n\nResponse\n--------\n\n### 200: The query results.\n\nDatatype \nDescription \n(string) \nstring \n\n### 202: The query is not finished\n\nDatatype \nDescription \n(string) \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### 404: The Query Task Id was not found or the results have expired.\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"]]