Skip to main content

Weather

Weather lookups for field service planning and retrospective analysis. Backed by a third-party weather provider. Responses include hourly conditions and a summary with outdoor_work_risk (low, moderate, or high).

GET /weather/forecast

Forecast weather for a latitude/longitude. Query parameters: Response includes: mode (forecast), period_start, period_end, summary (avg/min/max temp, precipitation, wind, dominant_condition, outdoor_work_risk), and hourly[] (temperature, humidity, precipitation, rain, weather code/label, wind, cloud cover). Enum, summary.outdoor_work_risk: low, moderate, high Example:
Use cases:
  • Dispatch planning: Check conditions for a postcode centroid before assigning outdoor work.
  • Briefing enrichment: Pair with POST /briefing/generate to surface visit-day risk in engineer packs.

GET /weather/historical

Historical weather for a latitude/longitude and date range. Query parameters: Response: Same shape as forecast; mode is historical. Archive data is available from 1940 onwards. Example:
Use cases:
  • Delay analysis: Correlate completed jobs with heavy rain or high wind on the service date.
  • SLA disputes: Provide objective weather evidence for missed appointments.

GET /weather/for-job/

Weather for a specific job. Coordinates and time window are resolved from the intelligence layer. Path parameters: Query parameters: Behaviour:
  • Completed jobs (actual end in the past) → historical weather for the job window.
  • Future or in-progress jobs → forecast for planned/actual start–end.
  • Response includes a job object: job_id, reference, site_address, status.
Example:
Use cases:
  • Connie / agent tools: Answer “was weather a factor on job X?” without manual coordinate lookup.
  • Investigation: Combine with outcome search when diagnosing repeat failures or delays.
Errors: 404 if the job or linked site is missing; 422 if the site has no latitude/longitude.

GET /weather/for-site

Weather for a customer or site over a date range. Coordinates are resolved from the graph. Query parameters: One of contact_id or site_key is required. When contact_id has no coordinates, the API falls back to the most recent linked site with lat/lon. Response includes: Standard weather payload plus site (contact_id, site_key, site_address). Example:
Use cases:
  • Account planning: Review forecast for a key customer across a multi-day PPM window.
  • Site risk: Assess outdoor-work risk at a repeat-failure location before scheduling.
Notes:
  • outdoor_work_risk uses rule-based thresholds (heavy rain, gusts >60 km/h, freezing, snow/ice codes).
  • Forecast horizon is up to 16 days; historical archive from 1940.
  • Weather service errors return 502.