superset icon indicating copy to clipboard operation
superset copied to clipboard

Does Superset have an API to expose a Chart's JSON data?

Open CasperLiu opened this issue 8 years ago • 10 comments

Hello, Superset authors,

Make sure these boxes are checked before submitting your issue - thank you!

  • [x] I have checked the superset logs for python stacktraces and included it here as text if any
  • [x] I have reproduced the issue with at least the latest released version of superset
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

Superset 0.23.3

Expected results

So far, Superset is able to provide a iframe block for chart/dashboard display outside Superset GUI . This is good to integrate this into a website.

Beside iframe block, is there any other way, like RESTFUL API or Web Service , which could expose the data(such as JSON format) ?

PS: Superset chart indeed could provide a JSON output, but this needs a manual operation and couldn't provide JSON output automatically. Is there any interface to get the JSON output by RESTFUL API?

Thanks a lot in advance!

Actual results

We haven't seen an interface to dynamically expose data of a chart besides iframe block.

Steps to reproduce

This is a query of question, no need to reproduce.

Nice Regards, Jiaxu Liu 刘佳旭

CasperLiu avatar Mar 29 '18 06:03 CasperLiu

If the interface to expose a chart's data is not available, is there any plan or requirement for this API?

Thanks in advance!

Jiaxu

CasperLiu avatar Mar 29 '18 06:03 CasperLiu

You can find at /superset/explore/<datasource>/<id>/

zhaoyongjie avatar Mar 29 '18 06:03 zhaoyongjie

Flask App Builder (FAB) offers a CRUD REST API out of the box for all models. Check out:

/slicemodelview/api
/slicemodelview/api/read
/dashboardmodelview/api
/dashboardmodelview/api/read

http://flask-appbuilder.readthedocs.io/en/latest/quickhowto.html#rest-api

mistercrunch avatar Apr 05 '18 06:04 mistercrunch

Dear mistercrunch, yongjie

Thanks a lot for your valuable input! Indeed helps! I would close this ticket.

CasperLiu avatar Apr 13 '18 12:04 CasperLiu

HI , Any body can help me regarding ,access api http://0.0.0.0:8089/superset/explore_json/?form_data=%7B%22slice_id%22%3A49%7D with out login . Thanks, kranthi kumar.

iamcoolkranthi avatar Nov 05 '18 07:11 iamcoolkranthi

{message | "Access is Denied"

severity | "danger" }

iamcoolkranthi avatar Nov 05 '18 07:11 iamcoolkranthi

We've move to better urls a little while back. /chart/api/read, or if you want a single chart /chart/api/read?_flt_0_id=1

mistercrunch avatar Nov 05 '18 16:11 mistercrunch

jwt authentication in version 0.35.2 #9717

working

kalimuthu123 avatar May 02 '20 12:05 kalimuthu123

Dear mistercrunch, yongjie

Thanks a lot for your valuable input! Indeed helps! I would close this ticket.

I still don't get it how are you going to interface it with superset?

sedhha avatar Jul 27 '20 11:07 sedhha

For anyone who ended up here, this PR creates a new chart/{CHART_ID}/data endpoint to fetch a chart's JSON data.

vadivelselvaraj avatar Jul 23 '21 18:07 vadivelselvaraj