Spiral gives your agent every tool with one account. Browse the tools →

opencode · Public Records

How to Use USGS earthquake search in opencode

Find cataloged seismic events and their magnitude, location, depth, and origin time within a region and time window. Use it to build an earthquake timeline or find event IDs for closer investigation.

Prompts to try with USGS earthquake search in opencode

Copy an example into opencode, or ask in your own words.

Use USGS earthquake search to retrieve events within 100 km of Los Angeles at 34.0522, -118.2437 during July 2019, and add a timeline of origin times, magnitudes, and depths to this project's data folder.

USGS earthquake searchopencode
Try asking
  • Use USGS earthquake search to retrieve events within 150 km of Anchorage at 61.2181, -149.9003 during November 2018, and build a map from the returned coordinates.

  • Use USGS earthquake search to retrieve events within 100 km of Ridgecrest at 35.6225, -117.6709 from July 4 through July 8, 2019, and generate a chart of magnitude against origin time.

  • Use USGS earthquake search to look this up and give me the result as a table. Save the result in ./assets.

  • Pull the latest numbers from USGS earthquake search and tell me what changed since last week.

How to set up USGS earthquake search in opencode

Pick the way that suits you. Each takes about two minutes.

Use Spiral's MCP server

  1. Add the server

    Leave out --global to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

    opencode mcp add spiral --global --url https://api.spiral.ai/mcp
  2. Sign in

    Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, /mcps starts the same sign-in.

    opencode mcp auth spiral
  3. Check it

    Spiral shows as connected.

    opencode mcp list

Use the Spiral skill

  1. Send opencode this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run USGS earthquake search

    One request; the result comes back by polling or a webhook.

    curl https://api.spiral.ai/v1/runs \
      -H "Authorization: Bearer $SPIRAL_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "provider": "alexandria",
        "model": "earthquake-usgs-gov/earthquakes/search",
        "input": {
          "limit": 50
        }
      }'

Then paste one of the prompts above: opencode finds USGS earthquake search on Spiral, shows the price and runs it.

USGS earthquake search providers and prices

Spiral runs USGS earthquake search through Alexandria. Open a card for today's price, with every fee included.

AlexandriaPublic Records
USGS Earthquake Catalog (ComCat) · Search
earthquake-usgs-gov/earthquakes/search

Settings you can ask for

Ask opencode for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Limit1 to 20050

Events per page.

Latitude-90 to 90

Circle center latitude; requires longitude and max_radius_km.

Order bytime, time-asc, magnitude, or magnitude-asctime

Newest first (time), oldest first, largest first (magnitude) or smallest first.

Longitude-180 to 180

Circle center longitude.

Alert levelgreen, yellow, orange, or red

Only events with this PAGER alert level.

Max depth km-100 to 1000

max_depth_km

Max latitude-90 to 90

Rectangle north edge.

Min depth km-100 to 1000

min_depth_km

Min latitude-90 to 90

Rectangle south edge. Rectangle edges may be given in any subset; do not combine with the circle.

Max longitude-360 to 360

Rectangle east edge.

Max magnitude-2 to 10

max_magnitude

Max radius km0 to 20001.6

Circle radius in kilometres.

Min longitude-360 to 360

Rectangle west edge; values beyond +/-180 let a rectangle cross the antimeridian.

Min magnitude-2 to 10

min_magnitude

Every API field of USGS Earthquake Catalog (ComCat) · Search is on its tool page: open its card above.

What can you do with USGS earthquake search in opencode?

Build a regional earthquake timeline with magnitude, depth, and links to USGS records. Add individual event summaries that distinguish ShakeMap intensity, DYFI reports, and PAGER estimates.

Earthquake news briefs

Find events around a reported earthquake, then inspect the selected event's magnitude, depth, shaking, and available impact estimates to draft a sourced newsroom brief.

Regional earthquake timelines

Build a dated sequence for a region such as Southern California and add available shaking and felt-report summaries for selected events.

Business incident context

Prepare an earthquake briefing near a public facility such as the Port of Los Angeles, using catalog locations and available impact summaries to support further investigation.

Earth science lessons

Compare magnitude, depth, ShakeMap intensity, and public felt reports across selected earthquakes to explain the different measurements.

Catalog revision reports

Compare repeated retrievals for a regional event list or a known earthquake and report changes to magnitude, depth, location, and available impact summaries.

Historical event comparisons

Find earthquakes within defined historical windows and assemble comparable event summaries, keeping differences in catalog coverage visible.

Questions about USGS earthquake search in opencode

Can opencode use USGS earthquake search?

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run USGS earthquake search like any built-in tool.

How much does USGS earthquake search cost in opencode?

$0.00873 per call. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

Do I need an Alexandria account to use USGS earthquake search in opencode?

No. Spiral runs USGS earthquake search on its own Alexandria account. You sign in to Spiral once and never paste a key.

How long does it take to set up USGS earthquake search in opencode?

About two minutes: add the server, then sign in, then check it.

Does opencode wait while USGS earthquake search runs?

USGS earthquake search runs in the background. opencode starts the run, checks on it and gives you the json when it's ready.

Does USGS cover earthquakes outside the United States?

Yes. ComCat receives earthquake parameters and related products from seismic networks worldwide. Geographic coverage and periods of record vary by contributing catalog.

How fresh is an individual earthquake record?

USGS says event pages and GeoJSON detail are cached for one minute during the first seven days after an event, then for 15 minutes. Those are cache intervals, not a promise that new observations arrive on that schedule.

Why do so many records show a depth of exactly 10 km?

USGS sometimes assigns a depth of 10 km when the available observations cannot support a reliable depth calculation. That value can be a fixed estimate rather than a precisely measured depth.

Are PAGER fatalities and losses confirmed totals?

No. PAGER provides estimated fatalities and economic losses following significant earthquakes worldwide. Describe these as modeled impacts when preparing an earthquake brief.

Is there a limit on large historical searches?

The underlying USGS catalog service caps a query at 20,000 events and rejects queries exceeding that limit. Divide broad historical work into smaller time windows.

Get started

Start using USGS earthquake search in opencode

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into opencode:

Set up opencode

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options