What You’ll Build
In this quickstart, you’ll fetch the 10 most recent earthquakes from this year and display their magnitude and location. This will teach you the basics of working with the API.Choose Your Development Environment
TerraQuake API works with any HTTP client. Pick your preferred language:
- cURL - Quick testing from the command line
- JavaScript - For web applications and Node.js
- Python - For data analysis and scripts
No API key needed! Most endpoints are publicly accessible.
Understand the Response
The API returns a standardized JSON response with earthquake data in GeoJSON format:
Key Response Fields
Indicates if the request was successful. Always check this before processing data.
Array of earthquake features in GeoJSON format. Each feature contains:
properties.mag- Magnitude valueproperties.place- Location descriptionproperties.time- When the earthquake occurredgeometry.coordinates- [longitude, latitude, depth in km]
Total number of earthquakes available (across all pages)
Pagination info including current page, total pages, and whether more results exist
Next Steps
Now that you’ve made your first API call, explore more features:API Reference
Explore all available endpoints and parameters
Filter Earthquakes
Learn how to filter by magnitude, location, depth, and date range
Response Format
Understand the structure of API responses in detail
Authentication
Set up authentication for protected endpoints
Common Use Cases
Get Today’s Earthquakes
Filter by Magnitude
Find Earthquakes Near a Location
Get Earthquakes by Region
Need Help?
Best Practices
Learn tips for efficient API usage
Error Handling
Handle errors and edge cases gracefully