Docs / API Service

One contract.
Five sources.

The Station Information API normalizes operator station details into one schema while keeping mainland operator content on the rider’s device and under the operator’s own terms.

01 / THE BOUNDARY

This is not a hosted API.

The repository publishes a schema, station directory, and source registry. A conforming client reads those static files, contacts the named operator from the end user’s device, and maps the response locally.

No proxy and no copied operator database

Just-Go does not provide a server endpoint that republishes mainland operator responses. That boundary is part of the data-rights model, not an implementation gap.

02 / CONTRACT FILES

Three layers make one client.

FileRoleMaintained
schema/station-information.schema.jsonDefines the normalized response shape for lines, exits, facilities, provenance, and timestamps.By hand
directory/directory.jsonMaps 1,598 canonical station IDs to one reviewed source and external station key.Generated
sources/sources.jsonDescribes each operator request, identity check, field mapping, and placeholder rule.By hand

03 / CALL FLOW

Resolve, fetch, verify, map.

01Resolve the station

Look up the canonical station ID in the directory and read its source name and reviewed external key.

02Read the recipe

Use the source registry for the fixed host, request method, response type, and mapping rules.

03Verify identity

Reject the response unless its operator name or identifier matches the reviewed station record.

04Normalize locally

Map permitted fields into the shared schema. Placeholders become missing values, not invented facts.

04 / COVERAGE

Five stable source recipes.

SourceDirectory entriesNormalized fieldsAccess model
Beijing Subway416Lines, exits, facilitiesOn-device operator fetch
Shanghai Metro415Lines, exits, facilitiesOn-device operator fetch
Guangzhou Metro346LinesOn-device operator fetch
Hangzhou Metro259LinesOn-device operator fetch
MTR / DATA.GOV.HK162Exits, facilities, live arrivalsBundled static data + live government API

05 / DEVICE CACHE

Offline fallback without re-hosting.

Round 36 adds a device-only last-good cache for Beijing station information.

  • Local onlyStored under Application Support and excluded from backup.
  • BoundedEach entry is limited to 1 MB and guarded by a schema version.
  • LabeledFallback content says it was saved on this device and shows its update age.
  • User-clearableSettings → Clear Cache deletes every stored station-information snapshot.

06 / FAILURE RULES

Unavailable is different from invalid.

Availability failure

Offline, timeout, rate limit, or server error may use a valid stored snapshot when one exists.

Contract failure

A malformed response never falls back silently; it is rejected.

Identity failure

A response for the wrong station never uses cache as cover.

Routing boundary

Online station details never decide route feasibility, route planning, or route confidence.