OpenWeatherMapExt [FREE]

Hi everyone,
I want to share this extension to access the free OpenWeatherMap APIs: Geocoding, Current Weather, 5-day/3-hour Forecast, and Air Pollution.
To use the extension You need a free APIKey from openweathermap.org. Sign up, then generate your key from your account page. The free plan already gives access to all the functions implemented in this extension, with a limit of 60 calls per minute and 1,000,000 calls per month. Full plan details: Detailed price.


Looks up the coordinates of a city by name.

Parameters

  • apiKey (text) — your OpenWeatherMap API key
  • cityName (text) — the city to search for
  • stateCode (text) — US state code, or leave empty ("")
  • countryCode (text) — 2-letter country code (e.g. "IT"), or leave empty ("")
  • limit (number) — max number of results to return

GeocodingResult
Fired when the search succeeds. Returns 5 parallel lists — same index across all 5 lists = same place:

  • name (list of text) — place name
  • lat (list of numbers) — latitude
  • lon (list of numbers) — longitude
  • country (list of text) — country code
  • state (list of text) — state, if applicable (mostly for US)
  • json (text) — the full raw response from the server, in case you need something not listed above


Gets the current weather for a location.

Parameters

  • apiKey (text) — your OpenWeatherMap API key
  • units (text) — standard (Kelvin), metric (Celsius), or imperial (Fahrenheit)
  • language (text) — language code for the description (e.g. en, it)
  • lat (number) — latitude
  • lon (number) — longitude
    You can find a list of language supported here: Current weather data

CurrentResult
Fired when the request succeeds:

  • temp (number) — current temperature
  • humidity (number) — humidity percentage
  • weatherMain (text) — short weather group (e.g. "Rain", "Clear", "Clouds")
  • description (text) — longer weather description (e.g. "light rain")
  • icon (text) — icon code you can use to build the icon URL (see "Weather icons" below)
  • json (text) — the full raw response, includes fields not listed above such as feels_like, pressure, wind, clouds, sunrise/sunset


Gets the 3-hour step forecast for the next 5 days.

Parameters

  • apiKey (text) — your OpenWeatherMap API key
  • units (text) — standard, metric, or imperial
  • language (text) — language code for the description
  • lat (number) — latitude
  • lon (number) — longitude
  • cnt (number) — how many 3-hour time steps to return (max 40 = 5 days); use 0 to get all of them

ForecastResult
Fired when the request succeeds. Returns 7 parallel lists — same index across all 7 lists = same time step:

  • dtTxt (list of text) — date and time of that step (e.g. "2026-07-18 09:00:00")
  • temp (list of numbers) — temperature at that step
  • humidity (list of numbers) — humidity percentage at that step
  • weatherMain (list of text) — short weather group for that step
  • description (list of text) — longer weather description for that step
  • icon (list of text) — icon code for that step
  • json (list of text) — the full raw entry for that step, includes fields not listed above such as wind, pop (chance of rain), rain amount, gust


Gets current air pollution data for a location.

Parameters

  • apiKey (text) — your OpenWeatherMap API key
  • lat (number) — latitude
  • lon (number) — longitude

AirPollutionResult
Fired when the request succeeds:

  • aqi (number) — Air Quality Index on OpenWeatherMap's own 1–5 scale: 1=Good, 2=Fair, 3=Moderate, 4=Poor, 5=Very Poor
  • co (number) — carbon monoxide concentration (μg/m³)
  • no (number) — nitrogen monoxide concentration
  • no2 (number) — nitrogen dioxide concentration
  • o3 (number) — ozone concentration
  • so2 (number) — sulphur dioxide concentration
  • pm2_5 (number) — fine particulate matter concentration
  • pm10 (number) — coarse particulate matter concentration
  • nh3 (number) — ammonia concentration
  • json (text) — the full raw response

ErrorResult
A single event shared by all four functions above — fired whenever a call fails (network problem, invalid API key, invalid parameters, server error, etc).

  • method (text) — which function triggered the error: "GeocodingSearch", "CurrentWeather", "Forecast", or "AirPollution"
  • message (text) — the error description

The icon code you get from CurrentWeather and Forecast (e.g. "10d", "04n") can be turned into an image URL like this:

https://openweathermap.org/img/wn/{icon}@2x.png

Example: https://openweathermap.org/img/wn/10d@2x.png

Full list of icon codes and conditions: Weather Conditions

Extension:
OpenWeatherMapExt.aix (32.0 KB)
Sample Project:
[OpenWeatherMapSample.aia|attachment]
OpenWeatherMapSample.aia (73.5 KB)



In this sample project, instead of making an HTTP request every time to download the icon image, I preferred to load them all into the project from the start.

I hope You find useful

Best regards

Marco Perrone

3 Likes

Great job Marco :+1:
A couple of years ago I've posted a samlpe code to build a weather forecast app (I was bored by the ADS of "free" apps on the matter). Everything was working fine, but the only concern was about the access to the world's database of lat & lon given the city name. After a few consecutive attempts the "free" service was stopping for the rest of the day. Your extension seems to have bypassed this issue. I will test it during the hottest days of August (here in North Italy :hot_face: ).
Buone vacanze, ciao Ugo.

Grazie Ugo @uskiara, e buone vacanze anche a te
Marco

1 Like