Is there a way to retrieve Metabase Questions Table JSON output via API?
Asked Answered
C

1

6

The Metabase (https://metabase.com/) Data Explorer web UI has the ability to create queries they call questions with various filters. The query results can be visualized in a variety of ways including a table and charts. The table results can also be downloaded as JSON. Is there a way to retrieve the JSON via the Metabase REST API?

I've tried a few of the endpoints in the Metabase API Reference with the ID in the URL of the Data Explorer without success.

API Reference: https://github.com/metabase/.../api-documentation.md

Casemaker answered 16/12, 2017 at 1:27 Comment(0)
C
10

This can be done using the following endpoint where :card-id is the numeric questionId in the Data Explorer URL after /question/.

POST /api/card/:card-id/query/:export-format

As an example:

  • Web URL: https://metabase.example.com/question/1
  • API URL: https://metabase.example.com/api/card/1/query/json
Casemaker answered 18/12, 2017 at 19:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.