JavaScript API wrapper for locating electric vehicle charging stations on NREL. National Renewable Energy Laboratory (NREL) API v1: https://developer.nrel.gov Get your API Key at https://developer.nrel.gov/signup/
https://developer.nrel.gov/docs/rate-limits/
Download evstation-js from GitHub or install using npm
npm install evstation-js
Import module
let getEVStation = require('evstation-js');
Instantiate EVStation
You'll need to pass in two arguments into EVStation. The first parameter is expecting an API key to make successful requests and the second parameter is used to format the request, json
or xml
.
let evstation = new getEVStation('DEMO_KEY', 'json');
evstation.getAll({zip: 98004}, 10, function(err, res) {
console.log(res.response);
});
evstation.get(123, function(err, res) {
console.log(res.response);
});
evstation.nearest({location: 'Bellevue, WA'}, 10, 0, function(err, res) {
console.log(res.response);
});
evstation.nearbyRoute({route: 'LINESTRING(-74.0 40.7, -87.63 41.87, -104.98 39.76)'}, 10, 0, function(err, res) {
console.log(res.response);
});
evstation.lastUpdated(function(err, res) {
console.log(res.response);
});