Skip to content

REST API Usage

The REST API
Amazon API Gateway — REST API exposing `/catalog`, `/query`, and `/reprocess`. Browser CORS is locked to the Amplify hostname; CLI clients call the API Gateway URL directly.
is the primary programmatic interface for catalog discovery, TEC
Total Electron Content — integrated electron density along the GNSS signal path; primary calibrated output of the processor.
queries, and reprocessing. Use api_url from Terraform
HashiCorp Terraform — provisions all platform infrastructure through five modules in `terraform/`.
outputs — CORS does not apply to curl and server-side clients.

From the demo repo root:

Terminal window
export API_URL="$(terraform -chdir=terraform output -raw api_url)"
echo "$API_URL"

List all stations with processed output:

Terminal window
curl "${API_URL}/catalog"

List available dates for a station:

Terminal window
curl -s "${API_URL}/catalog?station=auck" | jq .

Catalog derives stations and dates from processed S3
Amazon Simple Storage Service — data lake bucket for raw ingest and processed TEC output; S3 events trigger processing.
key prefixes under processed/tec/. Raw ingest alone does not populate the catalog.

Terminal window
curl -s "${API_URL}/query?station=auck&start_time=2026-06-28T00:00:00Z&end_time=2026-06-28T23:59:59Z&sv=G01" | jq .
ScenarioRecommendation
Full-day query on a busy station

Add &sv=G01 (or another satellite) to reduce row count

Large result sets

Check meta.truncated; narrow time range or add sv filter

Max time range

7 days between start_time and end_time

Row cap

Default 2000 rows (QUERY_MAX_ROWS)

Submit:

Terminal window
JOB=$(curl -s -X POST "${API_URL}/reprocess" \
-H "Content-Type: application/json" \
-d '{"station": "auck", "year": 2026, "doy": 179, "parameters": {"NAV_DAY_OFFSET": 2}}')
echo "$JOB"

Poll:

Terminal window
JOB_ID=$(echo "$JOB" | python3 -c "import sys,json; print(json.load(sys.stdin)['job_id'])")
curl "${API_URL}/reprocess/${JOB_ID}"

Supported parameters keys: NAV_DAY_OFFSET, SAVE_PARQUET, SAVE_CSV, SAVE_JSON, SAVE_STATIC_PLOTS, SAVE_INTERACTIVE_PLOTS. Any other key returns HTTP 400.

ClientURLNotes
curl, scripts, Postmanapi_urlNo CORS restrictions

Amplify
AWS Amplify — hosts the Vite portal SPA. This walkthrough deploys via manual zip upload (no Git connection required).
portal

app_url

Requires CORS Lockdown