Skip to content

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

Notifications You must be signed in to change notification settings

revolunet/infoclimat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

infoclimat.fr API NPM version

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

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

Installation

npm i -S infoclimat

Usage

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

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

result :

{
  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

getNextWeather(location)

Compute average values for today values

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

result

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

getNextWeatherInFrench(location)

Create readable French 🇫🇷 text descripting today weather

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

About

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

https://www.webpackbin.com/bins/-KflnHus6k5S01VMYcmO

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published