Skip to main content
Fetches all earthquake events that occurred in the last 7 days, including today. This endpoint is ideal for weekly summaries and trend analysis.

Endpoint

Method: GET
Path: /v1/earthquakes/last-week
Authentication: Not required

Parameters

integer
default:"1"
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).”
integer
default:"50"
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”
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. Format: “Earthquake events from the last 7 days ( to )”
array
Array of GeoJSON Feature objects containing earthquake data
object
Request metadata containing method, path, and timestamp
integer
Total count of earthquakes in the last 7 days
object
Pagination details with page, totalPages, limit, and hasMore

Response Example

Error Responses

Invalid Limit Parameter

Invalid Page Parameter

Implementation Details

  • Date Calculation: today.getDate() - 7 to 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=time and format=geojson

Use Cases

  • Weekly seismic activity reports
  • Trend analysis and pattern detection
  • Weekly email digests or newsletters
  • Comparing recent activity to historical data