Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to OpenWeather

Scalekit connector
Open markdown

The OpenWeather connector lets your AI agent act in each user's OpenWeather account. Each user connects their own OpenWeather API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 16 tools.

Tools
16
What they doRead · write · destructive
16 · 0 · 016 read0 write0 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the OpenWeather connection

    In AgentKit > Connections, create an OpenWeather connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'openweather'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize OpenWeather:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'openweather_current_weather_by_city_get',
    toolInput: { q: 'YOUR_Q' },
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their OpenWeather credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • openweather_air_pollution_forecast_getGet the hourly air quality forecast for the next 4 days at a latitude and longitude.Read-only

    Get Air Pollution Forecast

    Get the hourly air quality forecast for the next 4 days at a latitude and longitude. Returns the coordinates and a list of entries, each with a Unix timestamp, an air quality index from 1 (Good) to 5 (Very Poor) and concentrations in μg/m3 of CO, NO, NO2, O3, SO2, PM2.5, PM10 and NH3. Use this for future air quality. Use openweather_air_pollution_get for current readings and openweather_air_pollution_history_get for past readings.

    Inputs

    latnumberrequired
    Latitude of the place in decimal degrees, from -90 to 90. Get it from openweather_location_search or openweather_location_by_zip_get if you only have a place name or postal code. Example: 51.5073
    lonnumberrequired
    Longitude of the place in decimal degrees, from -180 to 180. Get it from openweather_location_search or openweather_location_by_zip_get if you only have a place name or postal code. Example: -0.1276
  • openweather_air_pollution_getGet the current air quality at a latitude and longitude.Read-only

    Get Current Air Pollution

    Get the current air quality at a latitude and longitude. Returns the coordinates and a list of entries, each with a Unix timestamp, an air quality index from 1 (Good) to 5 (Very Poor) and concentrations in μg/m3 of CO, NO, NO2, O3, SO2, PM2.5, PM10 and NH3. Use this for air quality right now. Use openweather_air_pollution_forecast_get for the coming days and openweather_air_pollution_history_get for past readings.

    Inputs

    latnumberrequired
    Latitude of the place in decimal degrees, from -90 to 90. Get it from openweather_location_search or openweather_location_by_zip_get if you only have a place name or postal code. Example: 51.5073
    lonnumberrequired
    Longitude of the place in decimal degrees, from -180 to 180. Get it from openweather_location_search or openweather_location_by_zip_get if you only have a place name or postal code. Example: -0.1276
  • openweather_air_pollution_history_getGet hourly air quality readings for a time range at a latitude and longitude, from 27 November 2020 onward.Read-only

    Get Air Pollution History

    Get hourly air quality readings for a time range at a latitude and longitude, from 27 November 2020 onward. Returns the coordinates and a list of entries, each with a Unix timestamp, an air quality index from 1 (Good) to 5 (Very Poor) and concentrations in μg/m3 of CO, NO, NO2, O3, SO2, PM2.5, PM10 and NH3. Use this for past air quality. Use openweather_air_pollution_get for current readings and openweather_air_pollution_forecast_get for the coming days.

    Inputs

    endintegerrequired
    End of the time range as a Unix timestamp in seconds (UTC); must be after start. Example: 1704153600 (2024-01-02 00:00 UTC)
    latnumberrequired
    Latitude of the place in decimal degrees, from -90 to 90. Get it from openweather_location_search or openweather_location_by_zip_get if you only have a place name or postal code. Example: 51.5073
    lonnumberrequired
    Longitude of the place in decimal degrees, from -180 to 180. Get it from openweather_location_search or openweather_location_by_zip_get if you only have a place name or postal code. Example: -0.1276
    startintegerrequired
    Start of the time range as a Unix timestamp in seconds (UTC). Data is available from 27 November 2020 (1606435200). Example: 1704067200 (2024-01-01 00:00 UTC)
  • openweather_current_weather_by_city_getGet the current weather for a city by name.Read-only

    Get Current Weather by City

    Get the current weather for a city by name. Returns the weather condition and description, temperature, feels-like temperature, min and max (the spread across stations in a large city right now, not the day's low and high; in most places they equal the current temperature), pressure, humidity, visibility, wind, cloud cover, rain and snow volume for the last hour, sunrise and sunset, the city name and its time zone offset. Use this when you only have a city name. Use openweather_current_weather_get for coordinates. OpenWeather has deprecated name lookups, so for an ambiguous name resolve it with openweather_location_search first.

    Inputs

    qstringrequired
    City name, optionally followed by a state code (US only) and an ISO 3166 country code, separated by commas. Add the country code to avoid matching a same-named city elsewhere. Example: London,GB or Austin,TX,US
    langstring
    Language code for the weather description and city name in the response, such as en, fr, de, es, zh_cn or pt_br. Defaults to English. The full list is at https://openweathermap.org/current#multi. Example: fr
    unitsstring
    Units of measurement for the response: standard (Kelvin, meters/second), metric (Celsius, meters/second) or imperial (Fahrenheit, miles/hour). Defaults to standard. Example: metricone of standardmetricimperialdefault standard
  • openweather_current_weather_by_zip_getGet the current weather for a zip or postal code.Read-only

    Get Current Weather by Zip Code

    Get the current weather for a zip or postal code. Returns the weather condition and description, temperature, feels-like temperature, min and max (the spread across stations in a large city right now, not the day's low and high; in most places they equal the current temperature), pressure, humidity, visibility, wind, cloud cover, rain and snow volume for the last hour, sunrise and sunset, the city name and its time zone offset. Use this when you only have a postal code. Use openweather_current_weather_get for coordinates and openweather_current_weather_by_city_get for a city name. OpenWeather has deprecated name and postal-code lookups, so turn the place into coordinates first with openweather_location_search or openweather_location_by_zip_get.

    Inputs

    zipstringrequired
    Zip or postal code followed by a comma and the ISO 3166 two-letter country code. Without a country code OpenWeather assumes the US. Example: 94040,US or E14,GB
    langstring
    Language code for the weather description and city name in the response, such as en, fr, de, es, zh_cn or pt_br. Defaults to English. The full list is at https://openweathermap.org/current#multi. Example: fr
    unitsstring
    Units of measurement for the response: standard (Kelvin, meters/second), metric (Celsius, meters/second) or imperial (Fahrenheit, miles/hour). Defaults to standard. Example: metricone of standardmetricimperialdefault standard
  • openweather_current_weather_getGet the current weather at a latitude and longitude.Read-only

    Get Current Weather

    Get the current weather at a latitude and longitude. Returns the weather condition and description, temperature, feels-like temperature, min and max (the spread across stations in a large city right now, not the day's low and high; in most places they equal the current temperature), pressure, humidity, visibility, wind, cloud cover, rain and snow volume for the last hour, sunrise and sunset, the city name and its time zone offset. Use this when you have coordinates; it is the most accurate lookup. Use openweather_current_weather_by_city_get for a city name and openweather_current_weather_by_zip_get for a postal code.

    Inputs

    latnumberrequired
    Latitude of the place in decimal degrees, from -90 to 90. Get it from openweather_location_search or openweather_location_by_zip_get if you only have a place name or postal code. Example: 51.5073
    lonnumberrequired
    Longitude of the place in decimal degrees, from -180 to 180. Get it from openweather_location_search or openweather_location_by_zip_get if you only have a place name or postal code. Example: -0.1276
    langstring
    Language code for the weather description and city name in the response, such as en, fr, de, es, zh_cn or pt_br. Defaults to English. The full list is at https://openweathermap.org/current#multi. Example: fr
    unitsstring
    Units of measurement for the response: standard (Kelvin, meters/second), metric (Celsius, meters/second) or imperial (Fahrenheit, miles/hour). Defaults to standard. Example: metricone of standardmetricimperialdefault standard
  • openweather_forecast_by_city_getGet the 5-day weather forecast in 3-hour steps for a city by name.Read-only

    Get 5-Day Forecast by City

    Get the 5-day weather forecast in 3-hour steps for a city by name. Returns a list of up to 40 forecast steps, each with its time, temperature, feels-like temperature, pressure, humidity, weather description, cloud cover, wind, visibility, probability of precipitation and rain or snow volume, plus the city name, coordinates, time zone offset, sunrise and sunset. Use this when you only have a city name. Use openweather_forecast_get for coordinates and openweather_forecast_by_zip_get for a postal code. OpenWeather has deprecated name and postal-code lookups, so turn the place into coordinates first with openweather_location_search or openweather_location_by_zip_get.

    Inputs

    qstringrequired
    City name, optionally followed by a state code (US only) and an ISO 3166 country code, separated by commas. Add the country code to avoid matching a same-named city elsewhere. Example: London,GB or Austin,TX,US
    cntinteger
    Number of 3-hour forecast steps to return, counted from the next step. The full forecast has up to 40 steps (5 days). Leave empty for all of them. Example: 8 (the next 24 hours)
    langstring
    Language code for the weather description and city name in the response, such as en, fr, de, es, zh_cn or pt_br. Defaults to English. The full list is at https://openweathermap.org/current#multi. Example: fr
    unitsstring
    Units of measurement for the response: standard (Kelvin, meters/second), metric (Celsius, meters/second) or imperial (Fahrenheit, miles/hour). Defaults to standard. Example: metricone of standardmetricimperialdefault standard
  • openweather_forecast_by_zip_getGet the 5-day weather forecast in 3-hour steps for a zip or postal code.Read-only

    Get 5-Day Forecast by Zip Code

    Get the 5-day weather forecast in 3-hour steps for a zip or postal code. Returns a list of up to 40 forecast steps, each with its time, temperature, feels-like temperature, pressure, humidity, weather description, cloud cover, wind, visibility, probability of precipitation and rain or snow volume, plus the city name, coordinates, time zone offset, sunrise and sunset. Use this when you only have a postal code. Use openweather_forecast_get for coordinates and openweather_forecast_by_city_get for a city name. OpenWeather has deprecated name and postal-code lookups, so turn the place into coordinates first with openweather_location_search or openweather_location_by_zip_get.

    Inputs

    zipstringrequired
    Zip or postal code followed by a comma and the ISO 3166 two-letter country code. Without a country code OpenWeather assumes the US. Example: 94040,US or E14,GB
    cntinteger
    Number of 3-hour forecast steps to return, counted from the next step. The full forecast has up to 40 steps (5 days). Leave empty for all of them. Example: 8 (the next 24 hours)
    langstring
    Language code for the weather description and city name in the response, such as en, fr, de, es, zh_cn or pt_br. Defaults to English. The full list is at https://openweathermap.org/current#multi. Example: fr
    unitsstring
    Units of measurement for the response: standard (Kelvin, meters/second), metric (Celsius, meters/second) or imperial (Fahrenheit, miles/hour). Defaults to standard. Example: metricone of standardmetricimperialdefault standard