Weather & Currency
Retrieve live weather conditions and currency exchange rates. Both are fetched from external data sources on each call.
WEATHER
WEATHER "city" SET ?var returns an object describing current conditions for that city.
| Field | Description |
|---|---|
location | City name resolved by the data source |
temp_c | Temperature in Celsius |
temp_f | Temperature in Fahrenheit |
description | Condition summary, e.g. "Partly cloudy" |
humidity | Relative humidity, percent |
wind_kph | Wind speed, kilometers per hour |
wind_mph | Wind speed, miles per hour |
Current weather for a city
WEATHER "Cape Town" SET ?w
AFTER EMIT ?w("location") & ": " & ?w("temp_c") & "°C, " & ?w("description")
Multi-city weather, fetched in parallel
WEATHER "Cape Town" SET ?cpt
AND WEATHER "London" SET ?lon
AND WEATHER "New York" SET ?nyc
AFTER EMIT "CT: " & ?cpt("temp_c") & "°C | LDN: " & ?lon("temp_c") & "°C | NYC: " & ?nyc("temp_c") & "°C"
CURRENCY
CURRENCY RATE FROM "..." TO "..." SET ?var returns the exchange rate as a plain number. CURRENCY CONVERT n FROM "..." TO "..." SET ?var returns the converted amount as a plain number. Both accept decimal values.
Get an exchange rate
CURRENCY RATE FROM "USD" TO "ZAR" SET ?rate
AFTER EMIT "1 USD = " & ?rate & " ZAR"
Convert an amount
CURRENCY CONVERT 11.45 FROM "USD" TO "ZAR" SET ?amount
AFTER EMIT ?amount
Multi-currency comparison, fetched in parallel
CURRENCY RATE FROM "USD" TO "ZAR" SET ?zar
AND CURRENCY RATE FROM "USD" TO "EUR" SET ?eur
AND CURRENCY RATE FROM "USD" TO "GBP" SET ?gbp
AFTER EMIT "ZAR: " & ?zar & " | EUR: " & ?eur & " | GBP: " & ?gbp