Skip to main content

Endpoint

GET https://api.terraquakeapi.com/stations/code

Description

Retrieves detailed information for a single seismic monitoring station based on its unique station code. The lookup is case-insensitive, meaning “ACATE”, “acate”, and “Acate” will all return the same result. Station codes follow FDSN naming conventions (e.g., “ACATE”, “IV.ACER”) and uniquely identify each monitoring station in the INGV network.

Use Cases

  • Station Lookup: Get complete details for a specific station
  • Validation: Verify station existence and current status
  • Deep Dive: Access full metadata for individual stations
  • Integration: Retrieve station info for event analysis workflows

Parameters

code
string
required
The unique station code to search for. Case-insensitive.Examples: “ACATE”, “IV.ACER”, “MONC”Format: Alphanumeric, may include periods for network prefix

Request Examples

curl "https://api.terraquakeapi.com/stations/code?code=ACATE"

Response Format

success
boolean
Indicates if the request was successful
code
integer
HTTP status code (200 for success, 404 if station not found)
status
string
HTTP status message
message
string
Human-readable message (e.g., “Station found with code ‘ACATE’”)
payload
array
Array containing the matched station object (single element)
codeStation
string
The station code that was searched for (uppercase)
meta
object
Request metadata including method, path, and timestamp

Station Object Structure

$
object
Station metadata attributes
code
string
Unique station code (uppercase)
name
string
Full station name including network prefix
restrictedStatus
string
Operational status: “open”, “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 applicable)
Latitude
float
Station latitude in decimal degrees (-90 to 90)
Longitude
float
Station longitude in decimal degrees (-180 to 180)
Elevation
float
Station elevation above sea level in meters
Site
object
Name
string
Human-readable site location name
CreationDate
string
ISO 8601 timestamp when the station record was created

Response Example

Successful Response

{
  "success": true,
  "code": 200,
  "status": "OK",
  "message": "Station found with code 'ACATE'",
  "payload": [
    {
      "$": {
        "code": "ACATE",
        "name": "IV.ACATE",
        "restrictedStatus": "open",
        "startDate": "2015-06-10T00:00:00"
      },
      "Latitude": 37.0287,
      "Longitude": 14.4983,
      "Elevation": 206.0,
      "Site": {
        "Name": "Acate (RG)"
      },
      "CreationDate": "2015-06-10T00:00:00",
      "Channel": [
        {
          "$": {
            "code": "HHE",
            "locationCode": "",
            "startDate": "2015-06-10T00:00:00"
          },
          "Latitude": 37.0287,
          "Longitude": 14.4983,
          "Elevation": 206.0,
          "Depth": 0.0,
          "Azimuth": 90.0,
          "Dip": 0.0,
          "Type": "CONTINUOUS",
          "SampleRate": 100.0
        }
      ]
    }
  ],
  "codeStation": "ACATE",
  "meta": {
    "method": "GET",
    "path": "/stations/code?code=ACATE",
    "timestamp": "2025-11-06T10:45:22.150Z"
  }
}

Error Responses

Missing Code Parameter

{
  "success": false,
  "code": 400,
  "status": "Bad Request",
  "message": "Parameter 'code' is required"
}

Station Not Found

{
  "success": false,
  "code": 404,
  "status": "Not Found",
  "message": "No station found with code 'INVALID123'"
}

Service Error

{
  "success": false,
  "code": 500,
  "status": "Internal Server Error",
  "message": "Invalid station data format received"
}

Case Insensitivity

The code parameter is case-insensitive. All of these requests return the same result:
# All equivalent
curl "https://api.terraquakeapi.com/stations/code?code=ACATE"
curl "https://api.terraquakeapi.com/stations/code?code=acate"
curl "https://api.terraquakeapi.com/stations/code?code=Acate"

Common Station Codes

Here are some example station codes from the INGV network:
CodeLocationStatus
ACATEAcate (RG)Open
ACERAcerenza (PZ)Open
ASSISIAssisi (PG)Open
MONCMontecilfone (CB)Open
NRCANorcia (PG)Open
PESAPesaro (PU)Open

Practical Example

Check if a station is operational before using it for analysis:
async function isStationOperational(stationCode) {
  try {
    const response = await fetch(
      `https://api.terraquakeapi.com/stations/code?code=${stationCode}`
    );
    const data = await response.json();
    
    if (!data.success) {
      console.log(`Station ${stationCode} not found`);
      return false;
    }
    
    const station = data.payload[0];
    const isOpen = station.$.restrictedStatus === 'open';
    
    console.log(`Station ${stationCode} is ${isOpen ? 'operational' : 'inactive'}`);
    return isOpen;
    
  } catch (error) {
    console.error('Error checking station:', error);
    return false;
  }
}

// Usage
await isStationOperational('ACATE');

Get All Stations

Browse all available stations

Active Stations

List all operational stations

GeoJSON Format

Get station location data for mapping

Statistics

View network statistics

Build docs developers (and LLMs) love