> ## Documentation Index
> Fetch the complete documentation index at: https://docs-v2.ard.co/llms.txt
> Use this file to discover all available pages before exploring further.

# API Examples

> Example requests for querying MAMS registry and discovering archived runs

## Registry Metadata

### Get Complete Registry

```bash theme={null}
curl -u mams:archive2025 http://mams.devops.arabiaweather.com:8083/archives/meta
```

### Access Registry File Directly

```bash theme={null}
curl -u mams:archive2025 http://mams.devops.arabiaweather.com:8083/archives/registry.json
```

<Note>
  Both endpoints return the same registry data.
</Note>

## Discovering Available Runs

### List Available Runs for a Model and Date

```bash theme={null}
# List available runs for GFS on 2025-09-01
curl -u mams:archive2025 http://mams.devops.arabiaweather.com:8083/archives/GFS/2025/09/01/
```

**Response**: JSON directory listing showing run times (e.g., `00:00:00`, `06:00:00`, `12:00:00`, `18:00:00`)

### List Models Available

```bash theme={null}
curl -u mams:archive2025 http://mams.devops.arabiaweather.com:8083/archives/
```

### List Dates for a Model

```bash theme={null}
curl -u mams:archive2025 http://mams.devops.arabiaweather.com:8083/archives/GFS/
```

### List Months for a Model and Year

```bash theme={null}
curl -u mams:archive2025 http://mams.devops.arabiaweather.com:8083/archives/GFS/2025/
```

## Archive Server Examples

### Query Archive Server Directly

```bash theme={null}
# Query Mams.04 archive server
curl -u mams:archive2025 http://138.201.49.117:8083/archives/GFS/2025/09/01/
```

<Note>
  Archive servers don't have the `/archives/meta` endpoint.
</Note>

## Health Check

```bash theme={null}
curl http://mams.devops.arabiaweather.com:8083/health
```

**Response**: `200 OK` with plain text "OK"

## Complete Workflow

```bash theme={null}
# 1. Get registry to find which server has the data
curl -u mams:archive2025 http://mams.devops.arabiaweather.com:8083/archives/meta

# 2. List available dates for a model
curl -u mams:archive2025 http://mams.devops.arabiaweather.com:8083/archives/GFS/2025/

# 3. List available runs for a specific date
curl -u mams:archive2025 http://mams.devops.arabiaweather.com:8083/archives/GFS/2025/09/01/

# 4. Access specific run data (if needed)
curl -u mams:archive2025 http://mams.devops.arabiaweather.com:8083/archives/GFS/2025/09/01/12:00:00/
```

## Authentication

All endpoints (except `/health`) require HTTP Basic Authentication:

* **Username**: `mams`
* **Password**: `archive2025`

<Warning>
  These credentials are different from the ModMS query/web interface (`modms` / `CLandSky` on port 8081).
</Warning>

## Related Documentation

* [MAMS Nginx](/data-ai/modms/mams/nginx) - Nginx service overview
* [MAMS Registry](/data-ai/modms/mams/registry) - Registry system documentation
* [MAMS Overview](/data-ai/modms/mams) - MAMS system overview
