{"id":16033076,"url":"https://github.com/javierarce/aire-madrid","last_synced_at":"2025-03-17T21:31:02.983Z","repository":{"id":57174957,"uuid":"340608417","full_name":"javierarce/aire-madrid","owner":"javierarce","description":"Node package to get information about Madrid's air quality","archived":false,"fork":false,"pushed_at":"2021-09-25T09:44:33.000Z","size":163,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T04:46:26.860Z","etag":null,"topics":["air","air-quality","madrid","pollution"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javierarce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-20T08:59:10.000Z","updated_at":"2025-02-20T20:40:28.000Z","dependencies_parsed_at":"2022-08-29T00:10:56.881Z","dependency_job_id":null,"html_url":"https://github.com/javierarce/aire-madrid","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierarce%2Faire-madrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierarce%2Faire-madrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierarce%2Faire-madrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierarce%2Faire-madrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javierarce","download_url":"https://codeload.github.com/javierarce/aire-madrid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243885927,"owners_count":20363644,"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":["air","air-quality","madrid","pollution"],"created_at":"2024-10-08T21:41:41.317Z","updated_at":"2025-03-17T21:31:02.756Z","avatar_url":"https://github.com/javierarce.png","language":"JavaScript","funding_links":[],"categories":["Calidad del Aire y Medio Ambiente"],"sub_categories":[],"readme":"# aire-madrid\n\nNode package to get information about Madrid's air quality.\n\n[![Build Status](https://travis-ci.com/javierarce/aire-madrid.svg?branch=main)](https://travis-ci.com/javierarce/aire-madrid)\n\n## Installation\n\n`yarn add aire-madrid`\n\nor\n\n`npm install aire-madrid`\n\n### Usage examples\n\n#### Get readings from 'Monóxido de Nitrógeno' (6) \u0026 'Partículas \u003c 2.5 µm' (9) at stations 8 (Escuelas Aguirre) and 11 (Avda. Ramón y Cajal).\n\n```js\nconst air = require('aire-madrid')\n\nair.getReadings({ stations: [8, 11], pollutants: [7, 9]}).then((data) =\u003e {\n  console.log(data)\n})\n```\n\u003cdetails\u003e\n  \u003csummary\u003eSee output\u003c/summary\u003e\n  \n```js\n[{\n    id: '8',\n    name: 'Escuelas Aguirre',\n    address: 'Entre C/ Alcalá y C/ O\\x92 Donell ',\n    lng: '-3.6823158',\n    lat: '40.4215533',\n    pollutants: [{\n      id: '7',\n      name: 'Monóxido de Nitrógeno',\n      values: [ 22, 11, 4, 2, 2, 2, 3, 5, 10, 10, 7, \n                4, 3, 3, 3,  2, 2, 3, 3, 4, 4, 9 ]\n    }, {\n      id: '9',\n      name: 'Partículas \u003c 2.5 µm',\n      scoring: [\n        { value: 5, name: 'muy bien', range: [ 0, 10 ] },\n        { value: 4, name: 'bien', range: [ 11, 20 ] },\n        { value: 3, name: 'regular', range: [ 21, 25 ] },\n        { value: 2, name: 'mal', range: [ 26, 50 ] },\n        { value: 1, name: 'muy mal', range: [ 51, 800 ] }\n      ],\n      values: [ 14, 14, 11, 5, 6, 9, 7, 5, 10, 12, 15, 11, \n                11, 11, 8, 12, 13, 19, 17, 17, 25, 30 ],\n      quality: { scoring: { name: 'mal', value: 2 }, lastValue: 30, time: 22 }\n    }],\n    qualityIndex: 2\n  }, {\n  …\n```\n\u003c/details\u003e\n\n- The first value in the `values` array corresponds to the 1 AM of the current day.\n- Pollutant IDs can be found [here](https://github.com/javierarce/aire-madrid/wiki/Pollutants).\n- For [these pollutants](https://github.com/javierarce/aire-madrid/wiki/How-are-quality-indexes-calculated) a scoring is offered.\n\n#### Get the list of stations\n\n```js\nair.getStations().then((data) =\u003e {\n  console.log(data)\n})\n```\n\u003cdetails\u003e\n  \u003csummary\u003eSee output\u003c/summary\u003e\n```js\n[\n  {\n    id: '4',\n    name: 'Pza. de España',\n    address: 'Plaza de España',\n    lng: '-3.7122567',\n    lat: '40.4238823'\n  },\n  {\n    id: '8',\n    name: 'Escuelas Aguirre',\n    address: 'Entre C/ Alcalá y C/ O\\x92 Donell ',\n    lng: '-3.6823158',\n    lat: '40.4215533'\n  },\n  …\n```\n\u003c/details\u003e\n\n#### Get the list of pollutants\n\n```js\nair.getPollutants().then((data) =\u003e {\n  console.log(data)\n})\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eSee output\u003c/summary\u003e\n```js\n[\n  {\n    id: '1',\n    name: 'Dióxido de Azufre',\n    scoring: [\n      { value: 5, name: 'muy bien', range: [ 0, 100 ] },\n      { value: 4, name: 'bien', range: [ 101, 200 ] },\n      { value: 3, name: 'regular', range: [ 201, 350 ] },\n      { value: 2, name: 'mal', range: [ 351, 500 ] },\n      { value: 1, name: 'muy mal', range: [ 501, 1250 ] }\n    ]\n  },\n  { id: '6', name: 'Monóxido de Carbono' },\n  { id: '7', name: 'Monóxido de Nitrógeno' },\n  …\n]\n```\n\u003c/details\u003e\n\n### More information\n\n- [Pollutants ids](https://github.com/javierarce/aire-madrid/wiki/Pollutants)\n- [How are quality indexes calculated](https://github.com/javierarce/aire-madrid/wiki/How-are-quality-indexes-calculated)\n- [Data sources](https://github.com/javierarce/aire-madrid/wiki/Data-sources)\n\n### TODO\n\n- [ ] Show information about possible [problems in the stations](https://twitter.com/airedemadrid/status/1364142646382452736)\n\n### DONE\n\n- [x] Improve this README.\n- [x] Add a global quality score for a station\n- [x] Add pollutants scoring\n- [x] Find a better name than 'magnitude'\n- [x] Return data in the form of an array\n- [x] Add tests\n- [x] Add more methods to get readings\n- [x] Improve documentation with examples\n- [x] Add stations metadata (lng, lat, address, etc.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavierarce%2Faire-madrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavierarce%2Faire-madrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavierarce%2Faire-madrid/lists"}