API Guide

Four products through one API at https://bbpservices.net/v1: SCEC Broadband Platform seismograms (bbp), SW4 wave propagation (sw4), the two merged into broadband records (bbp3d), and Vs30 queries (vs30). The three simulation products follow OGC API - Processes; errors are RFC 9457 problem details.

Route-by-route reference: /v1/docs (interactive) and /v1/openapi.json. Versions served are reported by GET /v1/health and GET /v1/processes; this page names none on purpose.

1. Keys and scopes

Create keys on your account's API keys page. A key looks like bbps_<key_id>.<secret> and is shown once; only a hash is kept, so a lost key is revoked and replaced. Send it on every request:

Authorization: Bearer bbps_...

Each key carries scopes. Give each use its own key: a key that only looks up Vs30 should not be able to start a run. A request outside a key's scopes is refused with 403 insufficient_scope, naming the scope it needs.

ScopeAllows
sites:readVs30 queries
catalog:readThe catalog, process descriptions and every estimate
jobs:readYour jobs, results, files, usage and webhook secret
jobs:submit:bbp, jobs:submit:sw4Submit that process's jobs, upload files, dismiss jobs
jobs:submit:bbp3dSubmit bbp3d jobs. A bbp3d job stands for the whole bbp, sw4 and merge workflow, so the key also needs jobs:submit:bbp and jobs:submit:sw4
data:deleteDelete a job's stored files

Submitting a job also needs an account approved for jobs; an account that is not gets 403 submit_not_approved. Estimates and Vs30 lookups do not need approval. Every job is metered against the account behind the key.

2. What this deployment serves

Ask rather than assume. The first three need no key.

GET /v1/, /v1/conformanceLanding links; the OGC conformance classes implemented (Processes Core, process description, JSON, job list)
GET /v1/healthLiveness, dispatch state, and the release and contract versions
GET /v1/processes, /v1/processes/{id}The processes enabled here, their versions, and each one's inputs schema and limits
GET /v1/catalog/regionsInstalled velocity-model regions and the methods each runs (map below)
GET /v1/catalog/versionsRunnable BBP builds, each with the commit it was compiled from; which is the default
GET /v1/catalog/validation-eventsInstalled SCEC validation events

A build reported with "provenance": "unverified" and no commit cannot say what it compiled. Pin a build with engine_version only when you need results that a change of default cannot alter.

3. Run a Broadband Platform job

Estimate first. POST /v1/processes/bbp/estimate takes exactly the body you will submit and returns the price without creating a job. It runs the same checks, so a body that estimates cleanly will not be refused for its contents. Read its basis before trusting the number: measured (fitted from comparable finished jobs), modeled (this method elsewhere), or cold_start (a planning figure, not a quote).

curl -X POST https://bbpservices.net/v1/processes/bbp/execution \
  -H "Authorization: Bearer $BBPSERVICES_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "my-scenario-01",
  "inputs": {
    "kind": "scenario",
    "method": "GP",
    "region": "LABasin500",
    "source": {
      "kind": "src", "magnitude": 6.0,
      "fault_length_km": 12.0, "fault_width_km": 8.0, "depth_to_top_km": 2.0,
      "strike_deg": 120, "dip_deg": 60, "rake_deg": 90,
      "lat_top_center": 34.2, "lon_top_center": -118.5,
      "hypo_along_strike_km": 0.0, "hypo_down_dip_km": 4.0
    },
    "sites": [
      {"id": "S1", "lat": 34.312, "lon": -118.481, "vs30_m_s": 760},
      {"id": "S2", "lat": 34.05,  "lon": -118.25}
    ]
  }
}'
  • kind: scenario (your source and sites), validation (a SCEC event by validation_event; source and sites come with it), or comparison (scored against recordings you upload, with event_id and observed).
  • Field names carry their units. A site without vs30_m_s gets one looked up at submit, metered as a Vs30 query, and the job records where each value came from. Sites may also be GeoJSON Features (coordinates [lon, lat]).
  • Optional: realizations (count 1 to 100), post_processing (spectra, plots, maps; turn them off when you want time series only), keep_components (keep the low- and high-frequency parts apart; needed for bbp3d), max_cost_usd (refuse the job if the estimate's upper bound is above it), engine_version.
  • A submit answers 201 with Location: /v1/jobs/{jobId} and the job's status. Always send an Idempotency-Key: a repeat with the same key and body returns the first job instead of buying a second run.

4. Follow a job, or be called back

GET /v1/jobs/{id} returns the OGC status record: status (accepted, running, successful, failed, dismissed), an outcome of complete or partial on success, progress, usage, cost, when the files expire, and a provenance block recording the contract, process and engine versions the job ran with. Stop polling on successful, failed or dismissed. successful with partial means some realizations produced output and some did not.

GET /v1/jobs/{id}/events?stream=true streams progress as server-sent events. DELETE /v1/jobs/{id} dismisses a job. GET /v1/jobs lists yours, newest first, with cursor paging.

Webhooks. For runs measured in hours, add a subscriber to the execution body (successUri, failedUri, inProgressUri, all https). Deliveries follow Standard Webhooks: the body is the status record, signed with your account's secret from GET /v1/webhooks/secret in the webhook-signature header. Verify over the raw bytes, and dedupe on webhook-id, since a failed delivery is retried with the same bytes.

5. Get the results

GET /v1/jobs/{id}/results returns a STAC 1.0 item: the sites as geometry, and one asset per file with a short-lived download link, media type, size, SHA-256 checksum, site and, for every seismogram, its waveform_type:

bbpBroadband Platform, low plus high frequency
bbp_lf, bbp_hfIts two parts, kept with keep_components
sw4_1d_lf, sw4_3d_lfSW4 low frequency, 1D or 3D velocity model
sw4_1d_bbp_hfSW4 1D low frequency merged with BBP high frequency
bbp3dSW4 3D low frequency merged with BBP high frequency (BBP 3D)

Seismograms are BBP four-column text (time N-S E-W U-D; acceleration in cm/s², velocity in cm/s), with a header naming the job and what produced it. Also: GET /v1/jobs/{id}/artifacts (every file, logs included), POST /v1/jobs/{id}/bundle (one archive), GET /v1/datasets (what you are storing and what it costs to keep). Files are kept for a limited time and then removed; download what you need to keep. Expired data answers 410.

6. Run SW4

SW4 is a finite-difference code. A job returns band-limited velocity seismograms at your sites and, if asked, the ground surface's motion as frames for movies and a peak ground velocity map. It complements the Broadband Platform's records rather than replacing them.

POST /v1/processes/sw4/execution
{
  "name": "La Habra M5.1 SW4",
  "inputs": {
    "source": {"kind": "srf", "job_id": "job_d8287cd897f647acb135", "realization": 1},
    "velocity_model": {"kind": "ucvm", "model": "auto", "vs_min_m_s": 500},
    "resolution": {"f_max_hz": 0.5, "points_per_wavelength": 5},
    "duration_s": 40,
    "sites": [{"id": "CI.PSR", "lat": 33.925, "lon": -117.891}],
    "outputs": {"wavefield": {"frames_dt_s": 0.2, "pgv_map": true}},
    "max_cost_usd": "15.00"
  }
}
  • The rupture is an SRF: from one of your bbp jobs (job_id, so both share one rupture), a stored SRF (artifact_id), or one you upload (upload_id).
  • Velocity model: bbp_1d (a region's layered model) or ucvm with cvmsi (Southern California), sfcvm (San Francisco Bay Area) or auto. An event no 3D model covers is refused with outside_model; resubmit it as bbp_1d.
  • f_max_hz is at most 1.0. List every site you will want (up to 5,000): sites cannot be added later.
  • SW4 runs cost dollars to tens of dollars. Estimate first (/v1/processes/sw4/estimate) and set max_cost_usd. An event too large for one machine is refused before any compute.

7. Merge into BBP 3D

bbp3d merges SW4's low frequencies with the Broadband Platform's high frequencies at 1 Hz. Today it merges two finished jobs of yours:

POST /v1/processes/bbp3d/execution
{"inputs": {"from_jobs": {"bbp": "job_aaa...", "sw4": "job_bbb..."},
            "merge": {"crossover_hz": 1.0, "site_response": "auto"}}}
  • The bbp job must have run with keep_components: true; the sw4 job must come from its rupture, with f_max_hz of at least 1.0, at sites among its stations. A pair that does not fit is refused with the reason.
  • GP and SDSU are both supported. site_response: bbp applies BBP's 1D site response to the SW4 low frequencies, none uses them as computed (a 3D model's basins already amplify), auto picks by model.
  • Published comparisons of the three products against recordings are on the validation pages (Northridge, Alum Rock).

8. Upload a rupture or recordings

  1. POST /v1/uploads with purpose (srf or observed_record), filename, size_bytes and sha256. An observed record is named <site-id>.bbp (acceleration, BBP four columns).
  2. PUT the bytes to the returned put_url (no key: the signature is the permission). A file that does not match its declared size and hash is refused, and you can try again.
  3. Cite the upload_id: an sw4 source.upload_id, or a bbp comparison's observed list (one per site).

A received upload can be used by any number of your jobs for 72 hours; each job keeps its own copy.

9. Look up Vs30

GET /v1/sites/vs30?lat=34.05&lon=-118.25
{"lat": 34.05, "lon": -118.25, "vs30": 385.0, "source": "cgs"}

POST /v1/sites/vs30 with {"points": [...]} answers up to 500 points in order (GET /v1/sites/vs30/limits), metered per point. A point with no coverage returns "vs30": null: the service never substitutes a default, so choose your own fallback. Send a GeoJSON FeatureCollection, or Accept: application/geo+json on the GET, to get GeoJSON back. Needs a key with sites:read.

10. Usage, cost and errors

GET /v1/usage?since=YYYY-MM-DD totals your jobs (instance time, storage, Vs30 points) and prices them from the same rate table the estimates use, split by engine, instance type and market. Show prices from this response rather than from a copy you keep.

Errors are problem details with a code to switch on and a title to show. On /execution, as OGC requires, a request refused for its contents answers 400; elsewhere 422. Common codes: insufficient_scope, submit_not_approved (403); idempotency_conflict (409); gone (410); invalid_inputs, over_max_cost, outside_model, domain_too_large; engine_unavailable (503: retry later).

11. Older routes

The routes this API launched with still work and answer as before, with a Deprecation header and a link to their successor. No end date is set yet; one will be announced on the updates page before any is removed. New code should use the routes above.

Older routeUse instead
POST /v1/jobsPOST /v1/processes/bbp/execution or /sw4/execution
POST /v1/jobs/sw4, /v1/jobs/comparison (multipart)POST /v1/uploads, then the process's /execution
POST /v1/jobs/estimatePOST /v1/processes/{id}/estimate
POST /v1/jobs/{id}/cancelDELETE /v1/jobs/{id}
GET /v1/jobs/{id}/data-productGET /v1/jobs/{id}/results
GET /v1/catalog/engines, /v1/catalog/methodsGET /v1/processes
GET /healthGET /v1/health

A job submitted through an older route reads back in the older form (status queued, succeeded, completed_with_errors, canceled), so existing clients see nothing new. Moving over, the flat field names (fault_length, strike, vs30) become unit-named ones (fault_length_km, strike_deg, vs30_m_s), and stations becomes sites.

12. Velocity-model regions

A bbp job, and an sw4 job with a 1D model, runs against a regional 1-D crustal velocity model. Each installed region (see GET /catalog/regions) covers a native geographic extent; pass its id as region in a job spec. The map shows the extents of the California regions. Two Japanese regions are installed as well (CentralJapan500, WesternJapan500).

Map of the five SCEC Broadband Platform velocity-model regions across California: NoCal, CenCoast, Southern Sierra Nevada, Mojave and SoCal
The five California velocity-model regions. A location outside every region can still be simulated against the nearest one, as a labelled approximation. Each region has more than one name. The labels on this map are the regional names used in the SCEC literature. The API identifies a region by its package id, which is what you pass as region in a job spec and what GET /catalog/regions returns. The two correspond as follows:
Name on the map Package id (use this in the API) Area covered
NoCal NoCal500 Northern California, including the Bay Area
CenCoast CentralCal500 Central Coast Ranges, including Parkfield
Southern Sierra Nevada SouthernSierra500-2 Southern Sierra Nevada and Owens Valley
Mojave Mojave500 Mojave Desert, including Ridgecrest
SoCal LABasin500 Southern California, including the Los Angeles basin

The 500 in a package id is the model's minimum shear-wave velocity in m/s, not a region name. SouthernSierra500-2 ends in -2 because it is the second release of that package. Always send the package id exactly as GET /catalog/regions reports it; the map names are not accepted.