Metabase API

Free to Use Varies (check documentation)

Overview

Metabase is an open-source business intelligence tool with a REST API that lets you query your databases, manage dashboards, and export data programmatically. You host it yourself (or use Metabase Cloud), and the API uses session token authentication after a simple login call. It is great for beginners who want to automate reports or embed analytics in their own apps.

💡

Beginner Tip

Your first step is always to get a session token via POST /api/session with your username and password. Store this token and include it as X-Metabase-Session in every subsequent request — tokens expire after 14 days by default.

Available Data

stock price and symbol
open/close/high/low values
trading volume
market cap
historical price data

Example Response

JSON Response
{
  "route": "Line 1",
  "origin": "Station A",
  "destination": "Station B",
  "departure": "08:30",
  "arrival": "09:15",
  "status": "On Time",
  "delays_min": 0
}

Field Reference

id Session token UUID; include this as X-Metabase-Session header in all subsequent requests
data For query results: contains "rows" (array of arrays) and "cols" (column metadata) describing the dataset
name Human-readable name of the dashboard, card, or database object returned
description Optional text description of the resource
creator_id User ID of the person who created this resource in Metabase

Implementation Example

const url = "https://www.metabase.com/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized on API requests Session token is missing, expired, or not passed in the correct header
Re-authenticate via POST /api/session to get a fresh token, then add it as the X-Metabase-Session header on all requests
Connection refused / ECONNREFUSED Metabase server is not running or the host/port is wrong
Start your Metabase instance (e.g., docker run -p 3000:3000 metabase/metabase) and confirm it is accessible at the expected URL
403 Forbidden on certain endpoints The authenticated user does not have admin or the required group permissions
Log in as an admin user or grant the relevant Metabase permissions to the account used for API calls

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 20/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 49ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →