Overview
The TerraQuake API provides multiple filtering methods to help you find exactly the earthquake data you need. This guide covers all available filtering options and when to use each one.Filter Types
Time-based Filters
Time filters are the most common way to query earthquake data.- Today's Events
- Recent Events
- Last Week
- Specific Month
- Date Range
Returns all earthquakes that occurred today.
cURL
Python
JavaScript
Magnitude Filtering
Filter earthquakes by minimum magnitude to focus on significant events.cURL
Python
JavaScript
The
mag parameter represents the minimum magnitude threshold. Only
earthquakes greater than this value will be returned.Depth Filtering
Filter earthquakes by minimum depth to study shallow or deep events.cURL
Python
JavaScript
Region Filtering
Filter earthquakes by Italian region using predefined bounding boxes.cURL
Python
JavaScript
See the Location Queries guide for the complete
list of supported Italian regions.
Combining Multiple Filters
The/earthquakes/range endpoint supports combining time, magnitude, and depth filters.
1
Define your criteria
Determine what filters you need:
- Time range (required)
- Minimum magnitude (optional)
- Maximum depth (optional)
2
Build the query
Python
JavaScript
3
Process results
Python
Common Use Cases
Find Recent Major Earthquakes
Python
Earthquakes in Specific Region Above Threshold
Python
Deep vs Shallow Earthquakes
Python
Performance Tips
Use Pagination
Always use
limit and page parameters to avoid large responses:Sort Results
Sort by relevant fields to get the most important data first:
bash ?sort=-magnitude # Largest first ?sort=-time # Most recent first Select Fields
Request only the fields you need:
bash ?fields=time,magnitude,place Cache Results
Cache responses for time-based queries that don’t change:
Filter Comparison Table
Next Steps
Location Queries
Learn about coordinate-based and radius searches
Best Practices
Optimize your API usage and error handling