<!--{"section": "ajs", "type": "example", "group": "api", "order": 7, "parent": "ajs-api.md"}-->

# Weather API

Fetch weather data (no API key needed)

```ajs:inline
function getWeather({ lat = 37.7749, lon = -122.4194 }) {
  let url =
    'https://api.open-meteo.com/v1/forecast?latitude=' +
    lat +
    '&longitude=' +
    lon +
    '&current_weather=true'
  let response = httpFetch({ url })
  let weather = response.current_weather
  return { weather }
}
```
