Nearby Weather Stations

The nearby endpoint enables users to find weather stations by geo location. When calling this endpoint make sure to provide valid geographic coordinates (decimal degrees) using the lat (latitude) and lon (longitude) parameters. The limit parameter allows us to specify the maximum number of weather stations returned by this endpoint.

By default, the endpoint only returns weather stations which are closer than 100 kilometers to the specified geo location. If you want to limit your query to a certain radius in kilometers, just set the radius parameter to any integer value.

Endpoint

The endpoint is available through this URL:

GET https://api.meteostat.net/v2/stations/nearby

Parameters

When calling this endpoint please refer to the following parameters.

ParameterDescriptionData TypeRequiredDefault
latThe latitude of the locationFloatYesundefined
lonThe longitude of the locationFloatYesundefined
limitThe maximum number of resultsIntegerNo8
radiusThe radius of the query in kilometersIntegerNo100

Response

The response body includes the following properties.

ParameterDescriptionData Type
idThe Meteostat ID of the weather stationString
nameObject containing the name of the weather stations in different languagesObject
activeA boolean value which is true if the weather station reported data within the previous 90 daysBoolean
distanceThe distance to the geo location defined in the requestFloat

Example: Five weather stations nearby Singapore

The following example requires the cURL command-line interface. Alternatively, you can use an API client like Postman.

curl --header "x-api-key: {key}" "https://api.meteostat.net/v2/stations/nearby?lat=1.28&lon=103.83&limit=3"

Please replace {key} with your personal API key.

Data Response

The response should look like that:

{
    "meta": {
        "exec_time": 0.022,
        "generated": "2020-06-12 12:24:59"
    },
    "data": [
        {
            "id": "48694",
            "name": {
                "en": "Singapore / Paya Lebar"
            },
            "active": true,
            "distance": 15.3
        },
        {
            "id": "48692",
            "name": {
                "en": "Singapore / Seletar"
            },
            "active": true,
            "distance": 18.4
        },
        {
            "id": "48698",
            "name": {
                "en": "Singapore / Changi Airport"
            },
            "active": true,
            "distance": 20.8
        }
    ]
}