Import API

Import from GeoNet

Import earthquake events from GeoNet FDSN Event Web Service.

Endpoint: POST /api/import/geonet

Request Body:

{
  "catalogueId": "550e8400-e29b-41d4-a716-446655440000",
  "catalogueName": "GeoNet - New Zealand",
  "startDate": "2024-01-01T00:00:00Z",
  "endDate": "2024-01-31T23:59:59Z",
  "minMagnitude": 3.0,
  "maxMagnitude": 10.0,
  "minDepth": 0,
  "maxDepth": 1000,
  "minLatitude": null,
  "maxLatitude": null,
  "minLongitude": null,
  "maxLongitude": null,
  "updateExisting": true
}

Note

For recent events use hours instead of startDate/endDate (e.g. "hours": 24 for the last 24 hours). Omit catalogueId to create a new catalogue using catalogueName.

Response: 200 OK

{
  "success": true,
  "catalogueId": "550e8400-e29b-41d4-a716-446655440000",
  "totalFetched": 45,
  "newEvents": 40,
  "updatedEvents": 5,
  "skippedEvents": 0,
  "errors": []
}

Error Responses: - 400 Bad Request: Invalid parameters - 500 Internal Server Error: Import failed

Get Import History

Get import history for a catalogue.

Endpoint: GET /api/import/history

Query Parameters:

Parameter

Type

Required

Default

Description

catalogueId

string

Yes

Catalogue UUID

limit

number

No

10

Number of records

Response: 200 OK

[
  {
    "id": "import-001",
    "catalogue_id": "550e8400-e29b-41d4-a716-446655440000",
    "start_time": "2024-10-24T12:00:00.000Z",
    "end_time": "2024-10-24T12:00:05.490Z",
    "total_fetched": 45,
    "new_events": 40,
    "updated_events": 5,
    "skipped_events": 0,
    "errors": null,
    "created_at": "2024-10-24T12:00:00.000Z"
  }
]