v1 · stable

    Data API Documentation

    REST + JSON. Bearer auth. Monthly quotas.

    Authentication

    All requests require a Bearer token. Request one at /data-api.

    Authorization: Bearer mw_live_xxxxxxxxxxxxxxxx

    Invalid or revoked keys return 401. Exceeded monthly quota returns 429 with the limit in the response.

    Base URL

    https://tupyuovacwrzxvvfgitm.supabase.co/functions/v1/data-api-v1

    Quick start

    curl

    curl -H "Authorization: Bearer $MW_API_KEY" \
      "https://tupyuovacwrzxvvfgitm.supabase.co/functions/v1/data-api-v1/shortages?status=active&limit=50"

    JavaScript / TypeScript

    const res = await fetch(
      "https://tupyuovacwrzxvvfgitm.supabase.co/functions/v1/data-api-v1/coverage?province=Ontario&medication=metformin",
      { headers: { Authorization: `Bearer ${process.env.MW_API_KEY}` } }
    );
    const { data, quota } = await res.json();

    Python

    import os, requests
    r = requests.get(
      "https://tupyuovacwrzxvvfgitm.supabase.co/functions/v1/data-api-v1/coverage-changes",
      headers={"Authorization": f"Bearer {os.environ['MW_API_KEY']}"},
      params={"since": "2026-06-01T00:00:00Z"},
    )
    print(r.json())

    Endpoints

    GET
    /shortages

    Canadian drug shortages from Health Canada, with status and recent change timestamps.

    Query parameters

    statusFilter: active, anticipated, resolved
    limitMax 500. Default 100.

    Sample response

    {
      "data": [
        {
          "id": "uuid",
          "drug_name": "Amoxicillin 500mg",
          "company": "Apotex",
          "status": "active",
          "shortage_reason": "Manufacturing delay",
          "anticipated_end_date": "2026-09-01",
          "first_seen_at": "2026-04-12T10:21:00Z",
          "last_status_change_at": "2026-06-01T08:30:00Z"
        }
      ],
      "count": 1,
      "quota": { "used": 12, "limit": 1000 }
    }

    GET
    /coverage

    Provincial formulary status per medication/province with copay and notes.

    Query parameters

    provinceExact province name (e.g. Ontario)
    medicationSubstring match on medication name
    limitMax 500. Default 100.

    Sample response

    {
      "data": [
        {
          "province": "Ontario",
          "formulary_status": "covered",
          "copay_estimate": "$2 - $6.11",
          "notes": "Ontario Drug Benefit eligible",
          "last_verified": "2026-06-10T12:00:00Z",
          "medication": { "name": "Metformin", "slug": "metformin" }
        }
      ],
      "count": 1
    }

    GET
    /coverage-changes

    Recent provincial coverage status changes — designed for change-detection webhooks.

    Query parameters

    sinceISO timestamp. Returns changes detected after this time.
    limitMax 500. Default 100.

    Sample response

    {
      "data": [
        {
          "medication_name": "Ozempic",
          "province": "British Columbia",
          "old_status": "special_authorization",
          "new_status": "covered",
          "notes": "BC PharmaCare update",
          "detected_at": "2026-06-12T14:02:00Z"
        }
      ],
      "count": 1
    }

    Rate limits & SLA

    Trial: 1,000 calls / month. Clinic: 50,000 / month. Enterprise: custom + SLA.

    Quota window: calendar month UTC, auto-resets on the 1st.

    Every successful response includes quota.used and quota.limit.

    Source of truth

    Shortage data: Drug Shortages Canada (Health Canada). Coverage data: Provincial formulary publications + verified updates. Pharmacy prices: indicative cash & insurance snapshots.