Knowledge Drop

Can I download a dashboard as a CSV or PDF via the API?

  • 15 June 2021
  • 1 reply
  • 286 views

Userlevel 4

Last tested: Sep 27, 2019
 

For PDF: Yes. Use create_render_task() to schedule a job to render a dashboard (or other content) as a PDF file.
Use render_task(id) to check the status of the render task. When it completes, use render_task_results() to fetch the PDF file.

Note that PDF files are binary data, not JSON text. Client apps calling the render_task_results() may need to take special steps to fetch the HTTP response body as binary data, not as json text.

For CSV of dashboard data: Yes, with some work. We don't offer an API to run all queries for a dashboard and return all the results. What you can do is fetch the dashboard, iterate through its tiles and find all the queries it refers to, and run those queries via the API, in CSV format. Don't forget to apply filters!

If you are familiar with the SDKs, there are some examples there as well:

Python: https://github.com/looker-open-source/sdk-codegen/blob/master/examples/python/download_dashboard_pdf.py

Ruby: https://github.com/looker-open-source/sdk-codegen/blob/master/examples/ruby/download_dashboard.rb

Typescript: https://github.com/looker-open-source/sdk-codegen/blob/master/examples/typescript/downloadDashboard.ts

 

This content is subject to limited support.                

 

 


1 reply

@Department of Customer Love Hello! Could you please share the python script how to download data in csv format from dashboard as well on git? I’m quite new in Python and would be appreciate for your help! Thanks

Reply