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

Knowledge Drop

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...

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....

This content is subject to limited support.                

Comments
Vladimir_Raf
New Member

@LookerExperts 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

danieldiniz
Bronze 2
Bronze 2
Rodrigo_Pizzano
New Member

@danieldiniz hello! 

I went to that Looker Helpcenter example but the "import looker" doesn't work. Do you know if now the only option is to use "import looker_sdk" as shown in the GitHub example?

Thanks in advance.

vishnuprasadb
New Member

@LookerExperts / @danieldiniz - Is there a way where only CSV can be downloaded of a looker dashboard? Can you please provide some help links or code examples for the same?
 

Neelam2
New Member

@vishnuprasadb  I know this is a 7-month-old issue, but did you find out, how to download the dashboard in CSV format? links or code examples

Version history
Last update:
‎06-14-2021 05:56 PM
Updated by: