{"id":15592213,"url":"https://github.com/derhuerst/eco-counter-client","last_synced_at":"2025-04-15T05:29:23.936Z","repository":{"id":45741728,"uuid":"100312493","full_name":"derhuerst/eco-counter-client","owner":"derhuerst","description":"Fetch data about bicycle counters from the Eco Counter API.","archived":false,"fork":false,"pushed_at":"2023-07-07T12:36:03.000Z","size":19,"stargazers_count":14,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T23:48:54.409Z","etag":null,"topics":["api","bicycle","bike","counter"],"latest_commit_sha":null,"homepage":"https://github.com/derhuerst/eco-counter-client","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derhuerst.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-08-14T21:54:57.000Z","updated_at":"2024-06-05T13:52:00.000Z","dependencies_parsed_at":"2022-09-01T21:02:29.132Z","dependency_job_id":"d500cd3c-7fdf-4c08-b0c7-d5cc5fbfff7d","html_url":"https://github.com/derhuerst/eco-counter-client","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.25,"last_synced_commit":"e9630baa8e51abd021aa6d92fa0c34911c2c2682"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Feco-counter-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Feco-counter-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Feco-counter-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Feco-counter-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derhuerst","download_url":"https://codeload.github.com/derhuerst/eco-counter-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249013692,"owners_count":21198436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bicycle","bike","counter"],"created_at":"2024-10-02T23:58:50.668Z","updated_at":"2025-04-15T05:29:23.904Z","avatar_url":"https://github.com/derhuerst.png","language":"JavaScript","funding_links":["https://patreon.com/derhuerst"],"categories":[],"sub_categories":[],"readme":"# eco-counter-client\n\n**Fetch data about [bicycle counters](https://en.wikipedia.org/wiki/Traffic_count#Bicycle_and_pedestrian_traffic_counting_devices) from the [Eco Counter](http://www.eco-compteur.com/en/) API.**\n\n[![npm version](https://img.shields.io/npm/v/eco-counter-client.svg)](https://www.npmjs.com/package/eco-counter-client)\n[![build status](https://img.shields.io/travis/derhuerst/eco-counter-client.svg)](https://travis-ci.org/derhuerst/eco-counter-client)\n![ISC-licensed](https://img.shields.io/github/license/derhuerst/eco-counter-client.svg)\n[![chat on gitter](https://badges.gitter.im/derhuerst.svg)](https://gitter.im/derhuerst)\n[![support me on Patreon](https://img.shields.io/badge/support%20me-on%20patreon-fa7664.svg)](https://patreon.com/derhuerst)\n\n\n## Installing\n\n```shell\nnpm install eco-counter-client\n```\n\n\n## Usage\n\nAn organisation seems to be just a set of counters. You need to pass in an organisation ID. See [`eco-counter-organisations`](https://github.com/derhuerst/eco-counter-organisations) for a list.\n\n```js\nconst {counters, data} = require('eco-counter-client')\n\ncounters(4728) // Berlin\n.then((counters) =\u003e {\n\tconst c = counters[0]\n\tconsole.log(c)\n\treturn data(c.organisation.id, c.id, c.instruments, c.periodStart, c.periodEnd)\n})\n.then(console.log)\n.catch(console.error)\n```\n\n`counters(org)` returns a `Promise` that resolves with an array of bike counters. A single result looks like this:\n\n```js\n{\n\tid: '100024661',\n\tname: 'Jannowitzbrücke',\n\turl: 'http://www.stadtentwicklung.berlin.de/verkehr/lenkung/vlb/de/erhebungen.shtml',\n\tcoordinates: {\n\t\tlatitude: 52.5140658632566,\n\t\tlongitude: 13.41775102070807,\n\t\tcountry: 'de'\n\t},\n\torganisation: {\n\t\tid: 4728,\n\t\tname: 'VERKEHRSLENKUNG BERLIN'\n\t},\n\tcount: 492398,\n\tperiodStart: 2016-01-01T00:00:00.000Z, // JS Date object\n\tperiodEnd: 2020-03-21T23:00:00.000Z, // JS Date object\n\tinstruments: [101024661, 102024661],\n\tphotos: ['https://www.eco-visio.net/Photos/100024661/14677966316060.jpg'],\n\tlogo: 'https://www.eco-visio.net/Logos/4728/1485517072671.jpg'\n}\n```\n\n`data(org, id, instruments, start, end)` returns a `Promise` that resolves with an array days. They look like this:\n\n```js\n[\n\t{day: '2016-01-01', count: 950},\n\t// …\n\t{day: '2016-26-01', count: 5819},\n\t// …\n\t{day: '2016-24-02', count: 6202},\n\t// …\n\t{day: '2016-30-03', count: 5556},\n\t// …\n]\n```\n\n\n## Contributing\n\nIf 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](https://github.com/derhuerst/eco-counter-client/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderhuerst%2Feco-counter-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderhuerst%2Feco-counter-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderhuerst%2Feco-counter-client/lists"}