# API Status

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

> [!TIP]
> This endpoint will continue to respond with the current status of the Market Data API, even if the API is offline. This endpoint is public and does not require a token. This endpoint is also unversioned: it is served at `/status/`, not under `/v1/` like every other endpoint.

## Endpoint

```
https://api.marketdata.app/status/
```
### Method
```
GET
```
## Request Example

### HTTP

**GET** [https://api.marketdata.app/status/](https://api.marketdata.app/status/)

### JavaScript

```js title="statusCheck.js"
import { MarketDataClient } from "@marketdata/sdk";

const client = new MarketDataClient();

try {
  const s = await client.utilities.status();
  for (let i = 0; i < s.service.length; i++) {
    console.log(`${s.service[i]}: ${s.status[i]} (online=${s.online[i]})`);
  }
} catch (error) {
  console.error(error);
}
```

### TypeScript

```typescript title="statusCheck.ts"
import { MarketDataClient } from "@marketdata/sdk";
import type { ApiStatusResponse } from "@marketdata/sdk";

const client = new MarketDataClient();

try {
  const s: ApiStatusResponse = await client.utilities.status();
  for (let i = 0; i < s.service.length; i++) {
    console.log(`${s.service[i]}: ${s.status[i]} (online=${s.online[i]})`);
  }
} catch (error) {
  console.error(error);
}
```

### Python

```python title="statusCheck.py"
import requests

url = "https://api.marketdata.app/status/"
response = requests.get(url)

print(response.text)
```

### PHP

```php title="statusCheck.php"
use MarketDataApp\Client;

$client = new Client();
$status = $client->utilities->api_status();

// Display API status for all services
echo $status;
```

### Java

```java title="StatusCheck.java"
import com.marketdata.sdk.MarketDataClient;

public class StatusCheck {
  public static void main(String[] args) {
    try (MarketDataClient client = new MarketDataClient()) {
      client.utilities().status().values().forEach(System.out::println);
    }
  }
}
```

### Kotlin

```kotlin title="StatusCheck.kt"
import com.marketdata.sdk.MarketDataClient

fun main() {
    MarketDataClient().use { client ->
        client.utilities().status().values().forEach(::println)
    }
}
```

### C#

```csharp title="StatusCheck.cs"
using MarketDataApp;

using var client = await MarketDataClient.CreateAsync();

foreach (var service in (await client.Utilities.GetStatusAsync()).Values)
{
    Console.WriteLine(service);
}
```

## Response Example

```json
{
  "s": "ok",
  "service": [
    "/v1/funds/candles/",
    "/v1/markets/status/",
    "/v1/options/chain/",
    "/v1/options/expirations/",
    "/v1/options/lookup/",
    "/v1/options/quotes/",
    "/v1/stocks/bulkcandles/",
    "/v1/stocks/bulkquotes/",
    "/v1/stocks/candles/",
    "/v1/stocks/earnings/",
    "/v1/stocks/news/",
    "/v1/stocks/quotes/"
  ],
  "status": [
    "online",
    "online",
    "online",
    "online",
    "online",
    "online",
    "online",
    "online",
    "online",
    "online",
    "online",
    "online",
    "online",
    "online"
  ],
  "online": [true, true, true, true, true, true, true, true, true, true, true, true, true, true],
  "uptimePct30d": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
  "uptimePct90d": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
  "updated": [1734036832, 1734036832, 1734036832, 1734036832, 1734036832, 1734036832, 1734036832, 1734036832, 1734036832, 1734036832, 1734036832, 1734036832, 1734036832, 1734036832]
}
```

## Response Attributes

### Success

- **s** `string`

  Will always be `ok` when the status information is successfully retrieved.

- **service** `array[string]`

  The list of services being monitored.

- **status** `array[string]`

  The current status of each service (`online` or `offline`).

- **online** `array[boolean]`

  Boolean indicators for the online status of each service.

- **uptimePct30d** `array[number]`

  The uptime percentage of each service over the last 30 days.

- **uptimePct90d** `array[number]`

  The uptime percentage of each service over the last 90 days.

- **updated** `array[date]`

  The timestamp of the last update for each service's status.

### Error

- **s** `string`

  Status will be `error` if the request produces an error response.

- **errmsg** `string`
  An error message.

For more details on the API's status, visit the [Market Data API Status Page](https://www.marketdata.app/status/).
