Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OSM-API to fetch metadata #198

Open
pietervdvn opened this issue Jun 9, 2022 · 0 comments
Open

Use OSM-API to fetch metadata #198

pietervdvn opened this issue Jun 9, 2022 · 0 comments

Comments

@pietervdvn
Copy link

pietervdvn commented Jun 9, 2022

The API can be used via https://www.openstreetmap.org/api/0.6/<osmid, e.g. way/123>. If the header Accepts: application/json, a file such as the following is returned:

{
  "license": "http://opendatacommons.org/licenses/odbl/1-0/",
  "elements": [
    {
      "type": "node",
      "lat": 51.0267345,
      "lon": 3.7100248,
      "tags": {
        "addr:housenumber": "413",
        "addr:street": "Voskenslaan",
        "amenity": "fast_food",
        "cuisine": "friture",
        "delivery": "no",
        "diet:vegetarian": "yes",
        "friture:oil": "animal",
        "name": "De Fritoloog",
        "opening_hours": "Mo-Fr 11:30-14:00,17:00-22:30; Su 18:00-22:30",
        "takeaway": "yes",
        "website": "https://www.defritoloog.be/"
      }
    }
  ]
}

The tags you'll need are: 'phone', 'addr:*', 'website'. Furthermore, opening_hours can be really interesting too (and can be parsed with https://invent.kde.org/libraries/kopeninghours or https://github.com/opening-hours/pyopening_hours)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants