Skip to content

A JavaScript wrapper for the Meteostat JSON API which provides free access to weather and climate data.

License

Notifications You must be signed in to change notification settings

meteostat/meteostat-js

Repository files navigation

Meteostat

npm npm bundle size NPM semantic-release

Meteostat is an open platform which provides free access to weather and climate data.

Documentation

Meteostat provides a convenient JavaScript wrapper for its JSON API.

See the JSON API docs for more information about the API.

Installation

To install the package, run:

npm install meteostat

or

yarn add meteostat

Usage

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)
  }
})()

Reference

Data License

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.

Contributing

Issues and pull requests are welcome.

License

MIT