OpenWeatherMap · Arazzo Workflow

OpenWeatherMap Air Quality By City

Version 1.0.0

Geocode a city name, then fetch current air pollution and its hourly forecast.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub WeatherForecastClimateAir PollutionAir QualitySolarGeocodingHistoryMapsRoad RiskPublic APIsArazzoWorkflows

Provider

openweathermap

Workflows

air-quality-by-city
Resolve a city name to coordinates, then return current and forecast air quality.
Calls direct geocoding to turn a city query into coordinates, then chains the latitude and longitude into the current air pollution and hourly air pollution forecast endpoints.
3 steps inputs: appid, limit, q outputs: currentAqi, currentComponents, forecastList, lat, lon
1
geocodeCity
getDirectGeocoding
Resolve the supplied city query into geographic coordinates, keeping the first and best match.
2
currentAirPollution
getCurrentAirPollution
Fetch current air pollution at the geocoded coordinates, including the Air Quality Index and pollutant concentrations.
3
airPollutionForecast
getAirPollutionForecast
Fetch the hourly air pollution forecast for the next five days at the same coordinates.

Source API Descriptions

Arazzo Workflow Specification

openweathermap-air-quality-by-city-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: OpenWeatherMap Air Quality By City
  summary: Geocode a city name, then fetch current air pollution and its hourly forecast.
  description: >-
    Resolves a free-text city name into coordinates with the geocoding API, then
    feeds the resolved latitude and longitude into the current air pollution and
    hourly air pollution forecast endpoints to produce an air quality snapshot
    plus a five day outlook. Every step spells out its request inline, including
    the appid API key the security scheme requires, so the flow can be read and
    executed without opening the underlying OpenAPI descriptions.
  version: 1.0.0
sourceDescriptions:
- name: geocodingApi
  url: ../openapi/openweathermap-geocoding-openapi.yml
  type: openapi
- name: airPollutionApi
  url: ../openapi/openweathermap-air-pollution-openapi.yml
  type: openapi
workflows:
- workflowId: air-quality-by-city
  summary: Resolve a city name to coordinates, then return current and forecast air quality.
  description: >-
    Calls direct geocoding to turn a city query into coordinates, then chains
    the latitude and longitude into the current air pollution and hourly air
    pollution forecast endpoints.
  inputs:
    type: object
    required:
    - q
    - appid
    properties:
      q:
        type: string
        description: City name, optionally with state and ISO country codes, comma-separated.
      limit:
        type: integer
        description: Maximum number of geocoding matches to return (1 to 5).
      appid:
        type: string
        description: OpenWeather API key.
  steps:
  - stepId: geocodeCity
    description: >-
      Resolve the supplied city query into geographic coordinates, keeping the
      first and best match.
    operationId: getDirectGeocoding
    parameters:
    - name: q
      in: query
      value: $inputs.q
    - name: limit
      in: query
      value: $inputs.limit
    - name: appid
      in: query
      value: $inputs.appid
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      lat: $response.body#/0/lat
      lon: $response.body#/0/lon
      name: $response.body#/0/name
      country: $response.body#/0/country
  - stepId: currentAirPollution
    description: >-
      Fetch current air pollution at the geocoded coordinates, including the Air
      Quality Index and pollutant concentrations.
    operationId: getCurrentAirPollution
    parameters:
    - name: lat
      in: query
      value: $steps.geocodeCity.outputs.lat
    - name: lon
      in: query
      value: $steps.geocodeCity.outputs.lon
    - name: appid
      in: query
      value: $inputs.appid
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      aqi: $response.body#/list/0/main/aqi
      components: $response.body#/list/0/components
  - stepId: airPollutionForecast
    description: >-
      Fetch the hourly air pollution forecast for the next five days at the same
      coordinates.
    operationId: getAirPollutionForecast
    parameters:
    - name: lat
      in: query
      value: $steps.geocodeCity.outputs.lat
    - name: lon
      in: query
      value: $steps.geocodeCity.outputs.lon
    - name: appid
      in: query
      value: $inputs.appid
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      forecastList: $response.body#/list
  outputs:
    lat: $steps.geocodeCity.outputs.lat
    lon: $steps.geocodeCity.outputs.lon
    currentAqi: $steps.currentAirPollution.outputs.aqi
    currentComponents: $steps.currentAirPollution.outputs.components
    forecastList: $steps.airPollutionForecast.outputs.forecastList