Discover/Gov API
live

Gov APInsbd.swj.beijing.gov.cn ↗

Access 24-hour precipitation readings from Beijing hydrological monitoring stations, grouped by district with summary statistics, via the Beijing Water Authority.

Endpoint health
verified 3d ago
get_rainfall
1/1 passing latest checkself-healing
Endpoints
1
Updated
2mo ago

What is the Gov API?

The Beijing Water Authority Rainfall API exposes 1 endpoint — get_rainfall — that returns precipitation measurements from all monitoring stations across Beijing's districts, covering a 24-hour window ending at 8:00 AM on the queried date. Each response includes per-station readings with station codes and names, district groupings, rainfall amounts in millimeters, and summary statistics such as city-wide averages, maximums, and year-to-date cumulative totals.

This call costs1 credit / call— charged only on success
Try it
Query date in ISO format YYYY-MM-DD. The response covers the 24-hour period ending at 8:00 AM on this date. Defaults to yesterday when omitted.
→ api.parse.bot/scraper/50f211e6-1d38-4e24-9fd3-0082ee9dea8d/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/50f211e6-1d38-4e24-9fd3-0082ee9dea8d/get_rainfall?date=2026-09-27' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace nsbd-swj-beijing-gov-cn-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Walkthrough: Beijing Rainfall Monitoring — fetch and inspect station data."""
from parse_apis.nsbd_swj_beijing_gov_cn_api import BeijingRainfall, InputFormatInvalid

client = BeijingRainfall()

# Fetch yesterday's rainfall report (default when date is omitted).
try:
    report = client.reports.get()
except InputFormatInvalid as e:
    print("Invalid date format:", e.message)
    raise

# Display the measurement period covered by this report.
print("Period:", report.query_period)

# Show per-station readings.
for station in report.stations[:5]:
    print(f"  {station.station_name} ({station.district}): {station.rainfall_mm} mm")

# Show summary statistics (average, max, etc.).
for stat in report.statistics:
    print(f"  [stat] {stat.station_name}: {stat.rainfall_mm} mm")

# Fetch a specific historical date.
historical = client.reports.get(date="2026-08-01")
print("Historical period:", historical.query_period)
print(f"  Stations reported: {len(historical.stations)}")

print("exercised: reports.get (default + explicit date)")
All endpoints · 1 totalmissing one? ·

Returns rainfall measurements from all monitoring stations in Beijing for a 24-hour period ending at 8:00 AM on the queried date. Includes per-station readings grouped by district and summary statistics (average, maximum, year-to-date cumulative, etc.). When date is omitted, defaults to yesterday.

Input
ParamTypeDescription
datestringQuery date in ISO format YYYY-MM-DD. The response covers the 24-hour period ending at 8:00 AM on this date. Defaults to yesterday when omitted.
Response
{
  "type": "object",
  "fields": {
    "stations": "Array of station rainfall readings, each with station_code, station_name, district, and rainfall_mm",
    "statistics": "Array of summary statistics (average, max, year-to-date, etc.) with the same shape as station entries",
    "query_period": "Human-readable label describing the measurement period (e.g. '2026年08月12日8时 至 2026年08月13日8时')"
  },
  "sample": {
    "data": {
      "stations": [
        {
          "district": "城近郊区",
          "rainfall_mm": 20.5,
          "station_code": "30523930",
          "station_name": "天安门"
        },
        {
          "district": "城近郊区",
          "rainfall_mm": 11.3,
          "station_code": "30523800",
          "station_name": "松林闸"
        },
        {
          "district": "延庆",
          "rainfall_mm": 79.5,
          "station_code": "30745500",
          "station_name": "永宁"
        }
      ],
      "statistics": [
        {
          "district": "统计",
          "rainfall_mm": 15.6,
          "station_code": "1111",
          "station_name": "平均降水量"
        },
        {
          "district": "统计",
          "rainfall_mm": 94.8,
          "station_code": "2222",
          "station_name": "最大降水量"
        }
      ],
      "query_period": "2026 年 08 月 12 日 8 时  至 2026 年 08 月 13 日 8 时"
    },
    "status": "success"
  }
}

About the Gov API

What the API Returns

The get_rainfall endpoint returns structured precipitation data published by the Beijing Water Authority (北京市水务局). Each response contains a stations array, where every entry includes station_code, station_name, district, and rainfall_mm. A parallel statistics array carries computed summary metrics — average rainfall, maximum single-station reading, year-to-date cumulative totals, and others — in the same shape as station entries. The query_period field provides a human-readable Chinese-language label confirming the exact 24-hour measurement window.

Query Parameters

The single optional input is date, a string in YYYY-MM-DD format. When supplied, the response covers the 24-hour period ending at 8:00 AM on that date. When omitted, the API defaults to the most recent available reporting period, making it straightforward to poll for the latest published figures without tracking dates manually.

Source and Coverage

Data originates from official hydrological monitoring stations distributed across Beijing's administrative districts. Because readings are grouped by district, consumers can filter or aggregate at the district level without post-processing the full station list. Coverage is limited to stations operated and reported by the Beijing Water Authority; private or third-party weather sensor networks are not included.

Limitations

The reporting cadence is once per day, anchored to the 8:00 AM boundary. Intra-day or sub-hourly precipitation data is not available through this endpoint. Historical depth depends on what the source publishes; very old dates may return empty or no data.

Reliability & maintenanceVerified

The Gov API is a managed, monitored endpoint for nsbd.swj.beijing.gov.cn — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when nsbd.swj.beijing.gov.cn changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official nsbd.swj.beijing.gov.cn API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
3d ago
Latest check
1/1 endpoint passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Track daily district-level rainfall totals in Beijing for flood early-warning dashboards
  • Aggregate year-to-date cumulative precipitation from the statistics array for seasonal drought monitoring
  • Identify the highest-rainfall stations via the max statistic for infrastructure risk assessments
  • Feed rainfall_mm readings into irrigation scheduling systems for Beijing-area agricultural operations
  • Build historical precipitation archives by querying get_rainfall with sequential date values
  • Compare per-district rainfall from the district field to correlate with runoff or soil moisture datasets
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo2005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min
Team$300/mo20,000300 req/min
Company$1,000/mo100,000500 req/min

Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does nsbd.swj.beijing.gov.cn offer an official developer API?+
The Beijing Water Authority (北京市水务局) publishes its hydrological monitoring data through a public-facing web portal at nsbd.swj.beijing.gov.cn but does not provide a documented public developer API with authentication keys or versioned endpoints.
What does the `statistics` array in `get_rainfall` contain, and how is it different from the `stations` array?+
The stations array contains one entry per monitoring station with that station's individual rainfall_mm reading. The statistics array uses the same field shape but holds computed aggregates — such as the city-wide average, maximum, and year-to-date cumulative rainfall — rather than individual station readings. Both arrays are returned in a single call.
Can I retrieve sub-hourly or real-time intra-day rainfall data?+
Not currently. The API covers one 24-hour reporting period per query, anchored to 8:00 AM on the queried date. Sub-hourly or live intra-day readings are not exposed. You can fork this API on Parse and revise it to add an endpoint targeting finer-grained data if the source publishes it.
Does the API return river water-level or reservoir storage data from Beijing's hydrological network?+
Not currently. The API covers rainfall measurements from precipitation monitoring stations only. Water-level, flow-rate, and reservoir capacity data are not included in the current endpoint. You can fork this API on Parse and revise it to add endpoints for those data types if they appear on the source site.
How far back does historical rainfall data go?+
The available history depends on what the Beijing Water Authority retains in its public portal. Querying very old dates via the date parameter may return empty results. Testing a range of recent dates is the most reliable way to determine the practical historical depth for your use case.
Page content last updated . Spec covers 1 endpoint from nsbd.swj.beijing.gov.cn.
Related APIs in WeatherSee all →
weather.com.cn API
Get real-time weather conditions, 7-day to 40-day forecasts, air quality data, and weather alerts for any city in China. Track hourly observations and life indices to plan your activities with complete weather intelligence.
hydro.chmi.cz API
Monitor real-time water conditions across 562+ Czech river stations by accessing live water levels, flow rates, temperatures, and flood alerts. Search and track specific stations to get detailed hydrological data and historical time series information from the Czech Hydrometeorological Institute.
gkd.bayern.de API
Monitor groundwater levels and access historical time series data from Munich's official water monitoring stations to track water stress conditions across the city's drinking water supply regions. Get real-time station information and current water levels to stay informed about local water availability and supply status.
data.stats.gov.cn API
Access comprehensive statistical data, economic indicators, and official reports from China's National Bureau of Statistics through simple searches and structured queries. Retrieve detailed articles, data releases, indicator trends, and downloadable documents to analyze China's economic and social statistics.
dataonline.bmkg.go.id API
Access Indonesia's weather station information and check the availability of meteorological data including rainfall, temperature, and sunshine duration readings. Search across different regions and station types to find the weather data you need.
wunderground.com API
Access real-time weather conditions, multi-day forecasts, and detailed historical weather data from thousands of personal and airport weather stations worldwide. Search and retrieve current observations, hourly history, and monthly records to power your weather applications and analysis.
forecast.weather.gov API
Get National Weather Service station metadata plus the latest and recent weather observations (temperature, wind, pressure, humidity, and METAR text) for a specified station ID.
api.weather.gov API
Access data from api.weather.gov.