PHP: Get dashboard data as json

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

Solved Solved
0 2 804
1 ACCEPTED SOLUTION

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

View solution in original post

2 REPLIES 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_documentat...

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