Dec 27 2025 - Houston Methodist's ER wait Times API
Dec 27 2025 - Houston Methodist's ER wait Times API

Dec 27 2025 - Houston Methodist's ER wait Times API


Programming

While browsing hospital websites recently, I stumbled upon something interesting: MyChart has publicly accessible API endpoints that reveal real-time emergency room wait times for Houston Methodist hospitals. What’s fascinating is that many hospitals don’t make this information easily available on their websites, yet the data is sitting there in plain sight. Maybe it’s because I don’t use the MyChart app, but I still think it was interesting to put in a more easy to read form.

Live ER Wait Times

Below is a live dashboard showing current wait times for all Houston Methodist emergency departments:

Wait times update automatically every 2 minutes

The Discovery

Through some random Google searches, I found that Houston Methodist’s MyChart system exposes ER wait time data through a simple endpoint. Rather than individual endpoints for each location, there’s actually a single URL that returns all locations:

https://mychart.houstonmethodist.org/mychart-prod/scheduling/edwaittime/edwaittimewidget

This endpoint returns HTML with wait times for all 20 Houston Methodist emergency departments, including:

  • Main hospital emergency departments
  • Satellite emergency care centers
  • Specialized EMS transportation services

Why Is This Interesting?

  1. Is this intentional? The endpoint isn’t linked from the main website prominently, suggesting it might be intended primarily for widget embedding rather than direct public access.

  2. Why leave it open? There’s no authentication required, no rate limiting (that I’ve encountered), and no robots.txt restrictions. This could be:

    • An oversight in API security
    • A deliberate choice for transparency
    • A technical limitation of their widget implementation

The Technical Implementation

The Data Format

The endpoint returns HTML designed for widget embedding. The structure looks like this:

<li class="depAndTime">
    <span class="depDisplayName">Houston Methodist Hospital Main Emergency Department</span>
    <div class="waitTimeSection">
        <span class="waitTimeNumber">12</span>
        <span class="waitTimeUnit"> min</span>
    </div>
</li>

For longer waits with hours, it includes multiple number/unit pairs:

<span class="waitTimeNumber">1</span>
<span class="waitTimeUnit"> hr</span>
<span class="waitTimeNumber">43</span>
<span class="waitTimeUnit"> min</span>

Building a Proxy with Cloudflare Workers

Since the endpoint doesn’t have CORS headers enabled, browsers block direct requests from web pages. The solution? A Cloudflare Worker that acts as a proxy.

Here’s the complete worker code:

const WAIT_TIME_URL = 'https://mychart.houstonmethodist.org/mychart-prod/scheduling/edwaittime/edwaittimewidget';

async function fetchAllWaitTimes() {
  const response = await fetch(WAIT_TIME_URL);
  const html = await response.text();
  
  const departments = [];
  const depRegex = /<li class="depAndTime">([\s\S]*?)<\/li>/g;
  
  let match;
  while ((match = depRegex.exec(html)) !== null) {
    const depHtml = match[1];
    
    // Extract name
    const nameMatch = depHtml.match(/<span class="depDisplayName">([^<]+)<\/span>/);
    const name = nameMatch[1].trim();
    
    // Extract time components
    const numbers = [...depHtml.matchAll(/<span class="waitTimeNumber">([^<]+)<\/span>/g)];
    const units = [...depHtml.matchAll(/<span class="waitTimeUnit">([^<]+)<\/span>/g)];
    
    let totalMinutes = 0;
    let formatted = '';
    
    for (let i = 0; i < numbers.length; i++) {
      const num = parseInt(numbers[i][1]);
      const unit = units[i][1].toLowerCase();
      
      formatted += numbers[i][1] + units[i][1];
      
      if (unit.includes('hr')) totalMinutes += num * 60;
      else if (unit.includes('min')) totalMinutes += num;
    }
    
    departments.push({ name, waitTime: totalMinutes, formatted });
  }
  
  return departments;
}

export default {
  async fetch(request) {
    const corsHeaders = {
      'Access-Control-Allow-Origin': '*',
      'Content-Type': 'application/json'
    };
    
    const departments = await fetchAllWaitTimes();
    
    return new Response(JSON.stringify({
      timestamp: new Date().toISOString(),
      totalLocations: departments.length,
      locations: departments
    }, null, 2), { headers: corsHeaders });
  }
};

The worker:

  • Fetches the HTML from Houston Methodist
  • Parses all department names and wait times
  • Returns clean JSON with CORS headers enabled
  • Can be deployed for free at Cloudflare Workers

Conclusion

I’m suprised that this webpage is publicly availble, and I think I would like to continue monitoring the data to determine trends over time. Do certain ERs have significant fluctuations in wait times? With this we could perform logistics optimization of our healthcare resources.

Have you found similar publicly accessible healthcare APIs? What do you think about transparency in ER wait times? The tension between public health information access and operational concerns is worth discussing.

© 2026 Duncan Salmon