eco-counter-client
Fetch data about bicycle counters from the Eco Counter API.
Installing
npm install eco-counter-client
Usage
An organisation seems to be just a set of counters. You need to pass in an organisation ID. See eco-counter-organisations
for a list.
const counters data = // Berlin
counters(org)
returns a Promise
that resolves with an array of bike counters. A single result looks like this:
id: '100024661' name: 'Jannowitzbrücke' url: 'http://www.stadtentwicklung.berlin.de/verkehr/lenkung/vlb/de/erhebungen.shtml' coordinates: latitude: 525140658632566 longitude: 1341775102070807 country: 'de' organisation: id: 4728 name: 'VERKEHRSLENKUNG BERLIN' count: 492398 periodStart: 2016-01-01T00:00:00000Z // JS Date object periodEnd: 2020-03-21T23:00:00000Z // JS Date object instruments: 101024661 102024661 photos: 'https://www.eco-visio.net/Photos/100024661/14677966316060.jpg' logo: 'https://www.eco-visio.net/Logos/4728/1485517072671.jpg'
data(org, id, instruments, start, end)
returns a Promise
that resolves with an array days. They look like this:
day: '2016-01-01' count: 950 // … day: '2016-26-01' count: 5819 // … day: '2016-24-02' count: 6202 // … day: '2016-30-03' count: 5556 // …
Contributing
If you have a question or have difficulties using eco-counter-client
, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.