It goes without saying that Chile has a fair number of earthquakes. Here in Concepción we seem to feel a reasonably sized earthquake (M4.5–5) every 1–2 months. So, I wanted a quick and easy way to check for information about earthquakes from publicly available data sources.

USGS Database

Initially I worked with the USGS Earthquake page and their associated RSS feed. I wrote a short script to grab the list of earthquakes from the past 24 hours and filter them by distance from a specified latitude/longitude pair:

For example, to find earthquakes within 1000 km of Concepción, you can invoke the script as so:

$ usgs_daily_earthquake_check.py -l -36.82 -g -73.04 -d 1000
No earthquakes within 1000.0 km of (-36.82, -73.04) in the past 24h.

Sismologia.cl

I was using that for a while, but eventually discovered that it was missing some earthquakes. In a discussion with folks here, I learned of the Chilean government’s site, sismologia.cl, which has more earthquakes, but limited to Chile. So, I wrote a similar script for that website:

The usage is very similar:

$ sismologia.py -l -36.82 -g -73.04 -d 500
...
3 earthquakes within 500.0 km of (-36.82, -73.04) in the past 24h.

Both scripts are available for use, and it should be fairly easy to deconstruct/adapt them to other uses.