Skip to main content

Overview

The TerraQuake API provides powerful location-based querying capabilities. You can search for earthquakes by:
  • Geographic coordinates with radius
  • Italian administrative regions
  • Custom bounding boxes
All location calculations use the Haversine formula for accurate distance computation on the Earth’s surface. Query earthquakes near a specific latitude/longitude point within a given radius.

Basic Usage

cURL
Python
JavaScript

Parameters

The default radius is 50 km. The API uses a bounding box for initial filtering, then applies precise Haversine distance calculation.

Finding Earthquakes Near Cities

Here are examples for major Italian cities:
Python

Italian Region Queries

Query earthquakes within Italian administrative regions using predefined bounding boxes.

Supported Regions

All 20 Italian regions are supported:
  • Valle d’Aosta (valle_d_aosta)
  • Piemonte (piemonte)
  • Lombardia (lombardia)
  • Liguria (liguria)
  • Trentino-Alto Adige (trentino_alto_adige)
  • Veneto (veneto)
  • Friuli-Venezia Giulia (friuli_venezia_giulia)
  • Emilia-Romagna (emilia_romagna)
  • Toscana (toscana) - Umbria (umbria) - Marche (marche) - Lazio (lazio) - Abruzzo (abruzzo) - Molise (molise)
  • Campania (campania)
  • Puglia (puglia)
  • Basilicata (basilicata)
  • Calabria (calabria)
  • Sicilia (sicilia)
  • Sardegna (sardegna)

Query by Region

cURL
Python
JavaScript
Region names must match the supported list. Use lowercase or the exact case shown above. The API performs case-insensitive matching.

Compare Multiple Regions

Python

Haversine Distance Calculation

The API uses the Haversine formula to calculate precise great-circle distances between coordinates.
1

Initial Bounding Box Filter

The API first creates a bounding box around the search point:
2

Fetch Candidate Events

Earthquakes within the bounding box are retrieved from the INGV API.
3

Precise Distance Filtering

Each earthquake is filtered using Haversine distance:

Client-Side Distance Calculation

You can also calculate distances client-side:
Python
JavaScript

Practical Examples

Build a Proximity Alert System

Python

Map Earthquakes by Region

Python

Find Nearest Earthquake to a Point

Python

Region Bounding Boxes

For reference, here are the bounding boxes used for each region:

Next Steps

Filtering Earthquakes

Learn about magnitude, depth, and time filters

Working with Stations

Query seismic monitoring station data