Node.js wrapper for Waze.
The motivation with this module is to provide a wrapper over waze in node js.
Install Waze API:
npm i waze-api
or
yarn add waze-api
- Get traffic info
import { WazeAPI } from "waze-api";
const waze = new WazeAPI();
const res = await waze.getInfo(lat, lng, {
hideAlerts: false,
hideTraffic: false,
hideUsers: false,
});
// jams == traffic
console.log(res.jams);
console.log(res.alerts);
console.log(res.users);
- Get paths
import { WazeAPI } from "waze-api";
const waze = new WazeAPI();
const res = await waze.getPaths({
from: { y: lat1, x: lng1 },
to: { y: lat2, x: lng2 },
nPaths: 3,
useCase: "LIVEMAP_PLANNING",
interval: 15,
arriveAt: true,
});
console.log(res.alternatives);
Get waze traffic info
- lat -> latitude
- lng -> longitude
- options:
- hideTraffic -> if true don't request jams (default to false)
- hideAlerts -> if true don't request alerts (default to false)
- hideUsers -> if true don't request users (default to false)
Get Paths between two points
- options:
- from -> origin
- to -> destination
- nPaths -> number of paths
- useCase -> waze use case
- interval -> points interval
- arriveAt -> enable arrival time
MIT