metabase

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


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


Solution

  • 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: