APIs / Search engines / USGS

1 credit per call2 endpoints16 datapoints

USGS API

USGS API for recent earthquakes worldwide by magnitude and distance, and current streamflow and gage height from U.S. river gauges as JSON.

USGS
GET/v1/usgs/earthquakes?min_magnitude=4.5&days=7
{
  "success": true,
  "data": {
    "page": 1,
    "has_more": true,
    "count": 50,
    "items": [
      {
        "id": "us6000ug2p",
        "magnitude": 4.5,
        "magnitude_type": "mb",
        "place": "101 km N of Baukau, Timor Leste",
        "time": "2026-12-06T07:15:49.423Z",
        "updated": "2026-12-06T07:38:09.040Z",
        "latitude": -7.5563,
        "longitude": 126.4171,
        "depth_km": 13.904,
        "type": "earthquake",
        "status": "reviewed",
        "tsunami": false,
        "significance": 312,
        "network": "us",
        "title": "M 4.5 - 101 km N of Baukau, Timor Leste",
        "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000ug2p"
      },
      {
        "id": "us6000ug1q",
        "magnitude": 5.6,
        "magnitude_type": "mww",
        "place": "108 km NNE of Bangkalan, Indonesia",
        "time": "2026-12-06T06:03:19.431Z",
        "updated": "2026-12-06T08:11:47.236Z",
        "latitude": -6.1264,
        "longitude": 113.084,
        "depth_km": 588.668,
        "type": "earthquake",
        "status": "reviewed",
        "tsunami": false,
        "alert": "green",
        "significance": 482,
        "mmi": 1.332,
        "network": "us",
        "title": "M 5.6 - 108 km NNE of Bangkalan, Indonesia",
        "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000ug1q"
      },
      {
        "id": "us6000ug08",
        "magnitude": 4.5,
        "magnitude_type": "mb",
        "place": "92 km SW of Modisi, Indonesia",
        "time": "2026-12-05T22:23:46.613Z",
        "updated": "2026-12-06T04:15:18.040Z",
        "latitude": -0.0184,
        "longitude": 123.7545,
        "depth_km": 123.138,
        "type": "earthquake",
        "status": "reviewed",
        "tsunami": false,
        "significance": 312,
        "network": "us",
        "title": "M 4.5 - 92 km SW of Modisi, Indonesia",
        "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000ug08"
      }
    ]
  },
  "meta": {
    "request_id": "req_6059748dc6fd47e19d2189832fa68240",
    "credits_charged": 1,
    "credits_remaining": 483
  }
}
200 OKJSONX-Credits-Used: 1
Recorded from our API and shortened.

Sample data

What one call returns

A recorded run of earthquakes: the fields and shapes you will get, shortened to 3 items.

#idstringmagnitudenumbermagnitude_typestringplacestringtimestringupdatedstringlatitudenumberlongitudenumberdepth_kmnumbertypestringstatusstringtsunamibooleansignificanceintegernetworkstringtitlestringurlurl
1us6000ug2p4.5mb101 km N of Baukau, Timor Leste2026-12-06T07:15:49.423Z2026-12-06T07:38:09.040Z-7.5563126.417113.904earthquakereviewedfalse312usM 4.5 - 101 km N of Baukau, Timor Lestehttps://earthquake.usgs.gov/earthquakes/eventpage/us6000ug2p
2us6000ug1q5.6mww108 km NNE of Bangkalan, Indonesia2026-12-06T06:03:19.431Z2026-12-06T08:11:47.236Z-6.1264113.084588.668earthquakereviewedfalse482usM 5.6 - 108 km NNE of Bangkalan, Indonesiahttps://earthquake.usgs.gov/earthquakes/eventpage/us6000ug1q
3us6000ug084.5mb92 km SW of Modisi, Indonesia2026-12-05T22:23:46.613Z2026-12-06T04:15:18.040Z-0.0184123.7545123.138earthquakereviewedfalse312usM 4.5 - 92 km SW of Modisi, Indonesiahttps://earthquake.usgs.gov/earthquakes/eventpage/us6000ug08

Recorded from our API · 3 items shown · 16 datapoints per itemGET /v1/usgs/earthquakes?min_magnitude=4.5&days=7

16 datapoints

Identity

  • idstring
  • magnitude_typestring
  • typestring
  • statusstring
  • titlestring

Contact

  • urlurl

Location

  • latitudenumber
  • longitudenumber

Other

  • magnitudenumber
  • placestring
  • timestring
  • updatedstring
  • depth_kmnumber
  • tsunamiboolean
  • significanceinteger
  • networkstring

Playground

Run this API

cURLshell
curl "https://api.perceptlayer.com/v1/usgs/earthquakes?min_magnitude=4.5&days=7" \
  -H "X-API-Key: $API_KEY"

USGS · 2 endpoints

Endpoints

Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.

EndpointRequired parametersReturnsCost
GET/v1/usgs/earthquakes
none+8 optional
idmagnitudemagnitude_typeplacetimeupdated+12 more
1 credit
GET/v1/usgs/water-levels
none+4 optional
site_numbersite_idnamesite_typestatecounty+6 more
1 credit

Overview

About the USGS API

What you can get

The USGS API returns U.S. Geological Survey earthquake and water data as JSON through 2 endpoints.

  • Earthquakes: earthquakes takes min_magnitude (-1 to 10, default 2.5), days (1 to 365 days back, default 7), a centre point as latitude and longitude with radius_km (1 to 20,000, default 250), order (time or magnitude), limit (1 to 500 events a page, default 50) and page.
  • Water levels: water-levels takes a USGS site number (8 to 15 digits, such as 01646500) or a two-letter state for every site that reported in the last day, with per_page (1 to 100, default 25) and page for a state.

The recorded earthquakes call for magnitude 4.5 and up over 7 days returns page, has_more and items, each with id, magnitude, magnitude_type, place, time, updated, latitude, longitude, depth_km, type, status, tsunami, significance, network, title and a url to the USGS event page, plus alert (the PAGER level) and mmi when USGS has set them. One event in the recording, M 5.6 at 108 km NNE of Bangkalan, Indonesia, had a depth of 588.668 km and a green PAGER alert. The recorded water-levels call for site 01646500 returns the gauge's name (POTOMAC RIVER NEAR WASH, DC LITTLE FALLS PUMP STA), site_type, state, county, latitude, longitude and drainage_area_sq_mi (11,560), then streamflow (6,920 ft^3/s) and gage_height (3.62 ft), each with its value, unit, time and approval_status.

Recent water readings are provisional (approval_status "Provisional") and can be revised. USGS-authored data is in the U.S. public domain; USGS asks for credit as a courtesy, not as a condition: "U.S. Geological Survey".

How a call works

Ask for recent events: GET /v1/usgs/earthquakes?min_magnitude=4.5&days=7&limit=20 with your key in the X-API-Key header returns them newest first; add order=magnitude for the largest first. For a river gauge, GET /v1/usgs/water-levels?site=01646500 returns its latest readings. Check has_more before asking for the next page. Answers come from a cache for up to 10 minutes. Every successful call costs 1 credit; failed calls cost nothing.

Search enginesJSONRESTMCP

More search engines APIs

Use cases

Let an agent answer "were there any earthquakes near this city this week" with a radius search

Use the USGS API to let an agent answer "were there any earthquakes near this city this week" with a radius search

Alert on events above a magnitude, or with the `tsunami` flag or a PAGER alert set

Use the USGS API to alert on events above a magnitude, or with the `tsunami` flag or a PAGER alert set

Load a year of earthquakes in a region into a warehouse for analysis

Use the USGS API to load a year of earthquakes in a region into a warehouse for analysis

Check a river's current streamflow and gage height before a paddling or fishing trip

Use the USGS API to check a river's current streamflow and gage height before a paddling or fishing trip

FAQ

Questions

Is this the official USGS API?

No. Perceptlayer is an independent service and is not affiliated with or endorsed by the U.S. Geological Survey. USGS publishes its earthquake and water data APIs for free; the water API is rate-limited per hour. This API calls those public APIs on your behalf and adds one key for every source on Perceptlayer, one response shape across both, a cache of up to 10 minutes, and no charge for failed calls.

How many earthquakes can one search return?

Up to 500 events a page; page through for more. USGS answers at most 20,000 events per query, so narrow a large search with `min_magnitude`, `days` or a radius.

Are water readings final?

No. Recent readings are provisional and USGS can revise them. Each reading carries its `approval_status`.

Do I have to credit USGS?

No. USGS-authored data is in the U.S. public domain. USGS asks for credit as a courtesy ("U.S. Geological Survey"), and we suggest you give it.

Should I build an USGS scraper instead?

You can, but an USGS scraper is code you maintain: page changes break it, requests get blocked, and USGS's terms govern how you collect data. The USGS API gives you 2 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.

Try the USGS API with 100 free credits

No credit card. Failed calls are never billed.