openapi: 3.0.0
info:
  title: Wsdot Highway Cameras API
  version: 1.0.0
  description: Wsdot Highway Cameras API - Washington State Department of Transportation APIs
servers:
  - url: https://www.wsdot.wa.gov/traffic/api/highwaycameras/highwaycamerasrest.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.
    FetchHighwayCameraByCameraIdOutput:
      type: object
      properties:
        CameraID:
          type: number
          description: Numeric ID of the camera.
        CameraLocation:
          type: object
          nullable: true
          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 for camera placement, including route and milepost.
        CameraOwner:
          type: string
          nullable: true
          description: Organization or agency that owns the camera.
        Description:
          type: string
          nullable: true
          description: Short descriptive text about the camera's purpose or location.
        DisplayLatitude:
          type: number
          description: Latitude of the camera display position in decimal degrees.
        DisplayLongitude:
          type: number
          description: Longitude of the camera display position in decimal degrees.
        ImageHeight:
          type: number
          description: Pixel height of the camera image.
        ImageURL:
          type: string
          nullable: true
          description: URL where the camera image is stored and accessible.
        ImageWidth:
          type: number
          description: Pixel width of the camera image.
        IsActive:
          type: boolean
          description: True if the camera is currently active and being updated; otherwise false.
        OwnerURL:
          type: string
          nullable: true
          description: Website URL for the camera owner organization.
        Region:
          type: string
          nullable: true
          description: WSDOT region code that owns the camera.
        SortOrder:
          type: number
          description: Display sort order; lower values appear first when sorting cameras by location.
        Title:
          type: string
          nullable: true
          description: Display name of the camera.
      required:
        - CameraID
        - CameraLocation
        - CameraOwner
        - Description
        - DisplayLatitude
        - DisplayLongitude
        - ImageHeight
        - ImageURL
        - ImageWidth
        - IsActive
        - OwnerURL
        - Region
        - SortOrder
        - Title
      description: Highway camera information including location data, image URLs, status, ownership, and display metadata.
  parameters: {}
paths:
  /searchCamerasAsJson:
    get:
      summary: Search cameras by route and milepost range.
      operationId: searchHighwayCamerasByRouteAndMilepost
      tags:
        - cameras
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import { searchHighwayCamerasByRouteAndMilepost } from 'ws-dottie/wsdot-highway-cameras/core';

            const data = await searchHighwayCamerasByRouteAndMilepost({
              params: {
                "StateRoute": "I-5",
                "StartingMilepost": 10,
                "EndingMilepost": 20
              },
              fetchMode: 'native',
              validate: true
            });

            console.log(data);
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    CameraID:
                      type: number
                      description: Numeric ID of the camera.
                    CameraLocation:
                      type: object
                      nullable: true
                      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 for camera placement, including route and milepost.
                    CameraOwner:
                      type: string
                      nullable: true
                      description: Organization or agency that owns the camera.
                    Description:
                      type: string
                      nullable: true
                      description: Short descriptive text about the camera's purpose or location.
                    DisplayLatitude:
                      type: number
                      description: Latitude of the camera display position in decimal degrees.
                    DisplayLongitude:
                      type: number
                      description: Longitude of the camera display position in decimal degrees.
                    ImageHeight:
                      type: number
                      description: Pixel height of the camera image.
                    ImageURL:
                      type: string
                      nullable: true
                      description: URL where the camera image is stored and accessible.
                    ImageWidth:
                      type: number
                      description: Pixel width of the camera image.
                    IsActive:
                      type: boolean
                      description: True if the camera is currently active and being updated; otherwise false.
                    OwnerURL:
                      type: string
                      nullable: true
                      description: Website URL for the camera owner organization.
                    Region:
                      type: string
                      nullable: true
                      description: WSDOT region code that owns the camera.
                    SortOrder:
                      type: number
                      description: Display sort order; lower values appear first when sorting cameras by location.
                    Title:
                      type: string
                      nullable: true
                      description: Display name of the camera.
                  required:
                    - CameraID
                    - CameraLocation
                    - CameraOwner
                    - Description
                    - DisplayLatitude
                    - DisplayLongitude
                    - ImageHeight
                    - ImageURL
                    - ImageWidth
                    - IsActive
                    - OwnerURL
                    - Region
                    - SortOrder
                    - Title
                  description: Highway camera information including location data, image URLs, status, ownership, and display metadata.
              examples:
                sampleResponse:
                  summary: Sample response
                  description: Example of a successful response from the API (showing first item of 12 total)
                  value:
                    - CameraID: 9290
                      CameraLocation:
                        Description: null
                        Direction: B
                        Latitude: 45.753907
                        Longitude: -122.66372
                        MilePost: 10
                        RoadName: I-5
                      CameraOwner: null
                      Description: null
                      DisplayLatitude: 45.753907
                      DisplayLongitude: -122.66372
                      ImageHeight: 249
                      ImageURL: https://images.wsdot.wa.gov/sw/005vc00976.jpg
                      ImageWidth: 335
                      IsActive: true
                      OwnerURL: null
                      Region: SW
                      SortOrder: 1000
                      Title: 'I-5 at MP 9.7: N of 179th St'
  /getCameraAsJson?CameraID={CameraID}:
    get:
      summary: Get camera details by camera ID.
      operationId: fetchHighwayCameraByCameraId
      tags:
        - cameras
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import { fetchHighwayCameraByCameraId } from 'ws-dottie/wsdot-highway-cameras/core';

            const data = await fetchHighwayCameraByCameraId({
              params: {
                "CameraID": 9818
              },
              fetchMode: 'native',
              validate: true
            });

            console.log(data);
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FetchHighwayCameraByCameraIdOutput'
              examples:
                sampleResponse:
                  summary: Sample response
                  description: Example of a successful response from the API
                  value:
                    CameraID: 9818
                    CameraLocation:
                      Description: null
                      Direction: W
                      Latitude: 48.498333
                      Longitude: -122.6625
                      MilePost: 1
                      RoadName: Airports
                    CameraOwner: WSDOT Aviation
                    Description: null
                    DisplayLatitude: 48.498333
                    DisplayLongitude: -122.6625
                    ImageHeight: 208
                    ImageURL: https://images.wsdot.wa.gov/airports/anafuel.jpg
                    ImageWidth: 352
                    IsActive: true
                    OwnerURL: https://wsdot.wa.gov/travel/aviation/airports-list/anacortes
                    Region: WA
                    SortOrder: 5300
                    Title: Anacortes Airport Fuel Pump
  /getCamerasAsJson:
    get:
      summary: List all highway cameras statewide.
      operationId: fetchHighwayCameras
      tags:
        - cameras
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import { fetchHighwayCameras } from 'ws-dottie/wsdot-highway-cameras/core';

            const data = await fetchHighwayCameras({
              fetchMode: 'native',
              validate: true
            });

            console.log(data);
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    CameraID:
                      type: number
                      description: Numeric ID of the camera.
                    CameraLocation:
                      type: object
                      nullable: true
                      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 for camera placement, including route and milepost.
                    CameraOwner:
                      type: string
                      nullable: true
                      description: Organization or agency that owns the camera.
                    Description:
                      type: string
                      nullable: true
                      description: Short descriptive text about the camera's purpose or location.
                    DisplayLatitude:
                      type: number
                      description: Latitude of the camera display position in decimal degrees.
                    DisplayLongitude:
                      type: number
                      description: Longitude of the camera display position in decimal degrees.
                    ImageHeight:
                      type: number
                      description: Pixel height of the camera image.
                    ImageURL:
                      type: string
                      nullable: true
                      description: URL where the camera image is stored and accessible.
                    ImageWidth:
                      type: number
                      description: Pixel width of the camera image.
                    IsActive:
                      type: boolean
                      description: True if the camera is currently active and being updated; otherwise false.
                    OwnerURL:
                      type: string
                      nullable: true
                      description: Website URL for the camera owner organization.
                    Region:
                      type: string
                      nullable: true
                      description: WSDOT region code that owns the camera.
                    SortOrder:
                      type: number
                      description: Display sort order; lower values appear first when sorting cameras by location.
                    Title:
                      type: string
                      nullable: true
                      description: Display name of the camera.
                  required:
                    - CameraID
                    - CameraLocation
                    - CameraOwner
                    - Description
                    - DisplayLatitude
                    - DisplayLongitude
                    - ImageHeight
                    - ImageURL
                    - ImageWidth
                    - IsActive
                    - OwnerURL
                    - Region
                    - SortOrder
                    - Title
                  description: Highway camera information including location data, image URLs, status, ownership, and display metadata.
              examples:
                sampleResponse:
                  summary: Sample response
                  description: Example of a successful response from the API (showing first item of 1648 total)
                  value:
                    - CameraID: 9818
                      CameraLocation:
                        Description: null
                        Direction: W
                        Latitude: 48.498333
                        Longitude: -122.6625
                        MilePost: 1
                        RoadName: Airports
                      CameraOwner: WSDOT Aviation
                      Description: null
                      DisplayLatitude: 48.498333
                      DisplayLongitude: -122.6625
                      ImageHeight: 208
                      ImageURL: https://images.wsdot.wa.gov/airports/anafuel.jpg
                      ImageWidth: 352
                      IsActive: true
                      OwnerURL: https://wsdot.wa.gov/travel/aviation/airports-list/anacortes
                      Region: WA
                      SortOrder: 5300
                      Title: Anacortes Airport Fuel Pump
tags:
  - name: cameras
    description: Traffic monitoring cameras on Washington state highways.
    x-description: Camera locations, image URLs, status, and metadata for real-time traffic condition visibility.
    x-cacheStrategy: STATIC
    x-useCases:
      - Display live camera feeds in traffic monitoring applications.
      - Show road conditions and weather impacts for route planning.
      - Provide visual traffic status in traveler information systems.
    x-updateFrequency: 5m
