Skip to main content

Nearby Stations

This endpoint enables users to find nearby 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, just set the radius parameter to any integer value.

Endpoint

The endpoint is available through this URL:

GET https://meteostat.p.rapidapi.com/stations/nearby

Parameters

When calling this endpoint, please refer to the following parameters.

ParameterDescriptionTypesRequiredDefault
latThe latitude of the locationFloatYesundefined
lonThe longitude of the locationFloatYesundefined
limitThe maximum number of resultsIntegerNo10
radiusThe radius of the query in metersIntegerNo100000

Response

The response body includes the following properties.

ParameterDescriptionType
idThe Meteostat ID of the weather stationString
nameName of the weather station in different languagesObject
distanceThe distance to the provided geo location in metersFloat

Example

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

curl --request GET \
--url 'https://meteostat.p.rapidapi.com/stations/nearby?lat=51.5085&lon=-0.1257&limit=5' \
--header 'x-rapidapi-host: meteostat.p.rapidapi.com' \
--header 'x-rapidapi-key: {key}'

Please replace {key} with your personal API key.

Data Response

The response should look like that:

{
"meta": {
"exec_time": 0.172,
"generated": "2021-06-23 18:36:46"
},
"data": [
{
"id": "03779",
"name": {
"en": "London Weather Centre"
},
"distance": 1104.3
},
{
"id": "EGLC0",
"name": {
"en": "London / Abbey Wood"
},
"distance": 16804.1
},
{
"id": "03672",
"name": {
"en": "Northolt"
},
"distance": 20652.3
},
{
"id": "03772",
"name": {
"en": "London Heathrow Airport"
},
"distance": 22624.4
},
{
"id": "03781",
"name": {
"en": "Kenley"
},
"distance": 23370
}
]
}