induwara.lk
Newsopen-dataapisengineering

Magnitude 7.7 in Indonesia: what USGS's free API shows

A magnitude 7.7 earthquake hit near Ende, Indonesia at 03:28 Sri Lanka time. The official page rendered nothing for me. The free USGS API returned everything in one request.

Induwara Ashinsana5 min read

A magnitude 7.7 earthquake struck 68 km NNW of Ende, Indonesia at 21:58:21 UTC on 14 August, which is 03:28 on 15 August in Sri Lanka. I read about it on Hacker News, opened the USGS event page, and got a near-blank screen telling me the app "supports most recent browsers."

So I asked the same agency's public API instead. One unauthenticated GET, no key, no signup, and I had more detail than the page would have shown me. That gap is the thing worth writing about.


🔍 What one request actually returned

The event id is us6000tkt2. Everything below came from a single call to the USGS FDSN event service in GeoJSON form:

Field Value
Magnitude 7.7 (mww, moment magnitude)
Location 68 km NNW of Ende, Indonesia
Coordinates -8.3101, 121.3517
Depth 10 km (origin solution)
Origin time 2026-08-14 21:58:21 UTC
PAGER alert orange
Max modelled intensity MMI 8.8
Peak ground acceleration 0.788 g
Peak ground velocity 100.7 cm/s
"Did You Feel It?" responses 25, max community intensity 7.4
Status reviewed

A shallow 10 km hypocentre under a populated island arc is why the modelled shaking is severe rather than merely large. Orange is the second-highest of the four PAGER alert levels USGS publishes (green, yellow, orange, red). I am not going to put a casualty or damage number in this post, because the feed does not give me one I can stand behind, and this is the point in a breaking story where invented numbers spread fastest.

By my own haversine calculation from the published coordinates, the epicentre sits roughly 4,900 km east of Colombo.

The feed's tsunami field reads 0. That flag indicates whether tsunami information is attached to the event record. It is not an authoritative all-clear, and nobody should treat a JSON field as a substitute for a tsunami warning centre.


🌐 Why the page was blank and the data wasn't

The event page is a JavaScript application. Fetch it with a plain HTTP client and you get a shell. Fetch the feed and you get the whole event:

curl -s "https://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us6000tkt2&format=geojson" \
  | python3 -c "import json,sys; p=json.load(sys.stdin)['properties']; print(p['mag'], p['place'], p['alert'])"

That is 61 KB of structured data, free, keyless, and cache-friendly. The lesson for anyone building here:

  1. Look for the machine-readable endpoint before you consider scraping. Agencies that publish an SPA almost always publish the feed it renders from.
  2. Never build an alerting pipeline on HTML you scraped. The markup broke for me today with no warning; the schema did not.
  3. If you are the one shipping the site, publish the data path too. A page that needs 2 MB of JavaScript to show one number is a page that fails on a weak mobile connection, which describes a lot of Sri Lanka outside the cities.

Key takeaway: Public data is only as accessible as its dullest interface. USGS survived my client failing because they shipped a boring, documented, keyless feed alongside the pretty one.


⚡ The numbers are still moving, and the feed says so

Here is the part most news write-ups drop. A USGS event is not one number. It is a bundle of products, each independently versioned, some reviewed by a human and some not:

Product What it gave Review status
origin depth 10 km, M7.7 reviewed
moment-tensor centroid depth 42.9 km, 94.9% double couple, 35 s source duration reviewed
finite-fault max slip 2.61 m, rupture velocity 2.44 km/s reviewed
shakemap version 3, MMI 8.8, PGA 0.788 g automatic
losspager orange, max MMI 9 reviewed
dyfi 25 felt reports crowd-sourced

The origin depth is 10 km. The moment tensor centroid depth is 42.9 km. Both are correct answers to different questions, and a naive dashboard that picks whichever it parsed first will show a number it cannot defend. The record was last updated about 4 hours 45 minutes after the origin time, and ShakeMap was already on its third version while still flagged automatic.

If you cache this data, cache the updated timestamp with it and show it in your UI. Ours is an epoch value in milliseconds (1786744701564); our Unix timestamp converter turns it into something a human can check, and the timezone converter handles the UTC to Asia/Colombo shift that trips up half of all first-attempt dashboards.


🛠️ A weekend build that costs nothing

If you want a portfolio project with real data and zero API bill, this is one of the better ones available to a student here:

  • Poll the USGS hourly feed on a schedule. A five-minute cron expression is polite and sufficient.
  • Filter on magnitude and the alert field rather than magnitude alone. Magnitude tells you the physics; the PAGER alert level tells you the human exposure.
  • Store the event id and the product versions. Re-notify only when a version bumps, otherwise your alerts will fire every poll.
  • Render the raw payload while you develop; a JSON formatter beats guessing at nested keys.
  • Label every displayed value with its review status. "Automatic, version 3" is honest. A bare number is not.

Sri Lanka is not on this arc, but we sit on the same ocean as the 2004 source region, and the engineering skill of consuming an authoritative feed correctly transfers to anything the Department of Meteorology, the Disaster Management Centre, or a private client asks you to build.


💡 What this means for you

Two things came out of this morning for me. The first is that a serious earthquake happened near Ende and the human toll is not yet known, so the responsible move is to link the source and wait rather than fill the gap with confident guesses.

The second is a reusable engineering habit. When a public interface fails, ask whether the same organisation publishes a machine-readable one, because the answer is yes far more often than developers assume, and it is usually free. The blank page cost me thirty seconds. The feed behind it gave me rupture velocity, slip distribution, and a documented review status on every single value.

Build against the boring endpoint. It is the one that stays up.

#open-data#apis#engineering
IA

Induwara Ashinsana

Information Systems student at UCSC and Executive Director at Ryzera Technologies. Writes about software, AI, and what it means for builders in Sri Lanka.

About the author →

Keep reading