- List forecast/observation sites
- Get nearest forecast/observation site from longitude and latitiude
- Get the following 5 day forecast types for any site
- Daily (Two timesteps, midday and midnight UTC)
- 3 hourly (Eight timesteps, every 3 hours starting at midnight UTC)
- Get hourly observations for the last 48 hours
- Get regional forecasts for the next 30 days (Grouped in four timesteps)
npm install datapoint-js
Download the contents
/src (for node) and include them in your project.
var datapoint = require('datapoint-js') datapoint.set_key("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") site = datapoint.get_nearest_forecast_site(-0.124626, 51.500728) forecast = datapoint.get_forecast_for_site(site.id, "3hourly") current_timestep = forecast.days.timesteps console.log("Temperature is " + current_timestep.temperature.value + "°" + current_timestep.temperature.units + " in " + site.name)
Temperature is 15°C in London
Please feel free to submit issues and pull requests.
To work on the project simply clone the project and run
This project uses gulp as its task runner and can be used to browserify the code and generate the documentation.
Documentation can be automatically generated using JSDoc by running