UNPKG

ws-dottie

Version:

Your friendly TypeScript companion for Washington State transportation APIs - WSDOT and WSF data with smart caching and React Query integration

551 lines (542 loc) 22.9 kB
openapi: 3.0.0 info: title: Wsdot Weather Information API version: 1.0.0 description: Wsdot Weather Information API - Washington State Department of Transportation APIs servers: - url: https://wsdot.wa.gov/traffic/api/WeatherInformation/WeatherInformationREST.svc description: Production server components: schemas: RoadwayLocation: type: object properties: Description: type: string nullable: true description: Human-readable description of the roadway location, such as interchange names or cross streets. Direction: type: string nullable: true description: 'Traffic direction designation: N, S, B, NB, or SB, indicating which side of the highway is affected.' Latitude: type: number description: Latitude of the roadway location in decimal degrees. Longitude: type: number description: Longitude of the roadway location in decimal degrees. MilePost: type: number description: Milepost marker along the highway corridor, with 0 indicating route terminus. RoadName: type: string nullable: true description: Highway or route designation code, such as '005' for I-5 or '090' for I-90. required: - Description - Direction - Latitude - Longitude - MilePost - RoadName description: Roadway location information including route, milepost, coordinates, and direction. FetchWeatherInformationByStationIdOutput: type: object properties: BarometricPressure: type: number nullable: true description: Atmospheric pressure in millibars (not adjusted for elevation). Latitude: type: number description: Latitude of the weather station in decimal degrees. Longitude: type: number description: Longitude of the weather station in decimal degrees. PrecipitationInInches: type: number nullable: true description: Precipitation amount in inches. ReadingTime: type: string description: UTC datetime when the weather reading was taken. format: date-time RelativeHumidity: type: number nullable: true description: Relative humidity as a percentage (0-100). SkyCoverage: type: string nullable: true description: Sky coverage condition code. StationID: type: integer description: Numeric ID of the weather station. StationName: type: string nullable: true description: Display name of the weather station. TemperatureInFahrenheit: type: number nullable: true description: Current air temperature in degrees Fahrenheit. Visibility: type: integer nullable: true description: Average visibility distance in meters (computed every 3 minutes). WindDirection: type: number nullable: true description: Wind direction in degrees clockwise from north (0-359). WindDirectionCardinal: type: string nullable: true description: Wind direction in cardinal format (e.g., 'N', 'S', 'WSW'). WindGustSpeedInMPH: type: number nullable: true description: Maximum wind gust speed in miles per hour. WindSpeedInMPH: type: number nullable: true description: Average wind speed in miles per hour. required: - BarometricPressure - Latitude - Longitude - PrecipitationInInches - ReadingTime - RelativeHumidity - SkyCoverage - StationID - StationName - TemperatureInFahrenheit - Visibility - WindDirection - WindDirectionCardinal - WindGustSpeedInMPH - WindSpeedInMPH description: Current atmospheric conditions from a WSDOT Road Weather Information System station, including temperature, humidity, wind, visibility, barometric pressure, and precipitation. parameters: {} paths: /GetCurrentWeatherInformationAsJson: get: summary: List current weather information for all stations. operationId: fetchWeatherInformation tags: - weather-info x-codeSamples: - lang: JavaScript source: |- import { fetchWeatherInformation } from 'ws-dottie/wsdot-weather-information/core'; const data = await fetchWeatherInformation({ fetchMode: 'native', validate: true }); console.log(data); responses: '200': description: Success content: application/json: schema: type: array items: type: object properties: BarometricPressure: type: number nullable: true description: Atmospheric pressure in millibars (not adjusted for elevation). Latitude: type: number description: Latitude of the weather station in decimal degrees. Longitude: type: number description: Longitude of the weather station in decimal degrees. PrecipitationInInches: type: number nullable: true description: Precipitation amount in inches. ReadingTime: type: string description: UTC datetime when the weather reading was taken. format: date-time RelativeHumidity: type: number nullable: true description: Relative humidity as a percentage (0-100). SkyCoverage: type: string nullable: true description: Sky coverage condition code. StationID: type: integer description: Numeric ID of the weather station. StationName: type: string nullable: true description: Display name of the weather station. TemperatureInFahrenheit: type: number nullable: true description: Current air temperature in degrees Fahrenheit. Visibility: type: integer nullable: true description: Average visibility distance in meters (computed every 3 minutes). WindDirection: type: number nullable: true description: Wind direction in degrees clockwise from north (0-359). WindDirectionCardinal: type: string nullable: true description: Wind direction in cardinal format (e.g., 'N', 'S', 'WSW'). WindGustSpeedInMPH: type: number nullable: true description: Maximum wind gust speed in miles per hour. WindSpeedInMPH: type: number nullable: true description: Average wind speed in miles per hour. required: - BarometricPressure - Latitude - Longitude - PrecipitationInInches - ReadingTime - RelativeHumidity - SkyCoverage - StationID - StationName - TemperatureInFahrenheit - Visibility - WindDirection - WindDirectionCardinal - WindGustSpeedInMPH - WindSpeedInMPH description: Current atmospheric conditions from a WSDOT Road Weather Information System station, including temperature, humidity, wind, visibility, barometric pressure, and precipitation. examples: sampleResponse: summary: Sample response description: Example of a successful response from the API (showing first item of 101 total) value: - BarometricPressure: 957.5 Latitude: 47.4748 Longitude: -122.2704 PrecipitationInInches: null ReadingTime: '2025-11-15T17:30:00.000Z' RelativeHumidity: 99 SkyCoverage: N/A StationID: 1909 StationName: S 144th St on SB I-5 at mp 155.32 TemperatureInFahrenheit: 56.84 Visibility: 1 WindDirection: 200 WindDirectionCardinal: SSW WindGustSpeedInMPH: 0 WindSpeedInMPH: 0 /GetCurrentWeatherInformationByStationIDAsJson?StationID={StationID}: get: summary: Get current weather information for a specific station by ID. operationId: fetchWeatherInformationByStationId tags: - weather-info x-codeSamples: - lang: JavaScript source: |- import { fetchWeatherInformationByStationId } from 'ws-dottie/wsdot-weather-information/core'; const data = await fetchWeatherInformationByStationId({ params: { "StationID": 1909 }, fetchMode: 'native', validate: true }); console.log(data); responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/FetchWeatherInformationByStationIdOutput' examples: sampleResponse: summary: Sample response description: Example of a successful response from the API value: BarometricPressure: 957.5 Latitude: 47.4748 Longitude: -122.2704 PrecipitationInInches: null ReadingTime: '2025-11-15T17:30:00.000Z' RelativeHumidity: 99 SkyCoverage: N/A StationID: 1909 StationName: S 144th St on SB I-5 at mp 155.32 TemperatureInFahrenheit: 56.84 Visibility: 1 WindDirection: 200 WindDirectionCardinal: SSW WindGustSpeedInMPH: 0 WindSpeedInMPH: 0 /GetCurrentWeatherForStationsAsJson?StationList={StationList}: get: summary: Get current weather information for multiple specified stations. operationId: fetchCurrentWeatherForStations tags: - weather-info x-codeSamples: - lang: JavaScript source: |- import { fetchCurrentWeatherForStations } from 'ws-dottie/wsdot-weather-information/core'; const data = await fetchCurrentWeatherForStations({ params: { "StationList": "1909,1966,1970" }, fetchMode: 'native', validate: true }); console.log(data); responses: '200': description: Success content: application/json: schema: type: array items: type: object properties: BarometricPressure: type: number nullable: true description: Atmospheric pressure in millibars (not adjusted for elevation). Latitude: type: number description: Latitude of the weather station in decimal degrees. Longitude: type: number description: Longitude of the weather station in decimal degrees. PrecipitationInInches: type: number nullable: true description: Precipitation amount in inches. ReadingTime: type: string description: UTC datetime when the weather reading was taken. format: date-time RelativeHumidity: type: number nullable: true description: Relative humidity as a percentage (0-100). SkyCoverage: type: string nullable: true description: Sky coverage condition code. StationID: type: integer description: Numeric ID of the weather station. StationName: type: string nullable: true description: Display name of the weather station. TemperatureInFahrenheit: type: number nullable: true description: Current air temperature in degrees Fahrenheit. Visibility: type: integer nullable: true description: Average visibility distance in meters (computed every 3 minutes). WindDirection: type: number nullable: true description: Wind direction in degrees clockwise from north (0-359). WindDirectionCardinal: type: string nullable: true description: Wind direction in cardinal format (e.g., 'N', 'S', 'WSW'). WindGustSpeedInMPH: type: number nullable: true description: Maximum wind gust speed in miles per hour. WindSpeedInMPH: type: number nullable: true description: Average wind speed in miles per hour. required: - BarometricPressure - Latitude - Longitude - PrecipitationInInches - ReadingTime - RelativeHumidity - SkyCoverage - StationID - StationName - TemperatureInFahrenheit - Visibility - WindDirection - WindDirectionCardinal - WindGustSpeedInMPH - WindSpeedInMPH description: Current atmospheric conditions from a WSDOT Road Weather Information System station, including temperature, humidity, wind, visibility, barometric pressure, and precipitation. examples: sampleResponse: summary: Sample response description: Example of a successful response from the API (showing first item of 3 total) value: - BarometricPressure: 957.5 Latitude: 47.4748 Longitude: -122.2704 PrecipitationInInches: null ReadingTime: '2025-11-15T17:30:00.000Z' RelativeHumidity: 99 SkyCoverage: N/A StationID: 1909 StationName: S 144th St on SB I-5 at mp 155.32 TemperatureInFahrenheit: 56.84 Visibility: 1 WindDirection: 200 WindDirectionCardinal: SSW WindGustSpeedInMPH: 0 WindSpeedInMPH: 0 /SearchWeatherInformationAsJson?StationID={StationID}&SearchStartTime={SearchStartTime}&SearchEndTime={SearchEndTime}: get: summary: Search historical weather information for a station within a time range. operationId: searchWeatherInformation tags: - weather-info x-codeSamples: - lang: JavaScript source: |- import { searchWeatherInformation } from 'ws-dottie/wsdot-weather-information/core'; const data = await searchWeatherInformation({ params: { "StationID": 1980, "SearchStartTime": "2025-11-21T00:00:00.000Z", "SearchEndTime": "2025-11-22T23:59:59.000Z" }, fetchMode: 'native', validate: true }); console.log(data); responses: '200': description: Success content: application/json: schema: type: array items: type: object properties: BarometricPressure: type: number nullable: true description: Atmospheric pressure in millibars (not adjusted for elevation). Latitude: type: number description: Latitude of the weather station in decimal degrees. Longitude: type: number description: Longitude of the weather station in decimal degrees. PrecipitationInInches: type: number nullable: true description: Precipitation amount in inches. ReadingTime: type: string description: UTC datetime when the weather reading was taken. format: date-time RelativeHumidity: type: number nullable: true description: Relative humidity as a percentage (0-100). SkyCoverage: type: string nullable: true description: Sky coverage condition code. StationID: type: integer description: Numeric ID of the weather station. StationName: type: string nullable: true description: Display name of the weather station. TemperatureInFahrenheit: type: number nullable: true description: Current air temperature in degrees Fahrenheit. Visibility: type: integer nullable: true description: Average visibility distance in meters (computed every 3 minutes). WindDirection: type: number nullable: true description: Wind direction in degrees clockwise from north (0-359). WindDirectionCardinal: type: string nullable: true description: Wind direction in cardinal format (e.g., 'N', 'S', 'WSW'). WindGustSpeedInMPH: type: number nullable: true description: Maximum wind gust speed in miles per hour. WindSpeedInMPH: type: number nullable: true description: Average wind speed in miles per hour. required: - BarometricPressure - Latitude - Longitude - PrecipitationInInches - ReadingTime - RelativeHumidity - SkyCoverage - StationID - StationName - TemperatureInFahrenheit - Visibility - WindDirection - WindDirectionCardinal - WindGustSpeedInMPH - WindSpeedInMPH description: Current atmospheric conditions from a WSDOT Road Weather Information System station, including temperature, humidity, wind, visibility, barometric pressure, and precipitation. examples: sampleResponse: summary: Sample response description: Example of a successful response from the API (showing first item of 47 total) value: - BarometricPressure: null Latitude: 47.078 Longitude: -120.724 PrecipitationInInches: null ReadingTime: '2025-11-14T18:30:00.000Z' RelativeHumidity: 66 SkyCoverage: N/A StationID: 1980 StationName: Rocky Canyon on I-90 at mp 95.74 TemperatureInFahrenheit: 54.14 Visibility: 1 WindDirection: 310 WindDirectionCardinal: NW WindGustSpeedInMPH: 9 WindSpeedInMPH: 4 tags: - name: weather-info description: Current atmospheric conditions from WSDOT Road Weather Information System stations. x-description: Real-time temperature, humidity, wind conditions, visibility, barometric pressure, and precipitation data for transportation operations. x-cacheStrategy: FREQUENT x-useCases: - Assess road weather conditions for transportation management. - Monitor atmospheric data for traveler safety decisions. - Display current weather conditions at specific stations. - Query historical weather data by station and time range. x-updateFrequency: 5m