openapi: 3.0.0
info:
  title: WeatherLink API
  version: "v2"
  description: >
    <p>
    Metadata endpoints describe weather stations and their component parts, as
    well as the structure of the data available from the Weather Data endpoints.
    </p>
    <p>
    Weather Data endpoints provide current and historical data as it
    was sent by the weather station to WeatherLink.com, but in a human readable
    JSON format.
    </p>
    <p>
    Reports endpoints provide weather observation data but are not able to be
    categorized in the Weather Data category. This is mainly due to the fact
    that the data returned by Reports endpoints does not adhere to the
    requirement that the data format matches what was sent to WeatherLink.com.
    </p>
  contact:
    name: API Support
    url: "https://weatherlink.github.io/v2-api/support"
servers:
  - url: "https://api.weatherlink.com/v2"
tags:
  - name: Metadata
    description: Metadata endpoints describe weather stations and their component parts, as well as the structure of the data available from the Weather Data endpoints
  - name: Weather Data
    description: Weather sensor observation data as it was sent to WeatherLink.com
  - name: Reports
    description: Additional weather sensor observation data
paths:
  /stations:
    get:
      tags:
        - Metadata
      summary: Get metadata for all weather stations
      description: >
        Returns metadata for all weather stations which are accessible with your API Key.
        Currently all stations are returned in a single response.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
  "/stations/{station-ids}":
    get:
      tags:
        - Metadata
      summary: Get metadata for specific weather stations
      description: >
        Returns metadata for specific weather stations which are accessible by your API key.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
        - $ref: "#/components/parameters/station-ids"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
  /nodes:
    get:
      tags:
        - Metadata
      summary: Get metadata for all nodes
      description: >
        Returns metadata for all nodes which are accessible with your API Key.
        Currently all nodes are returned in a single response.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
  "/nodes/{node-ids}":
    get:
      tags:
        - Metadata
      summary: Get metadata for specific nodes
      description: >
        Returns metadata for specific nodes which are accessible by your API key.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
        - $ref: "#/components/parameters/node-ids"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
  /sensors:
    get:
      tags:
        - Metadata
      summary: Get metadata for all sensors
      description: >
        Returns metadata for all sensors which are accessible with your API Key.
        Currently all sensors are returned in a single response.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
  "/sensors/{sensor-ids}":
    get:
      tags:
        - Metadata
      summary: Get metadata for specific sensors
      description: >
        Returns metadata for specific sensors which are accessible by your API key.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
        - $ref: "#/components/parameters/sensor-ids"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
  /sensor-activity:
    get:
      tags:
        - Metadata
      summary: Get last reporting time for all sensors
      description: >
        Returns last reporting time for all sensors which are accessible with your API Key.
        Currently all sensors are returned in a single response.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
  "/sensor-activity/{sensor-ids}":
    get:
      tags:
        - Metadata
      summary: Get last reporting time for specific sensors
      description: >
        Returns last reporting time for specific sensors which are accessible by your API key.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
        - $ref: "#/components/parameters/sensor-ids"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
  /sensor-catalog:
    get:
      tags:
        - Metadata
      summary: Get a catalog of all sensor types
      description: >
        Returns a catalog of all available sensor types.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
  "/current/{station-id}":
    get:
      tags:
        - Weather Data
      summary: Get current conditions data for one station
      description: >
        Returns current conditions data for a specific weather station which is accessible by your API key.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
        - $ref: "#/components/parameters/station-id"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
  "/historic/{station-id}":
    get:
      tags:
        - Weather Data
      summary: Get historic data for one station
      description: >
        Returns historic data for a specific weather station which is accessible by your API key.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
        - $ref: "#/components/parameters/station-id"
        - $ref: "#/components/parameters/start-timestamp"
        - $ref: "#/components/parameters/end-timestamp"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
  "/report/et/{station-id}":
    get:
      tags:
        - Reports
      summary: Get evapotranspiration data for one WeatherLink Live station
      description: >
        Returns evapotranspiration data for a specific WeatherLink Live weather station which is accessible by your API key.
      parameters:
        - $ref: "#/components/parameters/api-key"
        - $ref: "#/components/parameters/api-secret"
        - $ref: "#/components/parameters/station-id"
      responses:
        "200":
          description: Success
          content:
            application/json: {}
components:
  parameters:
    api-key:
      name: api-key
      in: query
      required: true
      description: "Your API Key. Passed as a query parameter."
      schema:
        type: string
    api-secret:
      name: x-api-secret
      in: header
      required: true
      description: "Your API Secret. Passed as a header."
      schema:
        type: string
    station-ids:
      name: station-ids
      in: path
      required: true
      description: "Comma delimited list of one or more station IDs passed as a path parameter. Limited to 100 station IDs maximum per API call. Both integer and UUID station ID types are supported."
      schema:
        type: string
    station-id:
      name: station-id
      in: path
      required: true
      description: "A single station ID passed as a path parameter. Both integer and UUID station ID types are supported."
      schema:
        type: string
    node-ids:
      name: node-ids
      in: path
      required: true
      description: "Comma delimited list of one or more node IDs passed as a path parameter. Limited to 100 node IDs maximum per API call."
      schema:
        type: string
    sensor-ids:
      name: sensor-ids
      in: path
      required: true
      description: "Comma delimited list of one or more sensor IDs passed as a path parameter. Limited to 100 sensor IDs maximum per API call."
      schema:
        type: string
    start-timestamp:
      name: start-timestamp
      in: query
      required: true
      description: "Unix timestamp marking the beginning of the data requested. Must be earlier than end-timestamp but not more than 24 hours earlier."
      schema:
        type: integer
    end-timestamp:
      name: end-timestamp
      in: query
      required: true
      description: "Unix timestamp marking the end of the data requested. Must be later than start-timestamp but not more than 24 hours later."
      schema:
        type: integer