Skip to main content
Get started with TerraQuake API by making your first request. No authentication required for most endpoints - you can start querying earthquake data immediately.

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.
1

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.
2

Make Your First Request

Fetch the 10 most recent earthquakes from this year:
curl "https://api.terraquakeapi.com/v1/earthquakes/recent?limit=10"
3

Understand the Response

The API returns a standardized JSON response with earthquake data in GeoJSON format:
{
  "success": true,
  "code": 200,
  "status": "OK",
  "message": "Earthquakes recent events",
  "payload": [
    {
      "type": "Feature",
      "properties": {
        "eventId": 44604942,
        "originId": 141077201,
        "time": "2025-11-05T23:31:48.030000",
        "author": "SURVEY-INGV-CT#KATALOC",
        "magType": "ML",
        "mag": 2.1,
        "magAuthor": "--",
        "type": "earthquake",
        "place": "13 km SE Maletto (CT)",
        "version": 100
      },
      "geometry": {
        "type": "Point",
        "coordinates": [14.97, 37.751, 5.5]
      }
    }
  ],
  "meta": {
    "method": "GET",
    "path": "/v1/earthquakes/recent?limit=10&page=1",
    "timestamp": "2025-11-06T00:51:33.850Z"
  },
  "totalEarthquakes": 14157,
  "pagination": {
    "page": 1,
    "totalPages": 1416,
    "limit": 10,
    "hasMore": true
  }
}

Key Response Fields

success
boolean
Indicates if the request was successful. Always check this before processing data.
payload
array
Array of earthquake features in GeoJSON format. Each feature contains:
  • properties.mag - Magnitude value
  • properties.place - Location description
  • properties.time - When the earthquake occurred
  • geometry.coordinates - [longitude, latitude, depth in km]
totalEarthquakes
integer
Total number of earthquakes available (across all pages)
pagination
object
Pagination info including current page, total pages, and whether more results exist
Coordinates follow GeoJSON convention: [longitude, latitude, depth] - note the order!

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

curl "https://api.terraquakeapi.com/v1/earthquakes/today"

Filter by Magnitude

curl "https://api.terraquakeapi.com/v1/earthquakes/magnitude?minMag=4.0"

Find Earthquakes Near a Location

curl "https://api.terraquakeapi.com/v1/earthquakes/location?latitude=41.9028&longitude=12.4964&radius=100"

Get Earthquakes by Region

curl "https://api.terraquakeapi.com/v1/earthquakes/region/Lazio"
All earthquake data comes directly from the Italian National Institute of Geophysics and Volcanology (INGV), ensuring accuracy and reliability.

Need Help?

Best Practices

Learn tips for efficient API usage

Error Handling

Handle errors and edge cases gracefully

Build docs developers (and LLMs) love