USGS Earthquake API
earthquake.usgs.gov · Science
Real-time and historical earthquake data from USGS — magnitude, depth, location, and felt reports. GeoJSON and CSV output. Free, no API key.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
Recent earthquakes
Get magnitude 5+ earthquakes in the past week.
https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&endtime=2026-06-08&starttime=2026-06-01&minmagnitude=5
Hover any highlighted part to learn what it does
curl -X GET "https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&endtime=2026-06-08&starttime=2026-06-01&minmagnitude=5"
import requests
params = {
"format": "geojson",
"endtime": "2026-06-08",
"starttime": "2026-06-01",
"minmagnitude": "5"
}
response = requests.get(
"https://earthquake.usgs.gov/fdsnws/event/1/query",
params=params,
)
print(response.json())const url = new URL('https://earthquake.usgs.gov/fdsnws/event/1/query');
url.searchParams.set('format', 'geojson');
url.searchParams.set('endtime', '2026-06-08');
url.searchParams.set('starttime', '2026-06-01');
url.searchParams.set('minmagnitude', '5');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://earthquake.usgs.gov/fdsnws/event/1/query")
q := baseURL.Query()
q.Set("format", "geojson")
q.Set("endtime", "2026-06-08")
q.Set("starttime", "2026-06-01")
q.Set("minmagnitude", "5")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://earthquake.usgs.gov/fdsnws/event/1/query")
uri.query = URI.encode_www_form({
"format" => "geojson",
"endtime" => "2026-06-08",
"starttime" => "2026-06-01",
"minmagnitude" => "5"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://earthquake.usgs.gov/fdsnws/event/1/query?" . http_build_query([
"format" => "geojson",
"endtime" => "2026-06-08",
"starttime" => "2026-06-01",
"minmagnitude" => "5"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed
- Recent M5+: GET /query?format=geojson&starttime=2026-06-01&minmagnitude=5
- Near location: add &latitude=35.68&longitude=139.76&maxradiuskm=200
- Count only: GET /count?format=geojson&starttime=2026-06-01
- Formats: geojson, csv, text, xml