Daily magnitude 4.5+ earthquake log to Google Sheets

By General Input

Every day at 7am UTC, every magnitude 4.5+ earthquake from the last 24 hours lands as a fresh row in your Google Sheet, ready for charts and pivots.

Integrations

  • USGS Earthquake
  • Google Sheets

Type

Deterministic Code

Categories

  • Operations

Build me a deterministic code workflow that maintains a running spreadsheet log of every magnitude 4.5 or greater earthquake in the world, pulled from the U.S. Geological Survey (USGS) public catalog. There is no reasoning needed. The steps are fixed and the inputs are structured GeoJSON.

Trigger: cron, every day at 07:00 UTC.

Step 1. Pull the last 24 hours of earthquakes from USGS. Call the USGS Earthquake "Query Earthquakes" operation with: starttime = (now minus 24 hours) formatted as ISO 8601, endtime = now formatted as ISO 8601, minmagnitude = 4.5, format = geojson, orderby = time. No location filter. The 24 hour, M4.5+ window keeps the response well under the 20,000 feature FDSN cap (a typical day worldwide is under 100 events).

Step 2. For each GeoJSON feature in the response, call Google Sheets "Append Values" once against a spreadsheet ID and sheet/tab name I will configure. Use valueInputOption = USER_ENTERED so timestamps and numbers parse cleanly in the sheet. Append in this fixed column order:

1. event_time_utc — feature.properties.time is Unix milliseconds; convert to an ISO 8601 UTC string before writing.

2. magnitude — feature.properties.mag

3. magnitude_type — feature.properties.magType

4. place — feature.properties.place

5. latitude — feature.geometry.coordinates[1]

6. longitude — feature.geometry.coordinates[0]

7. depth_km — feature.geometry.coordinates[2]

8. pager_alert — feature.properties.alert (may be null; write empty string)

9. mmi — feature.properties.mmi (may be null)

10. cdi — feature.properties.cdi (may be null)

11. tsunami_flag — feature.properties.tsunami (0 or 1 from USGS)

12. event_id — feature.id

13. usgs_event_url — feature.properties.url

The spreadsheet has a fixed header row matching those column names; the workflow appends rows after that header. If the response contains zero features, the workflow ends cleanly with no rows written. Do not call Slack or send any email. The only output is one appended row per event into the configured Google Sheet tab.

Important details so the agent does not get this wrong:

- USGS GeoJSON coordinates are ordered [longitude, latitude, depth_km], not [latitude, longitude]. Do not flip them.

- USGS returns time and updated as Unix milliseconds. Convert milliseconds to ISO 8601 UTC before writing event_time_utc.

- USGS Earthquake is a no-auth public API. The only credential the workflow needs is Google Sheets.

- This is the deterministic counterpart to the agent-based earthquake alerting prompt. Use a code workflow with discrete nodes, not an agent.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to LoopsTurn the people who engage with your posts into Pipedrive leads