Skip to main content

Count the Aftershocks of the 2011 Tohoku Earthquake With the USGS API

Updated 3 min readMarkdown

An aftershock is one of the smaller earthquakes that follow a large mainshock, usually close to where it ruptured. The USGS aftershock forecast overview sums up their behavior in two rules. The rate drops quickly with time, and the size of each aftershock does not. Both can be checked against the USGS catalog in about thirty lines of JavaScript.

Bar chart of daily large earthquakes off northeast Japan after the March 2011 mainshock

Large aftershocks of the 2011 Tohoku earthquake fell off fast, yet strong ones kept coming weeks later (USGS catalog).

The Query

The USGS FDSN event web service is free, needs no key and returns GeoJSON. A time window, a circle around the epicenter and a minimum magnitude select the sequence.

const params = new URLSearchParams({
  format: "geojson",
  starttime: "2011-03-11T05:46:00",
  endtime: "2011-04-10T05:46:00",
  latitude: "38.3",
  longitude: "142.4",
  maxradiuskm: "300",
  minmagnitude: "5",
  orderby: "time-asc",
});

const res = await fetch(`https://earthquake.usgs.gov/fdsnws/event/1/query?${params}`);
if (!res.ok) throw new Error(`USGS API answered ${res.status}`);
const { features } = await res.json();

const mainshock = features.reduce((a, b) => (b.properties.mag > a.properties.mag ? b : a));
const t0 = mainshock.properties.time;
const after = features.filter(f => f.properties.time > t0);

const perDay = new Array(30).fill(0);
for (const f of after) {
  const day = Math.floor((f.properties.time - t0) / 86_400_000);
  if (day < 30) perDay[day]++;
}

console.log(`Mainshock M${mainshock.properties.mag}, ${mainshock.properties.place}`);
console.log(`${after.length} aftershocks of M5+ within 300 km in 30 days`);
console.log(`Day 1: ${perDay[0]}, day 10: ${perDay[9]}, day 30: ${perDay[29]}`);

const late = after.filter(f => f.properties.time - t0 > 7 * 86_400_000 && f.properties.mag >= 7);
for (const f of late) {
  const d = new Date(f.properties.time).toISOString().slice(0, 10);
  console.log(`Late strong aftershock: M${f.properties.mag} on ${d}, ${f.properties.place}`);
}

Save it as aftershocks.mjs and run node aftershocks.mjs (Node 18 or later), or paste it into a browser console.

What It Prints

On November 13, 2026 the catalog returned the M9.1 mainshock and 527 aftershocks of magnitude 5 or more within 300 km over the next 30 days. The first day alone held 289 of them. Day 10 had 6 and day 30 had 1. The USGS rule of thumb is about ten times as many aftershocks on day one as on day ten, and a sequence this large decays even more steeply at the M5 level.

The size rule shows up in the last line. An M7.1 struck near Ishinomaki on April 7, 2011, almost four weeks after the mainshock, when the daily count had already fallen to a handful. A low rate does not mean small events.

Mainshock Is a Label Given Afterward

The same USGS page notes that an M7.3 hit the area two days before the M9.1 and was briefly treated as a mainshock. Once the larger quake arrived it became a foreshock. Change starttime to 2011-03-09 to pull it into the results, and the reduce step still picks the M9.1, because the label always goes to the largest event.

Going Further

Swap the coordinates and dates to test other sequences, and raise minmagnitude to 6 to see the decay with fewer points. For the country behind this example, this profile of Japan's hazards covers its quakes, volcanoes and typhoons, and this guide to the Shindo scale and JMA alerts explains what people in Japan see when one hits. For background rates outside a sequence, the earthquakes per day counter puts a normal day in numbers.

About the author

  • Exploring the planet through interactive maps, open insights, and visual storytelling.

No comments yet. Be the first to comment.