Skip to main content
Fetches earthquake events within a specified date range (inclusive) with optional magnitude and depth filters. This endpoint is ideal for custom reports and specific incident investigations.

Endpoint

Method: GET
Path: /v1/earthquakes/range-time
Authentication: Not required

Parameters

string
required
Start date in ISO format (YYYY-MM-DD). Validation: - Must match format YYYY-MM-DD (e.g., “2024-01-01”) - Must be earlier than or equal to enddate
  • Returns 400 error if missing: “Both ‘startdate’ and ‘enddate’ parameters are required. Example: ?startdate=2024-01-01&enddate=2024-01-31” - Returns 400 error if invalid format: “Invalid date format. Use ISO format: YYYY-MM-DD. Example: ?startdate=2024-01-01”
string
required
End date in ISO format (YYYY-MM-DD).Validation:
  • Must match format YYYY-MM-DD
  • Must be equal to or after startdate
  • Returns 400 error if startdate > enddate: “‘startdate’ must be earlier than or equal to ‘enddate’.”
number
Minimum magnitude filter (optional). Validation: - Must be a positive number if provided - Returns 400 error if invalid: “‘minmag’ must be a positive number.”
number
Maximum depth filter in kilometers (optional). Validation: - Must be a positive number if provided - Returns 400 error if invalid: “‘maxdepth’ must be a positive number.”
integer
default:"1"
Page number for pagination. Must be a positive integer greater than 0.Validation:
  • Must be > 0
  • Returns 400 error if invalid
integer
default:"50"
Number of results per page. Must be a positive integer greater than 0.Validation:
  • Must be > 0
  • Returns 400 error if invalid
string
default:"-time"
Sort order for results. Prefix with - for descending order. Allowed values: - time or -time (default: descending) - magnitude or -magnitude - depth or -depth
string
Comma-separated list of fields to include in response. Allowed values: - time - magnitude - depth - place - coordinates

Request Example

Response

boolean
Indicates if the request was successful
integer
HTTP status code (200 for success)
string
HTTP status message (“OK” for success)
string
Human-readable message including date range and applied filters. Format: “Earthquake events between and [ with magnitude ≥ ][ and depth ≤ km]”
array
Array of GeoJSON Feature objects containing earthquake data
object
Request metadata containing method, path, and timestamp
integer
Total count of earthquakes matching the query (after filters applied)
object
Pagination details with page, limit, totalPages, and hasMore

Response Example

Error Responses

Missing Required Parameters

Invalid Date Format

Invalid Date Range

Invalid Filter Values

Implementation Details

  • Date Validation: Uses regex /^\d{4}-\d{2}-\d{2}$/ to validate ISO format
  • Date Comparison: Converts to Date objects to ensure startdate ≤ enddate
  • Filter Application:
    • minmag: Filters features where feature.properties.mag >= magValue
    • maxdepth: Filters features where feature.properties.depth <= depthValue
  • Filter Order: Filters applied after fetching all events from INGV
  • Pagination: Applied after filtering (counts filtered results)
  • Sorting: Default sort is by time (most recent first: -time)
  • Data Source: INGV API with orderby=time and format=geojson

Use Cases

  • Custom time-based reports
  • Incident investigations
  • Research studies requiring specific date ranges
  • Analyzing seismic activity during specific events
  • Filtering significant earthquakes by magnitude and depth