REST API
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 served through API Gateway. CORS does not apply to curl and scripts — use api_url directly.
Set API URL
Section titled “Set API URL”From the demo repo root:
export API_URL="$(terraform -chdir=terraform output -raw api_url)"echo "$API_URL"List available stations
Section titled “List available stations”Catalog uses prefix-based discovery on processed output:
curl "${API_URL}/catalog"Response:
{ "stations": ["AUCK", "AVLN", "WGTN"]}List dates for a station
Section titled “List dates for a station”curl -s "${API_URL}/catalog?station=auck" | jq .Response:
{ "dates": [ { "year": 2026, "doy": 179 }, { "year": 2026, "doy": 178 } ]}Query TEC data
Section titled “Query TEC data”Use sv on full-day requests for busy stations:
curl -s "${API_URL}/query?station=auck&start_time=2026-06-28T00:00:00Z&end_time=2026-06-28T23:59:59Z&sv=G01" | jq .metaExpected meta:
{ "row_count": 519, "truncated": false }Query constraints
Section titled “Query constraints”| Parameter | Constraint |
|---|---|
station | 4 alphanumeric characters |
| ISO 8601 UTC; max 7-day range |
sv | Optional satellite filter (recommended for full-day queries) |
See API Response Schemas and REST API Usage.
Browser vs CLI
Section titled “Browser vs CLI”| Client | URL | CORS |
|---|---|---|
| curl / scripts | api_url | Not applicable |
Amplify |
| Requires CORS Lockdown |