Solved

PHP: Get dashboard data as json

  • 21 October 2021
  • 2 replies
  • 41 views

Hello!

I’ve managed to get the PHP API for looker working, however, so far, I’ve only been able to create a render task to request an image of a dashboard which exists in looker.

I’d love to be able to fetch the actual data within the dashboard as json, so I can parse it myself to do cool stuff within our platform - rather than just static images.

I’m struggling to find any examples of this in PHP as all the documentation tends to focus on other languages.

Does anybody have any examples where I can provide a dashboard id and set of filters and receive a set of json for said dashboard?

 

Thanks in advance!

Matt

icon

Best answer by Lan 26 October 2021, 14:32

View original

2 replies

Userlevel 2

Hi @mattgill,

For dashboards, data can only be downloaded or scheduled in pdf, png, or csv; json is not supported unfortunately. A look, or a single query in an explore can be downloaded in json, so you could potentially find the query id for each of the tile in your dashboard, and download them as json instead. 

Or you could download csv and “transform” them to json in your local machine. I haven’t done it personally but I think it should be doable. 

Reference for download/scheduling dashboard:

https://docs.looker.com/sharing-and-publishing/downloading#downloading_data_from_a_dashboard

https://docs.looker.com/sharing-and-publishing/scheduling-and-sharing/scheduling#delivery_documentation_for_looker_developers

Many thanks @Lan !
My thoughts were heading towards scheduling CSV and mangling those together, thanks for the links!

Reply