{"id":13554162,"url":"https://github.com/osmlab/osmose-request","last_synced_at":"2025-06-22T11:07:26.910Z","repository":{"id":57316573,"uuid":"111213545","full_name":"osmlab/osmose-request","owner":"osmlab","description":"Request the Osmose API from Javascript, with promises :)","archived":false,"fork":false,"pushed_at":"2018-08-13T00:12:29.000Z","size":168,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-06-15T13:06:09.515Z","etag":null,"topics":["openstreetmap","osm","osmose","request"],"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/osmlab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-11-18T14:50:05.000Z","updated_at":"2022-10-14T00:15:52.000Z","dependencies_parsed_at":"2022-08-25T20:40:37.913Z","dependency_job_id":null,"html_url":"https://github.com/osmlab/osmose-request","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/osmlab/osmose-request","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmlab%2Fosmose-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmlab%2Fosmose-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmlab%2Fosmose-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmlab%2Fosmose-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osmlab","download_url":"https://codeload.github.com/osmlab/osmose-request/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmlab%2Fosmose-request/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261282322,"owners_count":23134939,"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":["openstreetmap","osm","osmose","request"],"created_at":"2024-08-01T12:02:40.906Z","updated_at":"2025-06-22T11:07:21.898Z","avatar_url":"https://github.com/osmlab.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![GitHub release](https://img.shields.io/github/release/osmlab/osmose-request.svg)](https://github.com/osmlab/osmose-request/releases)\n[![Build Status](https://api.travis-ci.org/osmlab/osmose-request.svg?branch=develop)](http://travis-ci.org/osmlab/osmose-request)\n[![Coverage Status](https://coveralls.io/repos/github/osmlab/osmose-request/badge.svg?branch=develop)](https://coveralls.io/github/osmlab/osmose-request?branch=develop)\n\n# Osmose Request\n\nRequest the [Osmose](http://wiki.openstreetmap.org/wiki/Osmose) API from Javascript, with promises :)\n\n\n## Installation\n\n```\n$ npm install osmose-request\n```\n\n\n## Usage\n\n``` javascript\nimport OsmoseRequest from 'osmose-request';\n\nconst osmose = new OsmoseRequest();\n\nosmose.fetchErrors({ item: 8120 })\n  .then(result =\u003e console.log(result));\n```\n\nIn the previous example, the `item` option is one of the many Osmose options available and listed here:\nhttps://wiki.openstreetmap.org/wiki/Osmose/api/0.2#Settings\n\nFor now, the value of the options have the same shape as the real API options. It will be more JS friendly in the future.\n\nSo for example, if you want to limit the returned results to a specific location, you can add the `bbox` option like that:\n\n``` javascript\nimport OsmoseRequest from 'osmose-request';\n\nconst osmose = new OsmoseRequest();\n\nosmose.fetchErrors({ item: 8120, bbox: '1.123,-0.124,2.767,0.243' })\n  .then(result =\u003e console.log(result));\n```\n\n\n### Options\n\n``` javascript\nconst osmose = new OsmoseRequest({\n  language: 'fr',\n  endpoint: 'https://...',\n});\n```\n\n#### language\n\nThe Osmose API returns translated informations. That option lets you specify a language tag to be sent to the API in the Accept-Language HTTP header.\n\n[Read more informations about the format.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language)\n\n\n#### endpoint\n\nThe [main Osmose instance](https://osmose.openstreetmap.fr) is used by default but you can specify your own.\n\n\n### Methods\n\n#### fetchErrors\n\nReturns an errors list, you can provide some options to filter the result.\n\n[Read more about the available options.](http://wiki.openstreetmap.org/wiki/Osmose/api/0.2#Settings)\n\n``` javascript\nosmose.fetchErrors({ item: 8120, status: 'open' })\n  .then(result =\u003e console.log(result));\n```\n\n\n#### fetchError\n\nReturns the informations about a specific error.\n\n``` javascript\n// With 123456 as an error ID\nosmose.fetchError(123456)\n  .then(result =\u003e console.log(result));\n```\n\n\n#### closeError\n\nCloses the given error on Osmose server.\n\n``` javascript\n// With 123456 as an error ID\nosmose.closeError(123456)\n  .then(result =\u003e console.log(result)); // true if taken into account\n```\n\n\n#### falseError\n\nSets this error as a false positive on Osmose server.\n\n``` javascript\n// With 123456 as an error ID\nosmose.falseError(123456)\n  .then(result =\u003e console.log(result)); // true if taken into account\n```\n\n\n#### fetchSupportedCountries\n\nReturns the list of the supported countries in the Osmose instance.\n\n``` javascript\nosmose.fetchSupportedCountries()\n  .then(result =\u003e console.log(result));\n```\n\n\n#### fetchItemCategories\n\nReturn the list of the item categories with some details.\n\n``` javascript\nosmose.fetchItemCategories()\n  .then(result =\u003e console.log(result));\n```\n\n\n#### fetchItems\n\nReturns the list of the items configured in the Osmose instance and their translated name.\n\nYou can filter the returned translations to one language by specifying a two letters locale (eg: fr, en, ru).\n\n``` javascript\n// Without language filter\nosmose.fetchItems()\n  .then(result =\u003e console.log(result));\n```\n\n``` javascript\n// With a language filter\nosmose.fetchItems('fr')\n  .then(result =\u003e console.log(result));\n```\n\n\n## Contribute\n\nTo start contribute on this project, you can retrieve code using the following commands:\n\n```sh\n$ git clone git@github.com:osmlab/osmose-request.git\n$ cd osmose-request\n$ npm install\n$ npm run watch\n```\n\nThis project uses a specific work flow for branches:\n\n* `master` branch is dedicated to releases, managed by repo maintainers\n* `develop` branch is for currently developed version, managed by repo maintainers\n* `feature/...` branches are for all developers, working on a particular feature\n\nPull requests are welcome, as the project is fully open-source. If you want to work on new features, please create a branch named `feature/yourFeatureName`. When work is done, open a pull request to merge your branch on `develop` branch. The code will be reviewed by one or several developers before being merged, in order to keep a good code quality.\n\n\n## Make a release\n\n```sh\n$ git checkout develop\n$ git pull origin develop\n$ npm version patch -m \"release: %s\"\n$ npm publish\n$ git checkout master\n$ git pull origin master\n$ git merge develop\n$ git push origin master\n```\n\n`npm version` tests the code, builds it and updates the doc. Then it upgrades the package version number according to the used keyword (patch, minor or major) and commits the modifications in Git (with a proper version tag). Finally, it pushes it to repository with the tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosmlab%2Fosmose-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosmlab%2Fosmose-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosmlab%2Fosmose-request/lists"}