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:
export API_URL="$(terraform -chdir=terraform output -raw api_url)"echo "$API_URL"Catalog — discover stations and dates
Section titled “Catalog — discover stations and dates”List all stations with processed output:
curl "${API_URL}/catalog"List available dates for a station:
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.
Query — fetch TEC time series
Section titled “Query — fetch TEC time series”curl -s "${API_URL}/query?station=auck&start_time=2026-06-28T00:00:00Z&end_time=2026-06-28T23:59:59Z&sv=G01" | jq .Query tips
Section titled “Query tips”| Scenario | Recommendation |
|---|---|
| Full-day query on a busy station | Add |
| Large result sets | Check |
| Max time range | 7 days between |
| Row cap | Default 2000 rows ( |
Reprocess — submit and poll jobs
Section titled “Reprocess — submit and poll jobs”Submit:
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:
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.
Browser vs CLI
Section titled “Browser vs CLI”| Client | URL | Notes |
|---|---|---|
| curl, scripts, Postman | api_url | No CORS restrictions |
Amplify | app_url | Requires CORS Lockdown |