🔗 Official Metabase API documentation: https://www.metabase.com/docs/latest/api-documentation
via Metabase docs
- to get a Auth token from Metabase, run:
curl -X POST \
-H "Content-Type: application/json" \
-d '{"username": "[email protected]", "password": "fakepassword"}' \
http://localhost:3000/api/session
use
Node 18(forfetch-support)
cp .env.example .env- add Metabase instance URL and API session token to
.env(without trailing slash/!) pnpm install/npm install
npm run tables (same as npm run table): returns overview of all schema:public DB tables
npm run table-120: hardcoded demo - returns table with id 120
npm run table <tableIdNr>: returns table with id nr
npm run cards (same as npm run query): returns sorted overview of all saved queries (cards)
npm run query-28: hardcoded demo - returns query result values as json for card id 28
npm run query <cardIdNr>: returns query result values as json for card id nr