# cqGMA Reference Information API

**Documentation version:** 1.1.0  
**Updated:** 2026-11-06  
**API implementation tested:** `all_read.php` 1.1.0

## Overview

The cqGMA Reference Information API looks up a reference in the GMA database and returns the available information as JSON. A single endpoint supports multiple award and reference programmes.

Main endpoint:

```text
https://www.gma.rocks/api/ref/?REFERENCE
```

No programme selector is required: supply the reference and the server determines its type. The response fields depend on the reference type and the information stored in the database.

### Reference types and examples

| Programme / type | Example reference | Verification |
| --- | --- | --- |
| GMA / summit | `DM/NS-108` | Tested |
| WWFF | `DLFF-0125` | Tested |
| POTA | `DE-0001` | Tested |
| IOTA island | `OC-045` | Tested |
| WCA / COTA castle | `DL-00734` | Tested |
| International castle | `ON-01457` | Tested |
| ILLW lighthouse | `DE0048` | Tested |
| ARLHS lighthouse | `FED 004`, `FED-004` | Tested |
| AGS (German municipality code) | `01001000` | Tested |
| WWBOTA (bunkers) | `B/HB-1351` | Tested |
| TOTA (towers) | `4XR-1001` | Tested |
| LLOTA (lakes) | `LLAR-0001` | Tested |
| MOTA (mills) | `X53965` | Documented previously; not retested for 1.1.0 |
| GMA Islands | `DAI/NI-010` | Documented previously; not retested for 1.1.0 |
| WLOTA | `518` | Documented previously; not retested for 1.1.0 |

The table lists confirmed examples and previously documented types; it is not an independently verified inventory of every reference category in the database.

## Calling the API

The original calling convention places the reference in the URL query string without a parameter name:

```text
https://www.gma.rocks/api/ref/?DM/NS-108
https://www.gma.rocks/api/ref/?DLFF-0125
https://www.gma.rocks/api/ref/?DE-0001
https://www.gma.rocks/api/ref/?01001000
https://www.gma.rocks/api/ref/?B/HB-1351
https://www.gma.rocks/api/ref/?4XR-1001
https://www.gma.rocks/api/ref/?LLAR-0001
https://www.gma.rocks/api/ref/?OC-045
https://www.gma.rocks/api/ref/?DL-00734
https://www.gma.rocks/api/ref/?DE0048
```

Version 1.1.0 also supports the named parameter `ref`:

```text
https://www.gma.rocks/api/ref/?ref=DM%2FNS-108
```

Use URL encoding for references containing spaces, slashes or other special characters. For example, `FED 004` should be sent as `FED%20004` (or with a properly encoded HTTP client).

### cURL examples

```bash
curl -sS -G --data-urlencode 'DM/NS-108' 'https://www.gma.rocks/api/ref/'
curl -sS -G --data-urlencode '01001000' 'https://www.gma.rocks/api/ref/'
curl -sS -G --data-urlencode 'B/HB-1351' 'https://www.gma.rocks/api/ref/'
curl -sS -G --data-urlencode 'FED 004' 'https://www.gma.rocks/api/ref/'
```

Named-parameter example:

```bash
curl -sS -G --data-urlencode 'ref=LLAR-0001' 'https://www.gma.rocks/api/ref/'
```

## Response format

Successful responses are JSON objects. Field names and available details vary between programmes. Common fields include `reftype`, `name`, `latitude`, `longitude` and `locator`. Many types also return `ref`, but some legacy types use programme-specific fields (for example, POTA uses `reference`, and castle records may use `wca` and `cota`). Client software should not assume every field exists.

The examples below show **selected fields from actual successful API responses**; they are shortened for readability. The real API may return additional database fields.

### Summit — `DM/NS-108`

```json
{
  "reftype": "Summit",
  "ref": "DM/NS-108",
  "name": "Piesberg",
  "height": "194",
  "latitude": "52.31775000",
  "longitude": "8.01925000",
  "locator": "JO42AH"
}
```

### WWFF — `DLFF-0125`

```json
{
  "reftype": "WWFF",
  "ref": "DLFF-0125",
  "name": "Nature Park TERRA vita",
  "latitude": "52.26815796",
  "longitude": "8.35510254",
  "locator": "JO42EG"
}
```

### POTA — `DE-0001`

```json
{
  "reftype": "POTA",
  "reference": "DE-0001",
  "name": "Berchtesgaden National Park",
  "entityID": "230",
  "locationDesc": "DE-BY",
  "latitude": "47.5528",
  "longitude": "12.9176",
  "locator": "JN67ln"
}
```

### AGS — `01001000`

AGS is an eight-digit German municipality identifier. Leading zeros are significant; always pass it as a string.

```json
{
  "reftype": "AGS",
  "ref": "01001000",
  "name": "Flensburg, Stadt",
  "ags": "01001000",
  "bundesland": "SH",
  "gemeinde": "Flensburg, Stadt",
  "ort": "Flensburg",
  "plz": "24937",
  "locator": "JO44RS",
  "latitude": "54.7825200",
  "longitude": "9.4375100"
}
```

### WWBOTA — `B/HB-1351`

```json
{
  "reftype": "WWBOTA",
  "ref": "B/HB-1351",
  "name": "A5221 Infanteriebunker, Flanke Wald «Hau»",
  "scheme": "HBBOTA",
  "bunker_type": "WW2",
  "locator": "JN47FJ",
  "latitude": "47.3812100",
  "longitude": "8.4389100"
}
```

### TOTA — `4XR-1001`

```json
{
  "reftype": "TOTA",
  "ref": "4XR-1001",
  "name": "The White Tower (Ramla)",
  "municipality": "Ramla",
  "region": "Central District",
  "elevation_m": "75.00",
  "tower_height_m": "30.00",
  "locator": "KM71KW",
  "latitude": "31.9275000",
  "longitude": "34.8656000"
}
```

### LLOTA — `LLAR-0001`

```json
{
  "reftype": "LLOTA",
  "ref": "LLAR-0001",
  "name": "Laguna del Diamante",
  "region": "Mendoza",
  "country_name": "Argentina",
  "country_code": "AR",
  "locator": "FF55du",
  "latitude": "-34.1639310",
  "longitude": "-69.6940260",
  "activation_count": 0
}
```

### IOTA island — `OC-045`

```json
{
  "reftype": "IOTA Island",
  "ref": "OC-045",
  "name": "TUTUILA ISLAND",
  "pfx": "KH8",
  "locator": "AH45QS"
}
```

### WCA / COTA castle — `DL-00734`

```json
{
  "reftype": "Castle",
  "wca": "DL-00734",
  "cota": "RPB-055",
  "name": "Burgruine Dalberg",
  "locator": "JN39MV",
  "location": "Dalberg"
}
```

### Lighthouses — `FED 004`, `FED-004`, `DE0048`

All three reference forms were tested and returned the Campen lighthouse. The `reftype` indicates which reference system was used for the lookup.

```json
{
  "reftype": "Lighthouse (ARLHS)",
  "illw": "DE0048",
  "arlhs": "FED 004",
  "name": "Campen",
  "latitude": "53.40569400",
  "longitude": "7.01561100",
  "locator": "JO33MJ"
}
```

Querying `DE0048` returns the same lighthouse with `"reftype": "Lighthouse (ILLW)"`.

## Unknown references and errors

From version 1.1.0, a reference that cannot be resolved returns a JSON error object rather than an empty response:

```json
{
  "error": "unknown_reference",
  "message": "Unknown reference",
  "ref": "XYZ-9999"
}
```

Unknown references use HTTP status `404`. Applications should check the HTTP status and/or the `error` field before using the returned data. The `404` status is part of the 1.1.0 implementation; the JSON body above was confirmed in a live test.

Example:

```bash
curl -sS -i -G --data-urlencode 'XYZ-9999' 'https://www.gma.rocks/api/ref/'
```

## Simple PHP example

This example uses the original query-string format and handles unknown references:

```php
<?php
function ref_info(string $ref): ?array
{
    $url = 'https://www.gma.rocks/api/ref/?' . rawurlencode($ref);
    $ch = curl_init($url);
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT => 15,
    ]);
    $json = curl_exec($ch);
    $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    if ($json === false || $status !== 200) {
        return null;
    }
    $data = json_decode($json, true);
    return is_array($data) && !isset($data['error']) ? $data : null;
}

$data = ref_info('DLFF-0125');
echo $data['name'] ?? 'Unknown reference';
```

Further calls:

```php
$ags     = ref_info('01001000');
$wwbota  = ref_info('B/HB-1351');
$tota    = ref_info('4XR-1001');
$llota   = ref_info('LLAR-0001');
$island  = ref_info('OC-045');
$castle  = ref_info('DL-00734');
$light   = ref_info('FED-004');
```

## Additional examples from earlier documentation

The following reference examples were already listed in the previous documentation. They have **not all been rechecked** against version 1.1.0.

| Type | Reference | URL |
| --- | --- | --- |
| Summit | `DA/NI-099` | `https://www.gma.rocks/api/ref/?DA/NI-099` |
| IOTA | `EU-022` | `https://www.gma.rocks/api/ref/?EU-022` |
| ILLW | `DE0136` | `https://www.gma.rocks/api/ref/?DE0136` |
| ARLHS | `FED-009` | `https://www.gma.rocks/api/ref/?FED-009` |
| WCA | `DL-00319` | `https://www.gma.rocks/api/ref/?DL-00319` |
| COTA | `NBN-047` | `https://www.gma.rocks/api/ref/?NBN-047` |
| MOTA | `X53965` | `https://www.gma.rocks/api/ref/?X53965` |
| GMA Islands | `DAI/NI-010` | `https://www.gma.rocks/api/ref/?DAI/NI-010` |
| WLOTA | `518` | `https://www.gma.rocks/api/ref/?518` |

### ARLHS reference formats

As documented previously, the API accepts spaces, hyphens and URL-encoded spaces. For example:

```text
FED 004
FED-004
FED%20004
```

## Programme-specific APIs

The following separate endpoints were documented previously. They are listed for backward compatibility and were not retested as part of the `/api/ref/` 1.1.0 tests.

| Programme | Endpoint example |
| --- | --- |
| Castles | `https://www.gma.rocks/api/castle/?DL-00136` |
| Islands | `https://www.gma.rocks/api/island/?EU-066` |
| Lighthouses | `https://www.gma.rocks/api/lighthouse/?FED-101` |
| Mills | `https://www.gma.rocks/api/mill/?X53965` |
| Summits | `https://www.gma.rocks/api/summit/?DA/NI-096` |
| WWFF | `https://www.gma.rocks/api/wwff/?DLFF-0126` |

### Summit-only PHP example

```php
<?php
$url = 'https://www.gma.rocks/api/summit/?' . rawurlencode('DM/NS-108');
$json = file_get_contents($url);
var_dump(json_decode($json, true));
```

## Interactive example

The previously documented dialogue application is available at:

```text
https://www.adventureradio.de/cqgma/reference_info.php
```

Its current availability has not been independently verified.

## Notes for developers

- References are handled case-insensitively by the reference lookup.
- Preserve leading zeros, especially for AGS codes.
- URL-encode references; in particular, encode spaces and slashes.
- The API returns UTF-8 JSON.
- Some numeric database values are returned as JSON strings; clients should not assume a uniform numeric type.
- Missing information can be `null`, an empty string, or an absent field depending on the programme.
- Existing reference types have different field naming conventions; use the programme-specific fields when needed.
- Some newly added responses include both `lat`/`lon` and `latitude`/`longitude` for compatibility.
- The general endpoint is intended to provide information about references in the GMA database; a full audit of every legacy programme is still pending.

## Version history

| Version / date | Changes |
| --- | --- |
| 1.1.0 — 2026-11-06 | Documented and tested AGS, WWBOTA, TOTA and LLOTA support; documented JSON error `unknown_reference`, HTTP 404 for unresolved references, and optional `ref=` parameter; added verified examples for summits, WWFF, POTA, islands, castles and lighthouses. |
| Earlier documentation | General reference lookup, programme-specific endpoints, PHP examples, and legacy reference types including MOTA, GMA Islands and WLOTA. Exact previous API version was not specified in the source document. |

## Contact

Website: https://www.gma.rocks  
Support: support@gma.rocks
