AWS Lambda Function - Weather

This single AWS Lambda function detects the URL path and performs one of 2 behaviours.

Built with

ItemDetails
LanguageC# on .NET 10
HostingAWS Lambda (dotnet10 managed runtime, x86_64, 128 MB) in eu-west-2 (London), called through a Lambda Function URL
LibrariesAmazon.Lambda.Core, Amazon.Lambda.APIGatewayEvents, Amazon.Lambda.Serialization.SystemTextJson, Newtonsoft.Json
Weather dataOpen Meteo API (free, no API key)
TestsNUnit, FluentAssertions, Amazon.Lambda.TestUtilities
Build & deployAzure DevOps YAML pipeline: restore, build, test, publish, zip, then upload to AWS Lambda with aws lambda update-function-code

Links

ItemLink
AWS Lambda Function hosted athttps://v7jjoujoytcidnjfdihfleknda0pamsr.lambda-url.eu-west-2.on.aws
Git Repo athttps://dev.azure.com/jones-steve/_git/AWS%20Lambda%20Weather
Azure DevOps YAML built athttps://dev.azure.com/jones-steve/AWS%20Lambda%20Weather/_build

Endpoints

PathExampleWhat it does
/html https://v7jjoujoytcidnjfdihfleknda0pamsr.lambda-url.eu-west-2.on.aws/html THIS PAGE. Returns this HTML, describing the function.
/ (default) https://v7jjoujoytcidnjfdihfleknda0pamsr.lambda-url.eu-west-2.on.aws Any other path returns the same page as /html.
/weather https://v7jjoujoytcidnjfdihfleknda0pamsr.lambda-url.eu-west-2.on.aws/weather?latitude=53&longitude=-2 Gets the current weather for the given LAT & LNG (lat:53, lng:-2 is Stockport, UK) from the Open Meteo API and returns it as JSON.

Weather request

ItemDetails
Query parameterslatitude and longitude (both required, otherwise returns 400)
Open Meteo API calledhttps://api.open-meteo.com/v1/forecast?latitude=53&longitude=-2&current=temperature_2m,wind_speed_10m,wind_direction_10m,relative_humidity_2m,rain,is_day
Response typeapplication/json

Weather response fields

FieldExampleMeaning
Latitude53.0Latitude of the forecast point
Longitude-2.0Longitude of the forecast point
Current.Time2026-06-14T22:30:00Time of the reading (GMT)
Current.Temperature_2m12.7Air temperature 2m above ground, °C
Current.Wind_speed_10m16.2Wind speed 10m above ground, km/h
Current.Wind_direction_10m78Wind direction 10m above ground, °
Current.Relative_humidity_2m73Relative humidity 2m above ground, %
Current.Rain0.0Rain, mm
Current.Is_dayfalseWhether it is daytime

Example JSON response

{
    "Latitude": 53.0,
    "Longitude": -2.0,
    "Current": {
        "Time": "2026-06-14T22:30:00",
        "Temperature_2m": 12.7,
        "Wind_speed_10m": 16.2,
        "Wind_direction_10m": 78,
        "Relative_humidity_2m": 73,
        "Rain": 0.0,
        "Is_day": false
    }
}