Retrieve SQL Runner query results

  • 18 December 2017
  • 8 replies

Hi all, I noticed that the only available functions for SQL Runner via API are “Get SQL Runner Query” and “Create SQL Runner Query”. Is it thus not possible to run a SQL Runner query and get its results?


Best answer by jay.hester 16 November 2018, 12:57

View original

8 replies

Hello Alson,

This is not possible at the moment. You can create a SQL runner query task, but there is no API to fetch the results of that query.

We have a case opened with Engineering in order to add this in upcoming releases.

Please let us know in case you have any further question.


That’d be great, thanks Diego!

Was there any further action to this?

Userlevel 3

Hey @awmatheson, we don’t have a release date for this feature but it has had a good bit of interest. I’ll let the engineering team know you’re also looking to have this functionality as well.

My workaround here is that from SQL runner I click “Explore” and then I get slug id from link and run it from API using query_for_slug and then run_query 🙂


Once a SQL runner query task has been made, is there any API link (maybe using the slug?) to get the results from that query?

@Joanna_Kochel Which Looker API were you using and what parameter did you put into run_query? I tried getting the slug and then run_query with a python API ( and slug ID as well as the SqlQuery object ( to no avail =’(

Hey grace_gee & marcoppenheimer,

Thanks for voicing your feedback and questions on this topic! This is something that has a lot of interest which our engineers are aware of and I have let them know your feedback on this!

Joanna’s approach is a great way to go in the meantime, what I would suggest and Joanna can correct me if she has an easier approach is the following:

  1. Generate your query using SQL runner

  2. Select the cog button beside ‘Run’ and choose ‘Explore’

  3. This will open up your query/results in an explore page

  4. Copy the string after the url param ‘qid=’ in your URL

  5. Open up the Looker API and click on ’ [Query : Run and Manage Queries]’

  6. Open up [sdk][query_for_slug(slug)] and paste in the copied url param string where it asks for slug. This will generate a response body and the first line should be an ID like this example: ( "id": 120164,)

  7. Open up [sdk][run_query(query_id, result_format)] and add the ID in query_id param and then in the result_format you can add csv.

Here are screenshots of some dummy data in my SQL Runner explore and then the same data in the API after following the above steps!

Hope this helps guys! 🙂