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

# GET v1/stations/status/closed

> Retrieve historical and inactive seismic monitoring stations

## Endpoint

```
GET https://api.terraquakeapi.com/v1/stations/status/closed
```

## Description

Returns the list of stations that are no longer active. This includes stations with status "closed", "inactive", "deprecated", or "unavailable". These stations are no longer collecting or transmitting seismic data but remain in the database for historical reference and network evolution studies.

Useful for understanding the evolution of the INGV seismic network over time and identifying former monitoring locations.

## Use Cases

* **Historical Analysis**: Study network changes and station lifecycle
* **Coverage Evolution**: Track how monitoring coverage has changed
* **Research**: Analyze historical seismic data from decommissioned stations
* **Documentation**: Maintain complete records of all stations ever deployed
* **Legacy Data**: Reference stations from older earthquake catalogs

## Parameters

**limit** `integer` (default: 50)

Number of stations to return per page. Must be a positive integer greater than
0\. **Maximum**: 1000 **Example**: `?limit=100`

**page** `integer` (default: 1)

Page number for pagination. Must be a positive integer greater than 0.
**Example**: `?page=2`

## Request Examples

```bash cURL theme={null}
curl "https://api.terraquakeapi.com/v1/stations/status/closed?limit=100&page=1"
```

```javascript JavaScript theme={null}
const response = await fetch(
  'https://api.terraquakeapi.com/v1/stations/status/closed?limit=100',
);
const data = await response.json();

if (data.success) {
  console.log(`Total closed stations: ${data.totalStationsClosed}`);
  console.log(
    `Retrieved ${data.payload.length} stations on page ${data.pagination.page}`,
  );

  // Analyze closure reasons by status
  const statusCounts = {};
  data.payload.forEach((station) => {
    const status = station.$.restrictedStatus;
    statusCounts[status] = (statusCounts[status] || 0) + 1;
  });

  console.log('\nClosed stations by status:');
  console.log(statusCounts);

  // Find stations with end dates
  const withEndDates = data.payload.filter((s) => s.$.endDate);
  console.log(`\nStations with end dates: ${withEndDates.length}`);
}
```

```python Python theme={null}
import requests
from datetime import datetime

url = "https://api.terraquakeapi.com/v1/stations/status/closed"
params = {"limit": 100, "page": 1}

response = requests.get(url, params=params)
data = response.json()

if data.get('success'):
    print(f"Total closed stations: {data.get('totalStationsClosed')}")

    # Analyze operational lifespans
    lifespans = []
    for station in data.get('payload', []):
        start_date = station.get('$', {}).get('startDate')
        end_date = station.get('$', {}).get('endDate')

        if start_date and end_date:
            try:
                start = datetime.fromisoformat(start_date.replace('Z', '+00:00'))
                end = datetime.fromisoformat(end_date.replace('Z', '+00:00'))
                days = (end - start).days
                years = days / 365.25
                lifespans.append({
                    'code': station['$']['code'],
                    'years': round(years, 1),
                    'site': station['Site']['Name']
                })
            except:
                pass

    if lifespans:
        avg_years = sum(s['years'] for s in lifespans) / len(lifespans)
        print(f"\nAverage operational lifespan: {avg_years:.1f} years")

        print("\nShortest operational periods:")
        for station in sorted(lifespans, key=lambda x: x['years'])[:5]:
            print(f"{station['code']}: {station['years']} years - {station['site']}")
```

```php PHP theme={null}
<?php
$url = "https://api.terraquakeapi.com/v1/stations/status/closed?limit=100";
$response = file_get_contents($url);
$data = json_decode($response, true);

if ($data['success']) {
    echo "Total closed stations: " . $data['totalStationsClosed'] . "\n\n";

    // Group by closure status
    $statusGroups = [];
    foreach ($data['payload'] as $station) {
        $status = $station['$']['restrictedStatus'];
        if (!isset($statusGroups[$status])) {
            $statusGroups[$status] = [];
        }
        $statusGroups[$status][] = $station;
    }

    echo "Stations by closure status:\n";
    foreach ($statusGroups as $status => $stations) {
        echo "$status: " . count($stations) . "\n";
    }
}
?>
```

## Response Format

**success** `boolean`

Indicates if the request was successful

**code** `integer`

HTTP status code (200 for success)

**status** `string`

HTTP status message

**message** `string`

Human-readable description ("List of closed seismic stations")

**payload** `array`

Array of closed station objects (see Station Object structure)

**totalStationsClosed** `integer`

Total number of inactive/closed stations

**pagination** `object`

Pagination metadata

**page** `integer`

Current page number

**totalPages** `integer`

Total number of pages available

**limit** `integer`

Number of results per page

**hasMore** `boolean`

Whether more pages are available

**meta** `object`

Request metadata (method, path, timestamp)

## Station Object Structure

**\$** `object`

Station metadata attributes

**code** `string`

Unique station code

**name** `string`

Full station name with network prefix

**restrictedStatus** `string`

Status: "closed", "inactive", "deprecated", or "unavailable"

**startDate** `string`

ISO 8601 date when the station became operational

**endDate** `string`

ISO 8601 date when the station was closed (if available)

**Latitude** `float`

Station latitude in decimal degrees

**Longitude** `float`

Station longitude in decimal degrees

**Elevation** `float`

Station elevation in meters above sea level

**Site** `object`

**Name** `string`

Human-readable site location name

**CreationDate** `string`

ISO 8601 timestamp when the station record was created

## Response Example

```json theme={null}
{
  "success": true,
  "code": 200,
  "status": "OK",
  "message": "List of closed seismic stations",
  "payload": [
    {
      "$": {
        "code": "OLDST",
        "name": "IV.OLDST",
        "restrictedStatus": "closed",
        "startDate": "2005-03-15T00:00:00",
        "endDate": "2018-09-20T00:00:00"
      },
      "Latitude": 42.1234,
      "Longitude": 13.5678,
      "Elevation": 450.0,
      "Site": {
        "Name": "Old Station Location (AQ)"
      },
      "CreationDate": "2005-03-15T00:00:00"
    },
    {
      "$": {
        "code": "INACT",
        "name": "IV.INACT",
        "restrictedStatus": "inactive",
        "startDate": "2010-06-01T00:00:00",
        "endDate": "2020-12-31T00:00:00"
      },
      "Latitude": 41.8967,
      "Longitude": 12.4822,
      "Elevation": 125.0,
      "Site": {
        "Name": "Inactive Station (RM)"
      },
      "CreationDate": "2010-06-01T00:00:00"
    }
  ],
  "meta": {
    "method": "GET",
    "path": "/v1/stations/status/closed?limit=2&page=1",
    "timestamp": "2025-11-06T12:00:15.890Z"
  },
  "totalStationsClosed": 65,
  "pagination": {
    "page": 1,
    "totalPages": 33,
    "limit": 2,
    "hasMore": true
  }
}
```

## Error Responses

### Invalid Parameters

```json theme={null}
{
  "success": false,
  "code": 400,
  "status": "Bad Request",
  "message": "The 'limit' parameter must be a positive integer greater than 0. Example: ?limit=50"
}
```

### No Closed Stations Found

```json theme={null}
{
  "success": false,
  "code": 404,
  "status": "Not Found",
  "message": "No station found restrictedStatus closed"
}
```

## Closure Status Types

This endpoint returns stations with the following status values:

| Status | Description |
| - | - |
| **closed** | Station permanently decommissioned |
| **inactive** | Station temporarily not operational |
| **deprecated** | Station replaced or superseded |
| **unavailable** | Station data currently unavailable |

## Practical Examples

### Analyze Network Evolution

```javascript theme={null}
async function analyzeNetworkEvolution() {
  // Get closed stations
  const closedResp = await fetch(
    'https://api.terraquakeapi.com/v1/stations/status/closed?limit=500',
  );
  const closedData = await closedResp.json();

  // Get open stations
  const openResp = await fetch(
    'https://api.terraquakeapi.com/v1/stations/status/open?limit=500',
  );
  const openData = await openResp.json();

  console.log('INGV Network Evolution:');
  console.log(`Current active stations: ${openData.totalStationsOpen}`);
  console.log(`Historical closed stations: ${closedData.totalStationsClosed}`);
  console.log(
    `Total lifetime stations: ${openData.totalStationsOpen + closedData.totalStationsClosed}`,
  );

  const retentionRate = (
    (openData.totalStationsOpen /
      (openData.totalStationsOpen + closedData.totalStationsClosed)) *
    100
  ).toFixed(1);
  console.log(`Station retention rate: ${retentionRate}%`);
}
```

### Map Historical Stations

```javascript theme={null}
// Create a map layer showing closed station locations
const response = await fetch(
  'https://api.terraquakeapi.com/v1/stations/status/closed?limit=500',
);
const data = await response.json();

if (data.success) {
  const geojson = {
    type: 'FeatureCollection',
    features: data.payload.map((station) => ({
      type: 'Feature',
      geometry: {
        type: 'Point',
        coordinates: [station.Longitude, station.Latitude, station.Elevation],
      },
      properties: {
        code: station.$.code,
        name: station.$.name,
        site: station.Site.Name,
        status: station.$.restrictedStatus,
        startDate: station.$.startDate,
        endDate: station.$.endDate || 'Unknown',
      },
    })),
  };

  // Add to map as historical layer
  map.addSource('historical-stations', {
    type: 'geojson',
    data: geojson,
  });

  map.addLayer({
    id: 'historical-stations-circle',
    type: 'circle',
    source: 'historical-stations',
    paint: {
      'circle-radius': 5,
      'circle-color': '#94a3b8',
      'circle-opacity': 0.6,
      'circle-stroke-width': 1,
      'circle-stroke-color': '#64748b',
    },
  });
}
```

### Export Closure Timeline

```python theme={null}
import requests
import pandas as pd
from datetime import datetime

url = "https://api.terraquakeapi.com/v1/stations/status/closed"
params = {"limit": 500}

response = requests.get(url, params=params)
data = response.json()

if data.get('success'):
    stations = []
    for station in data['payload']:
        end_date = station.get('$', {}).get('endDate')
        if end_date:
            try:
                end_dt = datetime.fromisoformat(end_date.replace('Z', '+00:00'))
                stations.append({
                    'code': station['$']['code'],
                    'site': station['Site']['Name'],
                    'status': station['$']['restrictedStatus'],
                    'closure_year': end_dt.year,
                    'closure_date': end_date
                })
            except:
                pass

    df = pd.DataFrame(stations)

    # Closures by year
    print("Station closures by year:")
    print(df['closure_year'].value_counts().sort_index())

    # Export to CSV
    df.to_csv('closed_stations_timeline.csv', index=False)
    print(f"\nExported {len(df)} closed stations to CSV")
```

## Related Endpoints

> **[Active Stations](https://docs.terraquakeapi.com/api/stations/status-open.md)**
>
> Get currently operational stations

> **[Statistics](https://docs.terraquakeapi.com/api/stations/statistics.md)**
>
> Compare open vs closed counts

> **[Get All Stations](https://docs.terraquakeapi.com/api/stations/get-all.md)**
>
> Browse all stations (open and closed)

> **[Get Station by Code](https://docs.terraquakeapi.com/api/stations/by-code.md)**
>
> Look up specific closed station


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.