Gov APIrtr.pbs.gov.tw ↗
Access real-time road conditions across Taiwan from the Police Broadcasting Service. Filter by region or highway. Live accident, congestion, and hazard data.
What is the Gov API?
The PBS Taiwan Road Conditions API exposes live traffic and road incident data from the Police Broadcasting Service (rtr.pbs.gov.tw) across 3 endpoints. Each record returns 8 structured fields including category, area, location, and info describing the condition. The get_road_conditions_by_region endpoint lets you filter by named region such as 北部 or 南部, while get_road_conditions_by_highway narrows results to a specific highway like 國道1號.
curl -X GET 'https://api.parse.bot/scraper/0ffc8282-b83d-4780-b5e0-10ac06bc8cff/get_road_conditions?limit=5' \ -H 'X-API-Key: $PARSE_API_KEY'
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 rtr-pbs-gov-tw-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.
"""PBS Road Conditions — real-time traffic monitoring from Taiwan's Police Broadcasting Service."""
from parse_apis.pbs_road_conditions_api import PBSRoad, Region, RegionInvalid
client = PBSRoad()
# List the most recent road conditions across all regions.
for condition in client.roadconditions.list(limit=5):
print(condition.category, condition.area, condition.location, condition.info[:60])
# Filter by region using the Region enum — Northern Taiwan.
northern = client.roadconditions.by_region(region=Region.NORTH, limit=3).first()
if northern:
print(northern.number, northern.category, northern.source)
# Search by highway name — National Freeway 1.
for cond in client.roadconditions.by_highway(highway="國道1號", limit=3):
print(cond.number, cond.location, cond.uptime)
# Typed error handling for invalid region input.
try:
client.roadconditions.by_region(region="", limit=1).first()
except RegionInvalid as exc:
print(f"Invalid region: {exc}")
print("exercised: roadconditions.list / by_region / by_highway + RegionInvalid error")
Fetches all real-time road conditions from the Police Broadcasting Service. Returns records ordered by most recent update time. The limit parameter caps total items returned.
| Param | Type | Description |
|---|---|---|
| limit | integer | Maximum number of results to return. |
{
"type": "object",
"fields": {
"items": "array of road condition records, each containing number, category, uptime, date, time, source, area, location, and info"
},
"sample": {
"data": {
"items": [
{
"area": "北部",
"date": "今天",
"info": "福爾摩沙高速公路-國道3號南下於70公里至95公里之間",
"time": "12:06",
"number": "11506110157",
"source": "高速公路局北區交控中心",
"uptime": "今天 12:07",
"category": "道路施工",
"location": "福爾摩沙高速公路-國道3號"
}
]
},
"status": "success"
}
}About the Gov API
What the API Returns
All three endpoints return arrays of road condition records sourced from the Police Broadcasting Service's real-time feed, aggregated via road.ioi.tw. Every record includes: number (record identifier), category (incident type), uptime (freshness indicator), date, time, source (reporting agency), area (geographic area), location (specific road location), and info (free-text description of the condition). Results are ordered by most recent update time.
Filtering by Region and Highway
get_road_conditions_by_region accepts a region parameter using either Chinese region names (北部, 中部, 南部, 東部, 國道, 全區) or their single-letter codes (N, M, S, E, F). This makes it straightforward to isolate conditions for a specific part of Taiwan. get_road_conditions_by_highway accepts a highway string — for example 國道1號 or 國道3號 — and performs a keyword match against records, useful when monitoring a specific freeway corridor.
Pagination and Volume Control
All three endpoints accept an optional limit integer parameter that caps the number of records returned. When omitted, the default result set is returned ordered by recency. There is no explicit offset or cursor parameter in the current API surface, so limit is the primary tool for controlling response volume. The get_road_conditions endpoint fetches the full cross-Taiwan feed without any region or highway filter applied.
The Gov API is a managed, monitored endpoint for rtr.pbs.gov.tw — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when rtr.pbs.gov.tw 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 rtr.pbs.gov.tw 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.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Display a live incident map for Taiwan highways using the
areaandlocationfields - Send push alerts to drivers when new conditions appear on a watched highway via
get_road_conditions_by_highway - Build a regional dashboard for northern or southern Taiwan using
get_road_conditions_by_regionwith 北部 or 南部 - Log historical road condition records by polling the API and storing
date,time, andcategoryfields - Filter and surface only freeway incidents by querying the 國道 region code
- Aggregate incident frequency by
categorytype across all regions to identify recurring hazard patterns - Feed real-time road data into a route-planning tool to flag active disruptions along a selected corridor
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does the Police Broadcasting Service provide an official developer API?+
What does the `info` field contain, and is it machine-parseable?+
info field is a free-text Chinese-language string describing the specific road condition — for example, lane closures, accident details, or hazard descriptions. It is not structured into sub-fields, so parsing specific attributes from it requires your own text processing.Does the API cover city streets and provincial roads, or only national freeways?+
Is there a way to paginate through results beyond the first page?+
limit parameter to cap result count but does not include an offset, page number, or cursor parameter. All three endpoints return results ordered by most recent update time, so the freshest records are always at the top of the response. You can fork the API on Parse and revise it to add offset-based pagination if your use case requires deeper result sets.Can I filter conditions by incident category, such as accidents only?+
category field is present in every response record and can be filtered client-side after retrieval. You can fork the API on Parse and revise it to add a category query parameter that pre-filters the result set server-side.