Meteostat is an open platform which provides free access to weather and climate data.
Meteostat provides a convenient JavaScript wrapper for its JSON API.
See the JSON API docs for more information about the API.
To install the package, run:
npm install meteostat
or
yarn add meteostat
All you need to get started is an API key, which can be generated here. Once you have your API key, you can create a client:
import { Meteostat } from 'meteostat'
const meteostat = new Meteostat('YOUR_API_KEY_HERE')
;(async () => {
try {
const { data } = await meteostat.stations.nearby({ lat: '51.5085', lon: '-0.1257' })
console.log(data)
} catch (error) {
console.log(error)
}
})()
Meteorological data is provided under the terms of the Creative Commons Attribution-NonCommercial 4.0 International Public License. Please be aware that Meteostat uses data which is shared under WMO resolution 40.
All meteorological data sources used by the Meteostat project are listed here.
Issues and pull requests are welcome.