Endpoint
Method: GETPath:
/v1/earthquakes/last-weekAuthentication: Not required
Parameters
Page number for pagination. Must be a positive integer greater than 0.Validation:
- Must be > 0
- Returns 400 error: “The ‘page’ parameter must be a positive integer (e.g., ?page=2).”
Number of results per page. Must be a positive integer greater than 0.Validation:
- Must be > 0
- Returns 400 error: “The ‘limit’ parameter must be a positive integer greater than 0. Example: ?limit=50”
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. Format: “Earthquake events from the last 7 days ( to )”
Array of GeoJSON Feature objects containing earthquake data
Request metadata containing method, path, and timestamp
Total count of earthquakes in the last 7 days
Pagination details with page, totalPages, limit, and hasMore
Response Example
Error Responses
Invalid Limit Parameter
Invalid Page Parameter
Implementation Details
- Date Calculation:
today.getDate() - 7to get start date - Date Range: Last 7 days including today (e.g., Oct 30 to Nov 6)
- Sorting: Default sort is by time (most recent first:
-time) - Pagination: Manual pagination applied after fetching all events from INGV
- Data Source: INGV API with
orderby=timeandformat=geojson
Use Cases
- Weekly seismic activity reports
- Trend analysis and pattern detection
- Weekly email digests or newsletters
- Comparing recent activity to historical data
Related Endpoints
- Today’s Earthquakes - Only today’s events
- Recent Earthquakes - Year-to-date events
- By Date Range - Custom date range