REFERENCE · SURF

SURF API

Real-time observations from 2,000+ ground weather stations across China. Five-minute observation intervals, data latency as low as 10 minutes, and standard weather elements including wind, temperature, humidity, pressure and precipitation.

Access observations through WebSocket push or HTTP batch downloads using an independent SURF API key.

Pricing and access · API Key →

Weather fields, units and time periods

The five-minute observation interval is the spacing between records, not a common averaging or accumulation period for every field. Use each field’s definition below.

FieldUnitMeaning and time period
temperature°CInstantaneous air temperature at the observation time.
feels_like_temperature°CFeels-like temperature; null when unavailable.
humidity%Relative humidity.
pressurehPaAtmospheric pressure.
wind_speedm/sTwo-minute mean wind speed.
wind_direction
wind_direction_degree
— / °Two-minute mean wind direction, provided as text and an angle.
wind_power_description—Text description of wind force.
rainmmAccumulated precipitation during the previous complete clock hour. Not five-minute precipitation or a rolling one-hour total.

Precipitation time-period example

Times below use the same time zone. Both 03:05 and 03:10 report 3 mm for 02:00–03:00. They do not represent 02:05–03:05 or 02:10–03:10. Repeated values for the same station and precipitation hour must not be added together.

Observation timerainPrecipitation period
03:053 mm02:00–03:00
03:103 mm02:00–03:00

Quickstart

1. Prepare your environment

Shell
python -m pip install httpx "websockets>=15,<16"
Shell
export SKYVIEWOR_SURF_API_KEY="YOUR_OVERSEAS_SURF_KEY"

2. Query data batches

Python · HTTP
import os
import httpx

with httpx.Client(timeout=15) as client:
    response = client.get(
        "https://data.skyviewor.io/v1/surf/batches",
        headers={"Authorization": "Bearer " + os.environ["SKYVIEWOR_SURF_API_KEY"]},
    )
    response.raise_for_status()
    for batch in response.json()["data"]:
        print(batch["batch_start"], batch["revision"], batch["station_count"])

Authentication and limits

Use Authorization: Bearer with your independent overseas SURF API key. POST auth/token exchanges it for a token lasting at most five minutes. Only this short token may be supplied as a token query parameter for browser WebSockets or HTTP. Never place a long-lived API key in a URL. Tokens remain subject to key expiry and revocation.

Paid: 2 HTTP requests per second and 3 simultaneous WebSockets, shared by both SURF streams. Trial: 1 HTTP request every 2 seconds and 1 WebSocket. All-station subscriptions are supported. METAR and SURF API keys cannot be used interchangeably.

An independent 72-hour trial starts when activated, not when eligibility is granted. Existing Google or GitHub bindings can qualify without reconnecting; METAR trial history does not consume SURF API eligibility. Each third-party identity qualifies once per product.

Pricing and access

Launch prices: $12 / month, $30 / quarter, $100 / year. Standard prices: $20, $50 and $167. New purchases switch at 00:00 Beijing time on 5 March 2027 (4 March 16:00 UTC). A subscription successfully paid before the cutoff keeps its launch price while the same subscription remains continuous. Unpaid orders do not lock a price. One-time access lasts 30 / 90 / 365 days; subscriptions use calendar billing periods. No weekly plan.

HTTP API

HTTPURL
POSThttps://data.skyviewor.io/v1/surf/auth/token
GEThttps://data.skyviewor.io/v1/surf/batches
GEThttps://data.skyviewor.io/v1/surf/health

Query start / end as timezone-aware UTC timestamps; end is exclusive. Defaults to the last hour; at most the last seven days. limit defaults to 100 (maximum 200). Follow next_before with the same start / end. Each batch_start returns its latest revision. Windows are five minutes; the first version is published after the window ends. Late observations received within one hour of window end may create a new revision. Identical content does not advance revision. Deduplicate by station_id and publish_time; first receipt wins.

Files are private .json.bz2 JSON snapshots. Verify size_bytes and MD5 before importing. Signed download links last at most 15 minutes and never beyond key access or seven-day retention. Obtain a new link from the batch index after expiry. Retention is measured from batch_end and covers all versions. Expired batches disappear from queries and downloads immediately; background deletion runs every five minutes, with R2 lifecycle cleanup as a fallback. Physical deletion can be delayed.

Shell
export SKYVIEWOR_SURF_API_KEY="YOUR_OVERSEAS_SURF_KEY"
curl --fail -X POST -H "Authorization: Bearer $SKYVIEWOR_SURF_API_KEY" https://data.skyviewor.io/v1/surf/auth/token
sleep 2
curl --fail -H "Authorization: Bearer $SKYVIEWOR_SURF_API_KEY" "https://data.skyviewor.io/v1/surf/batches?limit=10"
json
{
  "start": "2026-12-01T12:00:00Z",
  "end": "2026-12-01T13:00:00Z",
  "data": [
    {
      "batch_start": "2026-12-01T12:50:00Z",
      "batch_end": "2026-12-01T12:55:00Z",
      "revision": 1,
      "published_at": "2026-12-01T12:55:02Z",
      "latest_observation_at": "2026-12-01T12:50:00Z",
      "station_count": 1,
      "expected_station_count": 2429,
      "size_bytes": 273,
      "md5": "EXAMPLE_MD5",
      "download_url": "https://api-delivery.skyviewor.io/EXAMPLE_SIGNED_PATH",
      "download_expires_at": "2026-12-01T13:10:00Z"
    }
  ],
  "next_before": null
}

WebSocket API

wss://data.skyviewor.io/v1/ws/surf/data
wss://data.skyviewor.io/v1/ws/surf/batches

Send subscribe with stations (strings) or all: true; a new subscribe replaces the selection. unsubscribe removes selected stations; all: true clears it. Wait for subscribed. Data messages contain one new_observation; the batches stream subscribes automatically and publishes batch_ready after verified upload. Live streams contain future updates only.

json
{"action":"subscribe","stations":["54511","58015"]}
{"action":"subscribe","all":true}
{"action":"unsubscribe","stations":["58015"]}
{"action":"unsubscribe","all":true}
{"action":"pong"}
json
{
  "type": "new_observation",
  "data": {
    "station_id": "54511",
    "publish_time": "2026-12-01T12:20:00Z",
    "temperature": 9.6,
    "feels_like_temperature": null,
    "humidity": 63,
    "rain": 0,
    "pressure": 1021.4,
    "wind_speed": 2.1,
    "wind_direction": "北风",
    "wind_direction_degree": 0,
    "wind_power_description": "2级"
  }
}

Station coverage

Only observations actually collected overseas are available. Startup, disconnections and missing stations leave gaps; an empty range does not prove no weather occurred. health reports history_start, latest batch, queue state and coverage_gaps. station_count versus expected_station_count describes coverage, not a completeness guarantee. Missing weather values are null. Temperatures: °C; humidity: %; rain: mm; pressure: hPa; wind_speed: m/s; wind_direction_degree: °. Wind direction and force descriptions retain the upstream text.

Station information and coordinates

Download the English station information table with station identifiers, names, province, city, county, coordinates and elevation. The complete upstream snapshot contains 2,573 stations and was retrieved on December 1, 2026.

Station information · English CSV ↓Station information · English JSON ↓

latitude and longitude are station coordinates in WGS84 decimal degrees; north and east are positive. elevation_m is in metres. Source numeric values and precision are preserved. Missing values are blank in CSV and null in JSON.

Headers and administrative labels are in English. Proper names use common English forms where available, otherwise Hanyu Pinyin; these display labels are not a claim of officially registered English station names.

JSON · stations
[
  {
    "station_id": "54511",
    "station_name": "Beijing",
    "province": "Beijing",
    "city": null,
    "county": "Daxing District",
    "latitude": 39.80609,
    "longitude": 116.46916,
    "elevation_m": 32.8
  },
  {
    "station_id": "58370",
    "station_name": "Pudong",
    "province": "Shanghai",
    "city": null,
    "county": "Pudong New Area",
    "latitude": 31.22124,
    "longitude": 121.54852,
    "elevation_m": 2.4
  }
]

This metadata table is broader than SURF subscription coverage. Join it to the supported station_id list: 2,426 of the current 2,429 SURF identifiers match. Metadata for 58981, 59979 and 59989 are absent from this source; their coordinates are not estimated. A metadata entry does not guarantee observations at every time.

Source documentation and original station table

Supported station identifiers · JSON ↓ · OpenAPI JSON ↓

Errors

HTTP 401: missing, invalid or expired credential; 403: wrong product, expired access or blocked API server IP; 422: invalid request; 429: request quota; 503: collector, storage, publication or authorization unavailable. WebSocket 1008: risk policy; 4403: access invalid; 1013: temporary failure or slow consumer; 4000: heartbeat timeout; 4008: reconnect. Reply to type: ping with action: pong. On server_notice, reconnect before expiry; after subscription confirmation query overlapping batch history. Retry with backoff and refresh expired tokens.

Code examples

python
# Python 3.11+: pip install httpx "websockets>=15,<16"
import asyncio, json, os
from websockets.asyncio.client import connect

async def stream(kind="data"):
    headers = {"Authorization": "Bearer " + os.environ["SKYVIEWOR_SURF_API_KEY"]}
    async with connect("wss://data.skyviewor.io/v1/ws/surf/" + kind,
                       additional_headers=headers, open_timeout=15) as ws:
        if kind == "data":
            await ws.send(json.dumps({"action": "subscribe", "all": True}))
        async for raw in ws:
            message = json.loads(raw)
            if message["type"] == "ping":
                await ws.send(json.dumps({"action": "pong"}))
            elif message["type"] == "new_observation":
                row = message["data"]
                print(row["station_id"], row["publish_time"])
            elif message["type"] == "batch_ready":
                # Use the HTTP/download example below; never log signed URLs.
                batch = message["data"]
                print(batch["batch_start"], batch["revision"])
            elif message["type"] == "server_notice":
                break  # Reconnect with backoff and catch up through the batch index.

asyncio.run(stream())
# For batch notifications instead: asyncio.run(stream("batches"))
python
import bz2, hashlib, json, os, time
from pathlib import Path
import httpx

headers = {"Authorization": "Bearer " + os.environ["SKYVIEWOR_SURF_API_KEY"]}
params = {"limit": 100}
with httpx.Client(timeout=30) as client:
    while True:
        response = client.get("https://data.skyviewor.io/v1/surf/batches",
                              headers=headers, params=params)
        response.raise_for_status()
        page = response.json()
        for batch in page["data"]:
            # Download link already carries authorization; do not forward your API key.
            download = client.get(batch["download_url"])
            download.raise_for_status()
            data = download.content
            if len(data) != batch["size_bytes"] or hashlib.md5(data).hexdigest() != batch["md5"]:
                raise ValueError("Batch checksum mismatch")
            document = json.loads(bz2.decompress(data))
            name = batch["batch_start"].replace(":", "-")
            Path(f"{name}-v{batch['revision']}.json").write_text(json.dumps(document))
        if not page["next_before"]:
            break
        params.update(start=page["start"], end=page["end"], before=page["next_before"])
        time.sleep(2)  # Compatible with trial HTTP quota.