Skip to main content

API Status

Check the current status of Market Data services and historical uptime.

Making Requests

Use the api_status() method on the utilities resource to check API status:

api_status

public function api_status(): ApiStatus

Check the current status of Market Data services and historical uptime. The status is updated every 5 minutes. Historical uptime is available for the last 30 and 90 days.

Smart Caching

The SDK implements intelligent caching for API status to reduce unnecessary requests:

  • Fresh cache (< 4.5 min): Returns cached data immediately
  • Refresh window (4.5-5 min): Returns cached data and triggers async refresh
  • Stale cache (> 5 min): Blocks and fetches fresh data

Notes

  • This endpoint is public and does not require authentication.
  • The endpoint continues to respond even if the API is offline.

Returns

  • ApiStatus

    An ApiStatus response object containing service status and uptime information.

<?php

use MarketDataApp\Client;

$client = new Client();

// Check API status
$status = $client->utilities->api_status();

echo "Market Data API Status\n";
echo "======================\n";

foreach ($status->services as $service) {
$indicator = $service['status'] === 'online' ? '✓' : '✗';
echo sprintf("%s %s\n", $indicator, $service['name']);
}

echo "\nUptime:\n";
echo "30-day: " . number_format($status->uptime_30d, 2) . "%\n";
echo "90-day: " . number_format($status->uptime_90d, 2) . "%\n";

Output

Market Data API Status
======================
✓ Stock Quotes
✓ Stock Candles
✓ Options Chain
✓ Options Quotes
✓ Market Status

Uptime:
30-day: 99.98%
90-day: 99.95%

ApiStatus

class ApiStatus extends ResponseBase
{
public string $status;
public array $services;
public float $uptime_30d;
public float $uptime_90d;
public Carbon $updated;
}

Represents the API status and uptime information.

Properties

  • status (string): Response status ("ok").
  • services (array): Array of service status entries, each containing:
    • name (string): Service name
    • status (string): Service status ("online" or "offline")
  • uptime_30d (float): 30-day uptime percentage.
  • uptime_90d (float): 90-day uptime percentage.
  • updated (Carbon): When the status was last updated.