How to get result in json from overpass-turbo?

1.8k Views Asked by At

Is it possible to get result in JSON from http://overpass-turbo.eu/ (or directly from openstreetmap) ?

My request is:

(
  way
  (around:2000,55.693309807744484,21.151986122131348)
  [highway~"^(primary|secondary|tertiary|residential)$"]
  [name];
>;);out;
2

There are 2 best solutions below

2
On

This is the query: http://overpass-api.de/api/interpreter?data=[out:json]%20;%20(%20way%20(around:2000,55.693309807744484,21.151986122131348)%20[highway~%22^(primary|secondary|tertiary|residential)$%22]%20[name];%20%3E;);%20out;

Yours was missing: [out:json] ; <your part>

and %20 before out;

3
On

You need to add this line in front of your statement:

[out:json]; ...