Search notes:

Nominatim API

Using CURL to query the Nominatim API

Some ideas how the Nominatim API can be queried with curl.
street='Bahnhofstrasse 14'
postalcode=8422
city=Pfungen
country=CH
format=jsonv2

curl -G -s                                    \
  https://nominatim.openstreetmap.org/search  \
  --data-urlencode "street=$street"           \
  --data-urlencode "postalcode=$postalcode"   \
  --data-urlencode "city=$city"               \
  --data-urlencode "country=$country"         \
  --data-urlencode "format=$format"
Pipe the output into jq for pretty printing the returned JSON objects:
curl -G -s                                    \
  https://nominatim.openstreetmap.org/search  \
  --data-urlencode "street=$street"           \
  --data-urlencode "postalcode=$postalcode"   \
  --data-urlencode "city=$city"               \
  --data-urlencode "country=$country"         \
  --data-urlencode "format=$format"    |      \
  jq
Use jq to turn the returned JSON objects into CSV and view it the with pspg:
curl -G -s                                    \
  https://nominatim.openstreetmap.org/search  \
  --data-urlencode "street=$street"           \
  --data-urlencode "postalcode=$postalcode"   \
  --data-urlencode "city=$city"               \
  --data-urlencode "country=$country"         \
  --data-urlencode "format=$format"         |
  jq -r '
    .[]                      |
   [
    .category, .type,
    .osm_type, .osm_id,
    .lat, .lon,
    .name, .display_name
   ]                         |
     @csv '                                 |  \
  pspg --csv --csv-separator ','

Index