9

I'm learning Open Street Map in order to try to retrieve a list of all cinemas in the world, in a country or in a city

I would like to know if I can do that with a REST query in Postman.

On overpass-turbo.eu I can see there is a way to do that. I see the informations I want to retrieve but I cannot tell how to create the query for Postman

enter image description here

On harrywood.co.uk it seems I can create the query but I must be doing something wrong. Dammit! I feel I'm so close!

enter image description here

I can see there are other questions like mine, but they are not about Postman, so I don't really see how can I use those information.

But I know what I want to do is possible because I can see the outcome at this URL:

enter image description here

I now know that there are 23.743 cinemas in the worls and if it's possible I would like to retrieve those information.

4
  • 1
    cross-post: stackoverflow.com/questions/51724809/…
    – scai
    Commented Aug 8, 2018 at 12:09
  • 1
    XAPI Builder is outdated these days, don't use it anymore. Follow the export steps provided by @scai below.
    – mmd
    Commented Aug 8, 2018 at 13:02
  • 1
    I would strongly recommend to start with a city first, rather than downloading data for the whole planet.
    – mmd
    Commented Aug 8, 2018 at 13:10
  • Reading the docs also helps: overpass-api.de/command_line.html
    – mmd
    Commented Aug 9, 2018 at 7:12

3 Answers 3

5
  • If you want to learn fishing: Go to https://overpass-turbo.eu/ Then enter the overpass query (QL/XML doesn't matter) that you like to check. Before running the query, open your browser network tab from its developers tools and then press run. You'll see how the data is posted.

  • If you just want the fish: Open post man, create a POST request to https://overpass-api.de/api/interpreter, and then if you want to use QL select x-www-form-urlencoded as the body type, add a key called data and set its value to be your QL query. If you want XML, select raw and set it to XML

4
  • 1
    This simply doesn't work. I sent a POST request to https://overpass-api.de/api/interpreter?data=[out:csv(::id,::type,"name")]; area[name="Bonn"]; nwr(area)[railway=station]; out; and get an error encoding error: Your input contains only whitespace.
    – parsecer
    Commented Nov 14, 2019 at 16:47
  • However, GET request seem to have worked.
    – parsecer
    Commented Nov 14, 2019 at 16:50
  • No, it didn't work either: { "version": 0.6, "generator": "Overpass API 0.7.55.7 8b86ff77", "osm3s": { "timestamp_osm_base": "2019-11-14T16:51:02Z", "timestamp_areas_base": "2019-11-14T15:16:02Z", "copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL." }, "elements": [] }
    – parsecer
    Commented Nov 14, 2019 at 16:52
  • Simply remove the whitespaces (after semicolons) from the query: https://overpass-api.de/api/interpreter?data=[out:csv(::id,::type,%22name%22)];area[name=%22Bonn%22];nwr(area)[railway=station];out;
    – sebilasse
    Commented Nov 6, 2022 at 13:49
3

At overpass-turbo.eu build your query, then simply go to Export -> Query -> OverpassQL for obtaining an Overpass API URL for your query.

Unfortunately I have absolutely no idea what Postman is.

1
2

I arrived to query Overpass API with Postman this way:

http://www.overpass-api.de/api/xapi?*[amenity=cinema][bbox=-180,-90,180,90]

After 3 minutes and 13MB

enter image description here

Special tanks to @mmd that linked on a comment how to do it through command line and save it to an output file

wget -O target.osm http://www.overpass-api.de/api/xapi?*[amenity=cinema][bbox=-180,-90,180,90]
5
  • 1
    Please don’t use the Xapi endpoint (like I mentioned before), it doesn’t support Overpass QL! Your follow up question help.openstreetmap.org/questions/65281/… will not work with Xapi. Xapi is totally outdated these days.
    – mmd
    Commented Aug 12, 2018 at 4:08
  • Thank you @mmd, I see you know a lot about OSM. So what should I put instead of Xapi? Commented Aug 12, 2018 at 4:14
  • 1
    use /api/interpreter instead like shown in the documentation
    – mmd
    Commented Aug 12, 2018 at 4:15
  • Sorry @mmd, I tried but it's not working: http://www.overpass-api.de/api/interpreter?data=node[amenity=bank][bbox=-180,-90,180,90]. Frankly, the documentation is poor around REST call. I hope my post will help more people. If you know how to call the API without Xapi please post an example of an URL. Thank you Commented Aug 12, 2018 at 4:24
  • 2
    You’re mixing xapi and overpass ql syntax here, again, start with overpass turbo and once you’re familiar with the language think about Postman. There’s plenty of documentation available: wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL
    – mmd
    Commented Aug 12, 2018 at 4:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.