jurisdiction
Query Optionalstring
Canonical jurisdiction code. When route is supplied for an active Big Bear MVP route and jurisdiction is omitted, the effective jurisdiction defaults to US-CA.
Developers
Conditions
Overview
/v1/conditions
Conditions is the detailed filtering and debugging surface for live road-condition rows. Use it when a caller needs segment-level detail, list pagination, or explicit filter control after destination or route discovery.
Path and query parameters are documented together so the request surface stays easy to scan.
jurisdiction
Query Optionalstring
Canonical jurisdiction code. When route is supplied for an active Big Bear MVP route and jurisdiction is omitted, the effective jurisdiction defaults to US-CA.
route
Query Optionalstring
Canonical route filter. Comma-separated values are allowed. For the active Big Bear MVP, supported examples include SR-18, SR-38, SR-138, and SR-330.
overall_status
Query Optionalstring
Comma-separated overall_status filter using open, advisory, restricted, or closed.
chain_control_severity_gte
Query Optionalinteger
Minimum chain-control severity filter in the range 0 through 4.
include_open
Query Optionalboolean
Defaults to false. Set true to include open rows alongside the default non-open live filter.
is_active
Query Optionalboolean
Defaults to true. Set false to return only inactive rows. Inactive queries are not suppressed by current source health.
cursor
Query Optionalstring
Opaque pagination cursor from the previous page. Invalid cursors return INVALID_PARAMETER.
limit
Query Optionalinteger
Page size. Default 50, maximum 200.
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
| jurisdiction | Query | No | string | Canonical jurisdiction code. When route is supplied for an active Big Bear MVP route and jurisdiction is omitted, the effective jurisdiction defaults to US-CA. |
| route | Query | No | string | Canonical route filter. Comma-separated values are allowed. For the active Big Bear MVP, supported examples include SR-18, SR-38, SR-138, and SR-330. |
| overall_status | Query | No | string | Comma-separated overall_status filter using open, advisory, restricted, or closed. |
| chain_control_severity_gte | Query | No | integer | Minimum chain-control severity filter in the range 0 through 4. |
| include_open | Query | No | boolean | Defaults to false. Set true to include open rows alongside the default non-open live filter. |
| is_active | Query | No | boolean | Defaults to true. Set false to return only inactive rows. Inactive queries are not suppressed by current source health. |
| cursor | Query | No | string | Opaque pagination cursor from the previous page. Invalid cursors return INVALID_PARAMETER. |
| limit | Query | No | integer | Page size. Default 50, maximum 200. |
Use the same endpoint across all three snippets. The tabs switch only the client syntax.
cURL
curl -sS "https://api-staging.mountainswitch.co/v1/conditions?route=SR-18&overall_status=restricted,closed" \
-H "Accept: application/json" TypeScript
const response = await fetch(
"https://api-staging.mountainswitch.co/v1/conditions?route=SR-18&overall_status=restricted,closed",
{
headers: {
Accept: "application/json",
},
},
);
const payload = await response.json(); Python
import requests
response = requests.get(
"https://api-staging.mountainswitch.co/v1/conditions",
params={
"route": "SR-18",
"overall_status": "restricted,closed",
},
headers={"Accept": "application/json"},
)
payload = response.json()
The example response shows the documented JSON envelope with endpoint data in
data and request metadata in
_meta.
{
"data": [
{
"id": "ca-chain-controls:2012",
"source": "ca-chain-controls",
"source_record_id": "2012",
"jurisdiction": "US-CA",
"route": "SR-18",
"direction": "N",
"segment_description": "Lower Waterman Cyn thru Vista Point",
"start_lat": 34.2101,
"start_lon": -117.2847,
"end_lat": null,
"end_lon": null,
"county": "SBd",
"elevation": 4500,
"type_of_work": null,
"type_of_closure": null,
"estimated_delay_minutes": null,
"lanes_closed": null,
"total_existing_lanes": null,
"overall_status": "restricted",
"chain_control_severity": 3,
"chain_control_code": "chains_awd_exempt",
"chain_control_raw": "R-2",
"alert_type": "chain_control",
"vehicle_restrictions": [],
"status_description": "Chains or traction devices required. AWD with snow tires exempt.",
"road_surface": null,
"visibility": null,
"speed_limit": null,
"is_active": true,
"source_updated_at": "2026-03-19T12:43:00Z",
"fetched_at": "2026-03-19T12:45:00Z",
"valid_from": "2026-03-19T12:43:00Z",
"valid_until": null
}
],
"_meta": {
"sources": [
{
"source": "ca-chain-controls",
"freshness": "healthy",
"live_eligible": true,
"covers_query": true,
"source_updated_at": "2026-03-19T12:43:00Z",
"fetched_at": "2026-03-19T12:45:00Z"
}
],
"query_coverage": "full",
"request_id": "req_conditions_docs",
"response_generated_at": "2026-03-19T12:47:30Z",
"pagination": {
"cursor": "eyJpZCI6ImNhLWNoYWluLWNvbnRyb2xzOjIwMTIiLCJvIjoyLCJzIjozfQ==",
"has_more": true
}
}
} This reference stays flat on purpose so the documented fields remain easy to scan.
These rows keep the repo-wide rate-limit and infrastructure behavior visible without inventing endpoint-specific transport semantics.
| Status | Code | When it happens |
|---|---|---|
| 400 | INVALID_PARAMETER | The request contains an invalid cursor, malformed boolean, repeated query parameter, or other unsupported query value. |
| 400 | INVALID_JURISDICTION | The provided jurisdiction value does not canonicalize to a known jurisdiction code. |
| 404 | ROUTE_NOT_FOUND | A supplied route filter is unknown or unsupported for the resolved jurisdiction. |
| 429 | RATE_LIMIT_EXCEEDED | The caller exceeded the shared API rate limit. |
| 503 | SERVICE_UNAVAILABLE | D1 or another critical dependency is unavailable. |
These notes capture the contract edges that matter most for consumers of the endpoint.
GET /v1/conditions defaults to active non-open rows only. Use include_open=true to widen the live result set, or set is_active=false to query only inactive rows.
For live conditions queries, rows from sources with live_eligible=false are excluded even if older D1 rows still exist. Those sources still appear in _meta.sources and still affect _meta.query_coverage.
Conditions always paginate. Cache only applies to first-page responses with _meta.query_coverage === full. Partial and none responses are no-store.
Subsection
/v1/conditions/:id
Use the single-record conditions lookup for deep links, operator debugging, and record-scoped observability. This endpoint returns one stored row even when current source health is stale or down, but the coverage rules remain explicit.
Path and query parameters are documented together so the request surface stays easy to scan.
id
Path Requiredstring
Stable condition identifier from GET /v1/conditions. Unknown identifiers return 404 CONDITION_NOT_FOUND.
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
| id | Path | Yes | string | Stable condition identifier from GET /v1/conditions. Unknown identifiers return 404 CONDITION_NOT_FOUND. |
Use the same endpoint across all three snippets. The tabs switch only the client syntax.
cURL
curl -sS "https://api-staging.mountainswitch.co/v1/conditions/ca-chain-controls:2012" \
-H "Accept: application/json" TypeScript
const response = await fetch(
"https://api-staging.mountainswitch.co/v1/conditions/ca-chain-controls:2012",
{
headers: {
Accept: "application/json",
},
},
);
const payload = await response.json(); Python
import requests
response = requests.get(
"https://api-staging.mountainswitch.co/v1/conditions/ca-chain-controls:2012",
headers={"Accept": "application/json"},
)
payload = response.json()
The example response shows the documented JSON envelope with endpoint data in
data and request metadata in
_meta.
{
"data": {
"id": "ca-chain-controls:2012",
"source": "ca-chain-controls",
"source_record_id": "2012",
"jurisdiction": "US-CA",
"route": "SR-18",
"direction": "N",
"segment_description": "Lower Waterman Cyn thru Vista Point",
"start_lat": 34.2101,
"start_lon": -117.2847,
"end_lat": null,
"end_lon": null,
"county": "SBd",
"elevation": 4500,
"type_of_work": null,
"type_of_closure": null,
"estimated_delay_minutes": null,
"lanes_closed": null,
"total_existing_lanes": null,
"overall_status": "restricted",
"chain_control_severity": 3,
"chain_control_code": "chains_awd_exempt",
"chain_control_raw": "R-2",
"alert_type": "chain_control",
"vehicle_restrictions": [],
"status_description": "Chains or traction devices required. AWD with snow tires exempt.",
"road_surface": null,
"visibility": null,
"speed_limit": null,
"is_active": true,
"source_updated_at": "2026-03-19T12:43:00Z",
"fetched_at": "2026-03-19T12:45:00Z",
"valid_from": "2026-03-19T12:43:00Z",
"valid_until": null
},
"_meta": {
"sources": [
{
"source": "ca-chain-controls",
"freshness": "healthy",
"live_eligible": true,
"covers_query": true,
"source_updated_at": "2026-03-19T12:43:00Z",
"fetched_at": "2026-03-19T12:45:00Z"
}
],
"query_coverage": "full",
"request_id": "req_condition_by_id_docs",
"response_generated_at": "2026-03-19T12:47:30Z",
"pagination": null
}
} This reference stays flat on purpose so the documented fields remain easy to scan.
These rows keep the repo-wide rate-limit and infrastructure behavior visible without inventing endpoint-specific transport semantics.
| Status | Code | When it happens |
|---|---|---|
| 404 | CONDITION_NOT_FOUND | No stored condition row exists for the requested id. |
| 429 | RATE_LIMIT_EXCEEDED | The caller exceeded the shared API rate limit. |
| 503 | SERVICE_UNAVAILABLE | D1 or another critical dependency is unavailable. |
These notes capture the contract edges that matter most for consumers of the endpoint.
GET /v1/conditions/:id may return a stored row even when the source is currently stale or down. Check _meta.query_coverage before treating the row as proof that a restriction is live right now.
The response includes exactly one _meta.sources entry and derives query_coverage from that source only. Down returns none. live_eligible=false or stale returns partial.
GET /v1/conditions/:id is never written to the response KV cache and must always return Cache-Control: no-store.