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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1745516212, '3.147.75.50', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/OpenStreetMap/API/Nominatim/index(80): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78