Skip to main content

Connect

WSS · API key · stream

Refused before the upgrade

On connect

The server sends one subscription_updated with the resulting list and nothing else: no reports.
Placeholder · A4 · Placeholder · A5

Change the airport list

Example · not executed
Example · body is a placeholder (A5)
subscribe adds and unsubscribe removes only the named codes. Unsubscribing a code you do not hold is ignored. No wildcards: list every airport. There are no request ids.

New reports

Example data · report text elided
data is an array: handle one or more records. Today each message carries one record.
Placeholder · A7

Record fields

Every record, in both modes. Times are ISO 8601 UTC with +00:00: whole seconds on obs_time, milliseconds on arrived_at.
Time format: To be confirmed · D3. Also Placeholder · A12.

Parsed fields

MOBS’s own decoded set: temp_c, dewp_c, wdir, wdir_vrb, wspd_kt, wgst_kt, visib_sm, visib_m, visib_or_greater, visib_or_less, altim_hpa, slp_mb, wx, clouds, flt_cat, corrected. Absent values are left out, numbers that need decimals are strings, and units are in the field name.
Parsed fields: Placeholder · A1
Example data

Corrections

A correction is a new record with the same icao and obs_time and a different raw_metar. An off-minute report can also arrive twice: first typed SPECI, then METAR once a second source confirms the type.
To be confirmed · D9

Daily temperature markets

polymarket.com daily temperature markets settle on the Aviation Weather Center METAR API. A SPECI does not count. Temperature is the T-group in tenths of a degree Celsius when that remark is present; otherwise the body temperature group, in whole degrees Celsius. The day is the station’s local calendar day. Denver is KDEN. Station codes and routine minutes are on Stations.

Heartbeat

Send {"action":"ping"} every 20 seconds; the reply is {"type":"pong"} with no other fields. After 60 seconds with no JSON ping and no valid subscribe or unsubscribe, the socket closes with 4000. Protocol pings do not reset that timer; MOBS answers them but does not send its own.
The pong body is Placeholder · A8. The idle rule is Placeholder · A16.

Errors on the socket

Example · body is a placeholder (A6)
The socket stays open. Codes: invalid_airports, bad_request, unknown_action, too_many_airports. A reader that falls too far behind is closed with 1013; no warning is sent first.
Error bodies are Placeholder · A6. The slow-reader close is Placeholder · A14.

Close codes

Reconnecting

1

Reconnect with backoff

Close the old socket, wait with backoff and jitter, and connect once more with your airports.
2

Resync over HTTP

Call GET /v1/metar/latest and merge. Reports issued while you were away are not resent; only the newest per airport can be read.
3

Deduplicate

Deduplicate on icao, obs_time and raw_metar together.