Endpoint
Method: GETPath:
/v1/earthquakes/range-timeAuthentication: Not required
Parameters
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”
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’.”
Minimum magnitude filter (optional).Validation:
- Must be a positive number if provided
- Returns 400 error if invalid: “‘minmag’ must be a positive 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.”
Page number for pagination. Must be a positive integer greater than 0.Validation:
- Must be > 0
- Returns 400 error if invalid
Number of results per page. Must be a positive integer greater than 0.Validation:
- Must be > 0
- Returns 400 error if invalid
Sort order for results. Prefix with
- for descending order.Allowed values:timeor-time(default: descending)magnitudeor-magnitudedepthor-depth
Comma-separated list of fields to include in response.Allowed values:
timemagnitudedepthplacecoordinates
Request Example
Response
Indicates if the request was successful
HTTP status code (200 for success)
HTTP status message (“OK” for success)
Human-readable message including date range and applied filters. Format: “Earthquake events between and [ with magnitude ≥ ][ and depth ≤ km]”
Array of GeoJSON Feature objects containing earthquake data
Request metadata containing method, path, and timestamp
Total count of earthquakes matching the query (after filters applied)
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 wherefeature.properties.mag >= magValuemaxdepth: Filters features wherefeature.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=timeandformat=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
Related Endpoints
- By Month - Specific month and year
- Recent Earthquakes - Year-to-date events
- Last Week - Last 7 days
- By Magnitude - Filter by magnitude only
- By Depth - Filter by depth only