Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/revolunet/infoclimat

Get weather data from infoclimat.fr API using NodeJS, or your browser.
https://github.com/revolunet/infoclimat

javascript nodejs weather-api

Last synced: 23 days ago
JSON representation

Get weather data from infoclimat.fr API using NodeJS, or your browser.

Awesome Lists containing this project

README

        

# infoclimat.fr API NPM version

Get weather data from [infoclimat.fr API](http://www.infoclimat.fr/api-previsions-meteo.html?id=2988507&cntry=FR) using NodeJS or your browser.

In-browser example : https://www.webpackbin.com/bins/-KflnHus6k5S01VMYcmO

## Installation

`npm i -S infoclimat`

## Usage

```js
var infoclimat = require('infoclimat')

infoclimat.getNextWeatherInFrench("48.856578,2.351828").then(data => {
// Aujourd'hui à Paris, la température sera de 8 degrés environ. Ca va pluvioter un peu. Vous ne verrez pas le ciel de la journée.
})
```

#### getWeather(location)

> Return raw API data

```js
infoclimat.getWeather("48.856578,2.351828").then(data => {
console.log(data);
})
```
result :
```js
{
request_state: 200,
request_key: 'fd543c77e33d6c8a5e218e948a19e487',
message: 'OK',
model_run: '07',
source: 'internal:GFS:1',
'2017-03-21 10:00:00':
{
temperature: { '2m': 281.9, sol: 281.4, '500hPa': -0.1, '850hPa': -0.1 },
pression: { niveau_de_la_mer: 101240 },
pluie: 0.1,
pluie_convective: 0,
humidite: { '2m': 80.5 },
vent_moyen: { '10m': 18.8 },
vent_rafales: { '10m': 26.6 },
vent_direction: { '10m': 292 },
iso_zero: 1128,
risque_neige: 'non',
cape: 0,
nebulosite: { haute: 94, moyenne: 98, basse: 4, totale: 100 }
},
}
```

see explanations for this values on [infoclimat.fr API](http://www.infoclimat.fr/api-previsions-meteo.html?id=2988507&cntry=FR)

#### getNextWeather(location)

> Compute average values for today values

```js
infoclimat.getNextWeather("48.856578,2.351828").then(data => {
console.log(data);
})
```

result

```js
{
temperature: 8.1,
pluie: 0.1,
nuages: 93.75,
vent: 14.075
}
```

#### getNextWeatherInFrench(location)

> Create readable French 🇫🇷 text descripting today weather

```js
infoclimat.getNextWeatherInFrench("48.856578,2.351828").then(data => {
console.log(data);
})
```

result

> Aujourd'hui à Paris, la température sera de 8 degrés environ. Ca va pluvioter un peu. Vous ne verrez pas le ciel de la journée.

## License

MIT