diff --git a/.githooks/pre-commit b/.githooks/pre-commit
index 5bdc41c..3bf890b 100755
--- a/.githooks/pre-commit
+++ b/.githooks/pre-commit
@@ -1,27 +1,60 @@
#!/bin/bash
-VERSION=512
-CMD=shasum
-SHA="sha$VERSION"
+INPUT_DIR=src
+OUTPUT_DIR=docs
-INPUT=docs/nominatim.openapi.json
-OUTPUT="$INPUT".checksum
+OAS_FILE=nominatim.openapi.json
-if [ ! -f $INPUT ]
+SHA_CMD=shasum
+SHA_VERSION=512
+SHA_PREFIX="sha$SHA_VERSION"
+
+NPX_CMD=npx
+SWAGGER_CLI_VERSION="4.0.4"
+PRETTY_MINI_JSON_VERSION="1.1.4"
+JSON_DEREFERENCE_CLI_VERSION="0.1.2"
+VALIDATE_CMD="$NPX_CMD -y @apidevtools/swagger-cli@$SWAGGER_CLI_VERSION validate"
+BUNDLE_OAS_CMD="$NPX_CMD -y @apidevtools/swagger-cli@$SWAGGER_CLI_VERSION bundle"
+BUNDLE_SCHEMA_CMD="$NPX_CMD -y json-dereference-cli@$JSON_DEREFERENCE_CLI_VERSION"
+MINIFY_CMD="$NPX_CMD -y pretty-mini-json@$PRETTY_MINI_JSON_VERSION"
+
+# OpenAPI spec and JSON schema files must exist
+if [ ! -f "$INPUT_DIR/$OAS_FILE" ]
+then
+ echo "$OAS_FILE file in $INPUT_DIR folder is missing, abort"
+ exit 1
+fi
+
+# npx must be installed
+if ! command -v $NPX_CMD &> /dev/null
then
- echo "$INPUT file is missing, abort"
+ echo "$NPX_CMD could not be found, please install it"
exit 1
fi
-if ! command -v $CMD &> /dev/null
+# OpenAPI spec must be valid
+if ! $VALIDATE_CMD $INPUT_DIR/$OAS_FILE &> /dev/null
then
- echo "$CMD could not be found, please install it"
+ echo "$OAS_FILE file in $INPUT_DIR folder is not a valid OpenAPI spec, please check"
exit 1
fi
-CHECKSUM=`$CMD -a $VERSION $INPUT | awk '{print $1}'`
+# Create bundles
+$BUNDLE_OAS_CMD $INPUT_DIR/$OAS_FILE 2> /dev/null | $MINIFY_CMD -o $OUTPUT_DIR/$OAS_FILE 2> /dev/null
+
+# shasum must be installed
+if ! command -v $SHA_CMD &> /dev/null
+then
+ echo "$SHA_CMD could not be found, please install it"
+ exit 1
+fi
+
+# Compute checksums
+SHA_OAS_CHECKSUM=`$SHA_CMD -a $SHA_VERSION $OUTPUT_DIR/$OAS_FILE | cut -d" " -f 1`
+
+echo "Checksum ($OUTPUT_DIR/$OAS_FILE.checksum): $SHA_PREFIX-$SHA_OAS_CHECKSUM"
+echo -n "$SHA_PREFIX-$SHA_OAS_CHECKSUM" > $OUTPUT_DIR/$OAS_FILE.checksum
-echo "Checksum ($OUTPUT): $SHA-$CHECKSUM"
-echo -n "$SHA-$CHECKSUM" > $OUTPUT
-git add $OUTPUT
+# Stage new checksums
+git add $OUTPUT_DIR/$OAS_FILE.checksum
exit 0
diff --git a/.githooks/pre-push b/.githooks/pre-push
index 5212f93..8190c7d 100755
--- a/.githooks/pre-push
+++ b/.githooks/pre-push
@@ -1,37 +1,44 @@
#!/bin/bash
-VERSION=512
-CMD=shasum
-SHA="sha$VERSION"
+INPUT_DIR=src
+OUTPUT_DIR=docs
-INPUT=docs/nominatim.openapi.json
-OUTPUT="$INPUT".checksum
+OAS_FILE=nominatim.openapi.json
-if [ ! -f $INPUT ]
+SHA_CMD=shasum
+SHA_VERSION=512
+SHA_PREFIX="sha$SHA_VERSION"
+
+# OpenAPI spec and JSON schema files must exist
+if [ ! -f "$OUTPUT_DIR/$OAS_FILE" ]
then
- echo "$INPUT file is missing, abort"
+ echo "$OAS_FILE file in $OUTPUT_DIR folder is missing, abort"
exit 1
fi
-if ! command -v $CMD &> /dev/null
+# shasum must be installed
+if ! command -v $SHA_CMD &> /dev/null
then
- echo "$CMD could not be found, please install it"
+ echo "$SHA_CMD could not be found, please install it"
exit 1
fi
-CHECKSUM=`$CMD -a $VERSION $INPUT | awk '{print $1}'`
-
-if [ ! -f $OUTPUT ]
+# Checksums must exists
+if [ ! -f "$OUTPUT_DIR/$OAS_FILE.checksum" ]
then
- echo "$OUTPUT file is missing, abort"
+ echo "$OAS_FILE.checksum file in $OUTPUT_DIR folder is missing, abort"
exit 1
fi
-if ! grep "$SHA-$CHECKSUM" $OUTPUT &>/dev/null
+# Compute checksums
+SHA_OAS_CHECKSUM=`$SHA_CMD -a $SHA_VERSION $OUTPUT_DIR/$OAS_FILE | cut -d" " -f 1`
+
+if ! grep "$SHA_PREFIX-$SHA_OAS_CHECKSUM" $OUTPUT_DIR/$OAS_FILE.checksum &>/dev/null
then
- echo "wrong checksum, please verify"
+ echo "Wrong checksum for $OAS_FILE, please verify"
exit 1
+else
+ echo "Checksum ($OUTPUT_DIR/$OAS_FILE): $SHA_PREFIX-$SHA_OAS_CHECKSUM"
fi
-echo "Checksum ($OUTPUT): $SHA-$CHECKSUM"
exit 0
diff --git a/AUTHORS.md b/AUTHORS.md
index 1636a5d..1c6577a 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -12,6 +12,6 @@ Alessio Cimarelli (https://github.com/jenkin)
Contributors
------------
-
+Alan Sprecacenere (https://github.com/tegola)
The version control system provides attribution for specific lines of code.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5849dcd..dfece79 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,11 +12,15 @@ Here we track upcoming changes so you can see what changes you might expect in u
### Added
- MINOR
- - Nominatim OpenAPI Specification in JSON format.
+ - Nominatim OpenAPI Specification in JSON format (`/search`, `/lookup` endpoints).
- Makefile rules to simplify project management.
- Git hooks to compute spec checksum (sha512). Refs: #6.
+ - GeocodeJSON json schema. Refs: #2.
+ - Utilities to bundle OAS spec.
### Changed
-
+- MINOR
+ - Schema management outside this repo (please rerun `make hooks`).
+
### Fixed
diff --git a/Makefile b/Makefile
index 855f7cc..1abde32 100644
--- a/Makefile
+++ b/Makefile
@@ -1,25 +1,45 @@
SWAGGER_UI_VERSION ?= v5.4.2
SWAGGER_ED_VERSION ?= next-v5-unprivileged
+SWAGGER_CLI_VERSION ?= 4.0.4
+AJV_CLI_VERSION ?= 5.0.0
+PRETTY_MINI_JSON_VERSION ?= 1.1.4
+JSON_DEREFERENCE_CLI_VERSION ?= 0.1.2
+HTTP_SERVER_VERSION ?= 14.1.1
+HTTP_SERVER_PORT ?= 8080
SWAGGER_UI_PORT ?= 8091
SWAGGER_ED_PORT ?= 8092
-ui:
- echo "Swagger UI running at http://localhost:$(SWAGGER_UI_PORT)"
- docker run --rm -p $(SWAGGER_UI_PORT):8080 -v $(PWD)/docs/nominatim.openapi.json:/tmp/nominatim.openapi.json -e SWAGGER_JSON=/tmp/nominatim.openapi.json swaggerapi/swagger-ui:$(SWAGGER_UI_VERSION)
- echo "Shutdown Swagger UI"
+all: build validate checksum verify
-editor:
- echo "Swagger Editor running at http://localhost:$(SWAGGER_ED_PORT)"
- docker run --rm -p $(SWAGGER_ED_PORT):8080 -v $(PWD)/docs/nominatim.openapi.json:/tmp/nominatim.openapi.json -e SWAGGER_FILE=/tmp/nominatim.openapi.json swaggerapi/swagger-editor:$(SWAGGER_ED_VERSION)
- echo "Shutdown Swagger Editor"
+build:
+ @echo "Building the Nominatim OpenAPI spec bundle"
+ npx -y @apidevtools/swagger-cli@$(SWAGGER_CLI_VERSION) bundle src/nominatim.openapi.json | npx -y pretty-mini-json@$(PRETTY_MINI_JSON_VERSION) -o docs/nominatim.openapi.json
-hooks:
- echo "Installing git hooks"
- cp .githooks/* .git/hooks/
+validate:
+ @echo "Validating the Nominatim OpenAPI spec bundle"
+ npx -y @apidevtools/swagger-cli@$(SWAGGER_CLI_VERSION) validate docs/nominatim.openapi.json
checksum:
- echo "Compute spec checksum"
+ @echo "Computing spec checksum"
.githooks/pre-commit
verify:
.githooks/pre-push && echo "Checksum ok"
+
+ui:
+ @echo "Swagger UI running at http://localhost:$(SWAGGER_UI_PORT)"
+ docker run --rm -p $(SWAGGER_UI_PORT):8080 -v $(PWD)/src/nominatim.openapi.json:/tmp/nominatim.openapi.json -e SWAGGER_JSON=/tmp/nominatim.openapi.json swaggerapi/swagger-ui:$(SWAGGER_UI_VERSION)
+ echo "Shutdown Swagger UI"
+
+editor:
+ @echo "Swagger Editor running at http://localhost:$(SWAGGER_ED_PORT)"
+ docker run --rm -p $(SWAGGER_ED_PORT):8080 swaggerapi/swagger-editor:$(SWAGGER_ED_VERSION)
+ echo "Shutdown Swagger Editor"
+
+serve:
+ @echo "Serving playground at http://localhost:$(HTTP_SERVER_PORT)"
+ npx -y http-server@$(HTTP_SERVER_VERSION) -p $(HTTP_SERVER_PORT) ./docs
+
+hooks:
+ @echo "Installing git hooks"
+ cp .githooks/* .git/hooks/
diff --git a/README.md b/README.md
index 3e0e5d5..5de175c 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Nominatim OpenAPI Specification
-Unofficial OpenAPI specification for Nominatim API provided by OpenStreetMap project.
+Unofficial OpenAPI Specification (OAS) for Nominatim API provided by OpenStreetMap project (OSM).
@@ -30,12 +30,14 @@ This project aims to fill the hole and offer to community a robust, modern, and
Getting started section shows how to use the [official interactive playground]((https://sparkfabrik.github.io/nominatim-openapi/)) hosted by [Github Pages](https://pages.github.com/).
If you want to locally run your own playground, you must download this repository (via [zip download](https://github.com/sparkfabrik/nominatim-openapi/archive/refs/heads/main.zip) or `git clone`).
-All relevant files are in `docs/` folder.
-You can't simply open the `docs/index.html` file in your browser, because of default [Cross-Origin Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors). So you need to serve `docs/` folder using a web server running locally.
+> Source of OAS is in `src/` folder, all final files (bundled and minified) are in `docs/` folder.
+
+You can't simply open the `docs/index.html` file in your browser, because of default [Cross-Origin Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors).
+So you need to serve `docs/` folder using a web server running locally.
In a javascript-ready environment (ie. with [node](https://nodejs.org/en) and [npm](https://www.npmjs.com/) installed),
-you can run `npx -y http-server ./docs` in a terminal from the project folder and point your browser to `http://localhost:8080`.
+you can run `make serve` in a terminal from the project folder and point your browser to `http://localhost:8080`.
In a Docker-ready environment, you can run `make ui` to have the playground exposed on `http://localhost:8091`.
@@ -55,16 +57,18 @@ When ready, the following table will be updated.
| Milestone | Task | TBD | To do | Doing | Done | Refs |
| --------- | ---- | --- | ----- | ----- | ---- | ---- |
-| OpenAPI Spec | `/search` endpoint | | | ■ | | [#2](https://github.com/sparkfabrik/nominatim-openapi/issues/2) |
+| OpenAPI Spec | `/search` endpoint | | | | ■ | [#2](https://github.com/sparkfabrik/nominatim-openapi/issues/2) |
+| | `/lookup` endpoint | | | | ■ | [#4](https://github.com/sparkfabrik/nominatim-openapi/issues/4) |
| | `/reverse` endpoint | | ■ | | | [#3](https://github.com/sparkfabrik/nominatim-openapi/issues/3) |
-| | `/lookup` endpoint | | ■ | | | [#4](https://github.com/sparkfabrik/nominatim-openapi/issues/4) |
| | `/status` endpoint | | ■ | | | [#5](https://github.com/sparkfabrik/nominatim-openapi/issues/5) |
| | `/details` endpoint | ■ | | | | |
+| Test suite | | ■ | | | | |
| Node CLI | | ■ | | | | |
## Contributing
Any contribution is welcome!
+
Please read and accept our [Code of Conduct](https://github.com/sparkfabrik/nominatim-openapi/blob/main/CODE_OF_CONDUCT.md),
then refer to [Contributing Guidelines](https://github.com/sparkfabrik/nominatim-openapi/blob/main/CONTRIBUTING.md) before opening issues or pull requests.
@@ -73,12 +77,16 @@ then refer to [Contributing Guidelines](https://github.com/sparkfabrik/nominatim
First of all, search for issues or open one to share your thoughts, needs or intents with the maintainers and the community.
Then fork and clone this repo, make your changes, commit and push them on a new branch, finally open a PR against `main` branch of this repo.
+Pre-requisites: [git](https://git-scm.com/), [make](https://www.gnu.org/software/make/), [shasum](https://www.commandlinux.com/man-page/man1/shasum.1.html), [npx](https://www.npmjs.com/package/npx) (node and npm), [docker](https://www.docker.com/).
+
+Editable source of OAS is in `src/` folder. You can validate it running `make validate`. You can bundle it running `make build`.
+
Please activate the Git Hooks provided in `.githooks/` folder before the first change (hooks are bash scripts). You can simply run `make hooks` to activate them.
-- **pre-commit** - compute sha512 checksum of `nominatim.openapi.json` and write on `nominatim.openapi.json.checksum` file.
-- **pre-push** - verify the `nominatim.openapi.json` checksum against `nominatim.openapi.json.checksum` file.
+- **pre-commit** - validate and bundle OAS spec, compute sha512 checksums.
+- **pre-push** - verify the checksums.
In a Docker-ready environment, you can run `make editor` to have the new Swagger Editor up and running on `http://localhost:8092`.
-Automatic file loading and saving is not available, so you must copy/paste the content of `nominatim.openapi.json` in the editor and then copy/paste it back to save the changes.
+Automatic file loading and saving is not available, so you must copy/paste the content of `src/nominatim.openapi.json` in the editor and then copy/paste it back to save the changes.
@@ -96,6 +104,16 @@ Latest version: v3.1.0
> The OpenAPI Specification (OAS) is a specification language for HTTP APIs that provides a standardized means to define your API to others. You can quickly discover how an API works, configure infrastructure, generate client code, and create test cases for your APIs. Read more about how you can get control of your APIs now, understand the full API lifecycle and communicate with developer communities inside and outside your organization.
+### What is JSON Schema?
+
+Website: https://json-schema.org
+
+Repository: https://github.com/json-schema-org
+
+Latest version: v2020-12
+
+> JSON Schema enables the confident and reliable use of the JSON data format.
+
### What is Swagger UI?
Website: https://swagger.io/tools/swagger-ui/
@@ -122,6 +140,22 @@ Repository: https://github.com/osm-search
> Nominatim uses OpenStreetMap data to find locations on Earth by name and address (geocoding). It can also do the reverse, find an address for any location on the planet.
+### What is GeoJSON?
+
+Website: https://geojson.org
+
+Repository: https://github.com/geojson
+
+> GeoJSON is a format for encoding a variety of geographic data structures.
+
+### What is GeocodeJSON?
+
+Website: https://github.com/geocoders/geocodejson-spec/tree/master/draft
+
+Repository: https://github.com/geocoders/geocodejson-spec
+
+> This specification attempts to create a standard for handling geocoding results.
+
### What is Subresource Integrity (SRI)
Website: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
@@ -138,8 +172,7 @@ Website: https://en.wikipedia.org/wiki/SHA-2
Nominatim (and OpenStreetMap) project have a long story and a non trivial development path, so this OpenAPI specification reflects some features of actual software and official documentation.
-- The `format` parameter ([docs](https://nominatim.org/release-docs/develop/api/Search/#output-format)) accepts 5 values (`xml`, `json`, `jsonv2`, `geojson`, `geocodejson`), but only `jsonv2` (the default one) is described by this specification in `components.schemas` (see [Nominatim/issues/1697](https://github.com/osm-search/Nominatim/issues/1697#issuecomment-726232719) and [OpenAPI-Specification/issues/2031](https://github.com/OAI/OpenAPI-Specification/issues/2031) for further informations).
-- In `jsonv2` responses some numeric values are represented by strings for historical reasons (see [this discussion](https://github.com/osm-search/Nominatim/discussions/3115)), so this specification.
+- The `format` parameter ([docs](https://nominatim.org/release-docs/develop/api/Search/#output-format)) accepts 5 values (`xml`, `json`, `jsonv2`, `geojson`, `geocodejson`), where `jsonv2` is the default one, but this specification describes only the `geocodejson` format in `components.schemas` (see [Nominatim/discussions/3115](https://github.com/osm-search/Nominatim/discussions/3115#discussioncomment-6486249), [Nominatim/issues/1697](https://github.com/osm-search/Nominatim/issues/1697#issuecomment-726232719), and [OpenAPI-Specification/issues/2031](https://github.com/OAI/OpenAPI-Specification/issues/2031) for further informations).
## Open Source Software
@@ -147,7 +180,12 @@ This project would not exist without open source, it is open source, and the com
Here is a list of external contributions (code and discussions) starting from work for this project:
- fix typos in Nominatim error messages: [Nominatim/pull/3112](https://github.com/osm-search/Nominatim/pull/3112)
-- discussion about `jsonv2` format of Nominatim responses: [Nominatim/discussions/3115](https://github.com/osm-search/Nominatim/discussions/3115)
+- discussion about `jsonv2` and `geocodejson` formats of Nominatim responses: [Nominatim/discussions/3115](https://github.com/osm-search/Nominatim/discussions/3115)
+- proposal of a JSON schema for `geocodejson` spec: [geocodejson-spec/issues/21](https://github.com/geocoders/geocodejson-spec/issues/21)
+- pull request the GeocodeJSON schema: [geocodejson-spec/pull/25](https://github.com/geocoders/geocodejson-spec/pull/25)
+- release of an unofficial schema for [GeocodeJSON](https://semver.org/) format (see [jenkin/json-schema-bricks](https://github.com/jenkin/json-schema-bricks))
+- release of an unofficial schema for [GeoHash](http://geohash.org/) format (see [jenkin/json-schema-bricks](https://github.com/jenkin/json-schema-bricks))
+- release of an unofficial schema for [SemVer](https://semver.org/) format (see [jenkin/json-schema-bricks](https://github.com/jenkin/json-schema-bricks))
- ...
## License
diff --git a/docs/nominatim.openapi.json b/docs/nominatim.openapi.json
index b083cc1..a5580b6 100644
--- a/docs/nominatim.openapi.json
+++ b/docs/nominatim.openapi.json
@@ -1,552 +1 @@
-{
- "openapi": "3.1.0",
- "info": {
- "title": "OpenStreetMap Nominatim API",
- "version": "4.2.3",
- "description": "OpenStreetMap Nominatim API v4.2.3\n\nNeed some help?\nhttps://nominatim.org/",
- "termsOfService": "https://operations.osmfoundation.org/policies/nominatim/",
- "contact": {
- "url": "https://github.com/osm-search/Nominatim/issues"
- }
- },
- "servers": [
- {
- "url": "https://nominatim.openstreetmap.org"
- },
- {
- "url": "http://localhost:{port}",
- "variables": {
- "port": {
- "default": "80"
- }
- }
- }
- ],
- "paths": {
- "/search": {
- "get": {
- "summary": "Look up a location from a textual description or address",
- "operationId": "search",
- "description": "Returns a list of locations.",
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "q",
- "description": "Free-form query string to search for. Free-form queries are processed first left-to-right and then right-to-left if that fails. Commas are optional, but improve performance by reducing the complexity of the search."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "amenity",
- "description": "Name and/or type of POI. Do not combine with `q=` parameter."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "street",
- "description": "Name of street with optional housenumber. Do not combine with `q=` parameter."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "city",
- "description": "Name of city. Do not combine with `q=` parameter."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "county",
- "description": "Name of county. Do not combine with `q=` parameter."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "state",
- "description": "Name of state. Do not combine with `q=` parameter."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "country",
- "description": "Name of country. Do not combine with `q=` parameter."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "postalcode",
- "description": "Postalcode. Do not combine with `q=` parameter."
- },
- {
- "schema": {
- "type": "string",
- "enum": [
- "xml",
- "json",
- "jsonv2",
- "geojson",
- "geocodejson"
- ],
- "default": "jsonv2"
- },
- "in": "query",
- "name": "format",
- "description": "Format of response. See [Place Output Formats](https://nominatim.org/release-docs/develop/api/Output/) for details on each format."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "json_callback",
- "description": "Wrap JSON output in a callback function (JSONP) i.e. (). Only has an effect for JSON output formats."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "addressdetails",
- "description": "Include a breakdown of the address into elements."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "extratags",
- "description": "Include additional information in the result if available, e.g. wikipedia link, opening hours."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "namedetails",
- "description": "Include a list of alternative names in the results. These may include language variants, references, operator and brand."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "accept-language",
- "description": "Preferred language order for showing search results, overrides the value specified in the [Accept-Language HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). Either use a standard RFC2616 accept-language string or a simple comma-separated list of language codes."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "countrycodes",
- "description": "Limit search results to one or more countries. `` must be the [ISO 3166-1alpha2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. Each place in Nominatim is assigned to one country code based on OSM country boundaries. In rare cases a place may not be in any country at all, for example, in international waters."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "exclude_place_ids",
- "description": "If you do not want certain OSM objects to appear in the search result, give a comma separated list of the `place_ids` you want to skip. This can be used to retrieve additional search results. For example, if a previous query only returned a few results, then including those here would cause the search to return other, less accurate, matches (if possible)."
- },
- {
- "schema": {
- "type": "integer",
- "default": 10,
- "maximum": 50,
- "minimum": 1
- },
- "in": "query",
- "name": "limit",
- "description": "Limit the number of returned results."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "viewbox",
- "description": "The preferred area to find search results. Any two corner points of the box are accepted as long as they span a real box. In `viewbox=,,,` x is longitude, y is latitude."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "bounded",
- "description": "When a viewbox is given, restrict the result to items contained within that viewbox (see above). When `viewbox` and `bounded=1` are given, an amenity only search is allowed. Give the special keyword for the amenity in square brackets, e.g. `[pub]` and a selection of objects of this type is returned. There is no guarantee that the result is complete."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "polygon_geojson",
- "description": "Output geometry of results as a GeoJSON."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "polygon_kml",
- "description": "Output geometry of results as a KML."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "polygon_svg",
- "description": "Output geometry of results as a SVG."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "polygon_text",
- "description": "Output geometry of results as a WKT."
- },
- {
- "schema": {
- "type": "number",
- "minimum": 0.0
- },
- "in": "query",
- "name": "polygon_threshold",
- "description": "Return a simplified version of the output geometry. The parameter is the tolerance in degrees with which the geometry may differ from the original geometry. Topology is preserved in the result."
- },
- {
- "schema": {
- "type": "string",
- "format": "email"
- },
- "in": "query",
- "name": "email",
- "description": "If you are making large numbers of request please include an appropriate email address to identify your requests. See Nominatim's [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details."
- },
- {
- "schema": {
- "type": "integer",
- "default": 1,
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "dedupe",
- "description": "Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split into many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match unless this parameter is set to 0."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "debug",
- "description": "Output assorted developer debug information. Data on internals of Nominatim's Search Loop logic, and SQL queries. The output is (rough) HTML format. This overrides the specified machine readable format."
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "content": {
- "application/json": {
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Location"
- }
- }
- }
- }
- }
- },
- "tags": [
- "Search"
- ]
- }
- },
- "/lookup": {
- "get": {
- "summary": "Query the address and other details of one or multiple OSM objects like node, way or relation.",
- "operationId": "lookup",
- "description": "Returns the details of an OSM object.",
- "parameters": [
- {
- "schema": {
- "type": "string",
- "pattern": "^([RWN][0-9]+,?)+$"
- },
- "in": "query",
- "required": true,
- "name": "osm_ids",
- "description": "Comma-separated list of OSM ids each prefixed with its type, one of node(N), way(W) or relation(R). Up to 50 ids can be queried at the same time."
- },
- {
- "schema": {
- "type": "string",
- "enum": [
- "xml",
- "json",
- "jsonv2",
- "geojson",
- "geocodejson"
- ],
- "default": "jsonv2"
- },
- "in": "query",
- "name": "format",
- "description": "Format of response. See [Place Output Formats](https://nominatim.org/release-docs/develop/api/Output/) for details on each format."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "json_callback",
- "description": "Wrap JSON output in a callback function (JSONP) i.e. (). Only has an effect for JSON output formats."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "addressdetails",
- "description": "Include a breakdown of the address into elements."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "extratags",
- "description": "Include additional information in the result if available, e.g. wikipedia link, opening hours."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "namedetails",
- "description": "Include a list of alternative names in the results. These may include language variants, references, operator and brand."
- },
- {
- "schema": {
- "type": "string"
- },
- "in": "query",
- "name": "accept-language",
- "description": "Preferred language order for showing search results, overrides the value specified in the [Accept-Language HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). Either use a standard RFC2616 accept-language string or a simple comma-separated list of language codes."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "polygon_geojson",
- "description": "Output geometry of results as a GeoJSON."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "polygon_kml",
- "description": "Output geometry of results as a KML."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "polygon_svg",
- "description": "Output geometry of results as a SVG."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "polygon_text",
- "description": "Output geometry of results as a WKT."
- },
- {
- "schema": {
- "type": "number",
- "minimum": 0.0
- },
- "in": "query",
- "name": "polygon_threshold",
- "description": "Return a simplified version of the output geometry. The parameter is the tolerance in degrees with which the geometry may differ from the original geometry. Topology is preserved in the result."
- },
- {
- "schema": {
- "type": "string",
- "format": "email"
- },
- "in": "query",
- "name": "email",
- "description": "If you are making large numbers of request please include an appropriate email address to identify your requests. See Nominatim's [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details."
- },
- {
- "schema": {
- "type": "integer",
- "maximum": 1,
- "minimum": 0
- },
- "in": "query",
- "name": "debug",
- "description": "Output assorted developer debug information. Data on internals of Nominatim's Search Loop logic, and SQL queries. The output is (rough) HTML format. This overrides the specified machine readable format."
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "content": {
- "application/json": {
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Location"
- }
- }
- }
- }
- }
- },
- "tags": [
- "Lookup"
- ]
- }
- }
- },
- "components": {
- "schemas": {
- "Location": {
- "title": "Location",
- "type": "object",
- "properties": {
- "place_id": { "type": "integer" },
- "licence": { "type": "string" },
- "osm_type": {
- "type": "string",
- "enum": [ "node", "way", "relation" ]
- },
- "osm_id": { "type": "integer" },
- "boundingbox": {
- "type": "array",
- "minItems": 4,
- "maxItems": 4,
- "items": { "type": "string" }
- },
- "lat": { "type": "string" },
- "lon": { "type": "string" },
- "display_name": { "type": "string" },
- "place_rank": { "type": "integer" },
- "category": { "type": "string" },
- "type": { "type": "string" },
- "importance": { "type": "number" },
- "icon": { "type": "string", "format": "uri" },
- "address": { "$ref": "#/components/schemas/Address" },
- "extratags": { "$ref": "#/components/schemas/Extratags" },
- "namedetails": { "$ref": "#/components/schemas/Namedetails" }
- },
- "required": [
- "display_name",
- "lat",
- "lon"
- ]
- },
- "Address": {
- "title": "Address",
- "type": "object",
- "properties": {
- "road": { "type": "string" },
- "suburb": { "type": "string" },
- "city": { "type": "string" },
- "county": { "type": "string" },
- "ISO3166-2-lvl6": { "type": "string" },
- "state_district": { "type": "string" },
- "state": { "type": "string" },
- "ISO3166-2-lvl4": { "type": "string" },
- "postcode": { "type": "string" },
- "country": { "type": "string" },
- "country_code": { "type": "string" }
- }
- },
- "Extratags": {
- "title": "Extratags",
- "type": "object",
- "properties": {
- "capital": { "type": "string" },
- "website": { "type": "string", "format": "uri" },
- "wikidata": { "type": "string" },
- "wikipedia": { "type": "string" },
- "population": { "type": "integer" }
- }
- },
- "Namedetails": {
- "title": "Namedetails",
- "type": "object",
- "properties": {
- "name": { "type": "string" },
- "official_name": { "type": "string" }
- },
- "patternProperties": {
- "^name:": { "type": "string" },
- "^old_name:": { "type": "string" },
- "^_place_name:": { "type": "string" },
- "^alt_name:": { "type": "string" }
- }
- }
- }
- }
-}
\ No newline at end of file
+{"openapi":"3.1.0","info":{"title":"OpenStreetMap Nominatim API","version":"4.2.3","description":"OpenStreetMap Nominatim API v4.2.3\n\nNeed some help?\nhttps://nominatim.org/","termsOfService":"https://operations.osmfoundation.org/policies/nominatim/","contact":{"url":"https://github.com/osm-search/Nominatim/issues"}},"servers":[{"url":"https://nominatim.openstreetmap.org"},{"url":"http://localhost:{port}","variables":{"port":{"default":"80"}}}],"paths":{"/search":{"get":{"summary":"Look up a location from a textual description or address","operationId":"search","description":"Returns a list of locations.","parameters":[{"schema":{"type":"string"},"in":"query","name":"q","description":"Free-form query string to search for. Free-form queries are processed first left-to-right and then right-to-left if that fails. Commas are optional, but improve performance by reducing the complexity of the search."},{"schema":{"type":"string"},"in":"query","name":"amenity","description":"Name and/or type of POI. Do not combine with `q=` parameter."},{"schema":{"type":"string"},"in":"query","name":"street","description":"Name of street with optional housenumber. Do not combine with `q=` parameter."},{"schema":{"type":"string"},"in":"query","name":"city","description":"Name of city. Do not combine with `q=` parameter."},{"schema":{"type":"string"},"in":"query","name":"county","description":"Name of county. Do not combine with `q=` parameter."},{"schema":{"type":"string"},"in":"query","name":"state","description":"Name of state. Do not combine with `q=` parameter."},{"schema":{"type":"string"},"in":"query","name":"country","description":"Name of country. Do not combine with `q=` parameter."},{"schema":{"type":"string"},"in":"query","name":"postalcode","description":"Postalcode. Do not combine with `q=` parameter."},{"schema":{"type":"string","enum":["xml","json","jsonv2","geojson","geocodejson"],"default":"geocodejson"},"in":"query","name":"format","description":"Format of response. See [Place Output Formats](https://nominatim.org/release-docs/develop/api/Output/) for details on each format. If not specified, it is equal to `jsonv2`."},{"schema":{"type":"string"},"in":"query","name":"json_callback","description":"Wrap JSON output in a callback function (JSONP) i.e. (). Only has an effect for JSON output formats."},{"schema":{"type":"integer","maximum":1,"minimum":0,"default":1},"in":"query","name":"addressdetails","description":"Include a breakdown of the address into elements."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"extratags","description":"Include additional information in the result if available, e.g. wikipedia link, opening hours."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"namedetails","description":"Include a list of alternative names in the results. These may include language variants, references, operator and brand."},{"schema":{"type":"string"},"in":"query","name":"accept-language","description":"Preferred language order for showing search results, overrides the value specified in the [Accept-Language HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). Either use a standard RFC2616 accept-language string or a simple comma-separated list of language codes."},{"schema":{"type":"string"},"in":"query","name":"countrycodes","description":"Limit search results to one or more countries. `` must be the [ISO 3166-1alpha2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. Each place in Nominatim is assigned to one country code based on OSM country boundaries. In rare cases a place may not be in any country at all, for example, in international waters."},{"schema":{"type":"string"},"in":"query","name":"exclude_place_ids","description":"If you do not want certain OSM objects to appear in the search result, give a comma separated list of the `place_ids` you want to skip. This can be used to retrieve additional search results. For example, if a previous query only returned a few results, then including those here would cause the search to return other, less accurate, matches (if possible)."},{"schema":{"type":"integer","default":10,"maximum":50,"minimum":1},"in":"query","name":"limit","description":"Limit the number of returned results."},{"schema":{"type":"string"},"in":"query","name":"viewbox","description":"The preferred area to find search results. Any two corner points of the box are accepted as long as they span a real box. In `viewbox=,,,` x is longitude, y is latitude."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"bounded","description":"When a viewbox is given, restrict the result to items contained within that viewbox (see above). When `viewbox` and `bounded=1` are given, an amenity only search is allowed. Give the special keyword for the amenity in square brackets, e.g. `[pub]` and a selection of objects of this type is returned. There is no guarantee that the result is complete."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"polygon_geojson","description":"Output geometry of results as a GeoJSON."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"polygon_kml","description":"Output geometry of results as a KML."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"polygon_svg","description":"Output geometry of results as a SVG."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"polygon_text","description":"Output geometry of results as a WKT."},{"schema":{"type":"number","minimum":0},"in":"query","name":"polygon_threshold","description":"Return a simplified version of the output geometry. The parameter is the tolerance in degrees with which the geometry may differ from the original geometry. Topology is preserved in the result."},{"schema":{"type":"string","format":"email"},"in":"query","name":"email","description":"If you are making large numbers of request please include an appropriate email address to identify your requests. See Nominatim's [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details."},{"schema":{"type":"integer","default":1,"maximum":1,"minimum":0},"in":"query","name":"dedupe","description":"Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split into many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match unless this parameter is set to 0."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"debug","description":"Output assorted developer debug information. Data on internals of Nominatim's Search Loop logic, and SQL queries. The output is (rough) HTML format. This overrides the specified machine readable format."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OSMGeocodeJson"}}}}},"tags":["Search"]}},"/lookup":{"get":{"summary":"Query the address and other details of one or multiple OSM objects like node, way or relation.","operationId":"lookup","description":"Returns the details of an OSM object.","parameters":[{"schema":{"type":"string","pattern":"^([RWN][0-9]+,?)+$"},"in":"query","required":true,"name":"osm_ids","description":"Comma-separated list of OSM ids each prefixed with its type, one of node(N), way(W) or relation(R). Up to 50 ids can be queried at the same time."},{"schema":{"type":"string","enum":["xml","json","jsonv2","geojson","geocodejson"],"default":"geocodejson"},"in":"query","name":"format","description":"Format of response. See [Place Output Formats](https://nominatim.org/release-docs/develop/api/Output/) for details on each format."},{"schema":{"type":"string"},"in":"query","name":"json_callback","description":"Wrap JSON output in a callback function (JSONP) i.e. (). Only has an effect for JSON output formats."},{"schema":{"type":"integer","maximum":1,"minimum":0,"default":1},"in":"query","name":"addressdetails","description":"Include a breakdown of the address into elements."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"extratags","description":"Include additional information in the result if available, e.g. wikipedia link, opening hours."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"namedetails","description":"Include a list of alternative names in the results. These may include language variants, references, operator and brand."},{"schema":{"type":"string"},"in":"query","name":"accept-language","description":"Preferred language order for showing search results, overrides the value specified in the [Accept-Language HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). Either use a standard RFC2616 accept-language string or a simple comma-separated list of language codes."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"polygon_geojson","description":"Output geometry of results as a GeoJSON."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"polygon_kml","description":"Output geometry of results as a KML."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"polygon_svg","description":"Output geometry of results as a SVG."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"polygon_text","description":"Output geometry of results as a WKT."},{"schema":{"type":"number","minimum":0},"in":"query","name":"polygon_threshold","description":"Return a simplified version of the output geometry. The parameter is the tolerance in degrees with which the geometry may differ from the original geometry. Topology is preserved in the result."},{"schema":{"type":"string","format":"email"},"in":"query","name":"email","description":"If you are making large numbers of request please include an appropriate email address to identify your requests. See Nominatim's [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details."},{"schema":{"type":"integer","maximum":1,"minimum":0},"in":"query","name":"debug","description":"Output assorted developer debug information. Data on internals of Nominatim's Search Loop logic, and SQL queries. The output is (rough) HTML format. This overrides the specified machine readable format."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OSMGeocodeJson"}}}}}},"tags":["Lookup"]}}},"components":{"schemas":{"OSMGeocodeJson":{"allOf":[{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://geocoders.github.io/geocodejson-spec/draft/geocodejson.schema.json","title":"GeocodeJSON Schema","description":"GeocodeJSON is an extension of the GeoJSON format and it is an attempt to create a standard for handling geocoding results.","allOf":[{"title":"GeoJSON","oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON FeatureCollection","type":"object","required":["type","features"],"properties":{"type":{"type":"string","enum":["FeatureCollection"]},"features":{"type":"array","items":{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},{"type":"object","description":"GeocodeJSON extension of GeoJSON Feature Collection","properties":{"type":{"const":"FeatureCollection","description":"REQUIRED. GeocodeJSON result is a FeatureCollection."},"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"version":{"type":"string","description":"A semver.org compliant version number (see https://semver.org).","pattern":"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$","minLength":5,"maxLength":256,"examples":["0.1.0","1.0.0-beta.1","1.0.0-0.3.7","2.2.4"]},"licence":{"type":"string","description":"OPTIONAL. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.","examples":["ODbL"]},"attribution":{"type":"string","description":"OPTIONAL. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.","examples":["OpenStreetMap Contributors"]},"query":{"type":"string","description":"OPTIONAL. The query that has been issued to trigger the search.","examples":["24 allée de Bercy 75012 Paris"]}},"required":["version"]}},"required":["geocoding"]},{"type":"object","description":"GeocodeJSON extension of GeoJSON Feature","properties":{"features":{"type":"array","description":"REQUIRED. As per GeoJSON spec.","items":{"type":"object","description":"OPTIONAL. An array of feature objects.","properties":{"type":{"const":"Feature","description":"REQUIRED. As per GeoJSON spec."},"properties":{"type":"object","description":"REQUIRED. As per GeoJSON spec.","properties":{"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"type":{"type":"string","description":"REQUIRED. One of house, street, locality, city, region, country.","examples":["house","street","district","city","county","state","country","locality"]},"accuracy":{"type":"number","minimum":0,"description":"OPTIONAL. Result accuracy, in meters.","examples":[20]},"label":{"type":"string","description":"RECOMMENDED. Suggested label for the result.","examples":["My Shoes Shop, 64 rue de Metz 59280 Armentières"]},"name":{"type":"string","description":"OPTIONAL. Name of the place.","examples":["My Shoes Shop"]},"housenumber":{"type":"string","description":"OPTIONAL. Housenumber of the place.","examples":["64"]},"street":{"type":"string","description":"OPTIONAL. Street of the place.","examples":["Rue de Metz"]},"locality":{"type":"string","description":"OPTIONAL. Locality of the place.","examples":["Les Clarons"]},"postcode":{"type":"string","description":"OPTIONAL. Postcode of the place.","examples":["59280"]},"city":{"type":"string","description":"OPTIONAL. City of the place.","examples":["Armentières"]},"district":{"type":"string","description":"OPTIONAL. District of the place."},"county":{"type":"string","description":"OPTIONAL. County of the place."},"state":{"type":"string","description":"OPTIONAL. State of the place."},"country":{"type":"string","description":"OPTIONAL. Country of the place.","examples":["France"]},"admin":{"type":"object","description":"OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.","patternProperties":{"^level[0-9]+$":{"type":"string"}}},"geohash":{"type":"string","description":"Geohash encoding of coordinates (see http://geohash.org and https://en.wikipedia.org/wiki/Geohash).","pattern":"^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$","examples":["6gkzmg1w","6gkzwgjzn820","c216ne:Mt_Hood"]}},"required":["type"]}},"required":["geocoding"]}}}}}}],"$defs":{}},{"type":"object","properties":{"features":{"type":"array","items":{"type":"object","properties":{"properties":{"type":"object","properties":{"geocoding":{"type":"object","properties":{"osm_type":{"type":"string","examples":["node","way","relation"]},"osm_id":{"type":"integer"},"osm_key":{"type":"string","examples":["boundary","highway","amenity"]},"osm_value":{"type":"string","examples":["residential","restaurant"]}}}}}}}}}}]}}}}
\ No newline at end of file
diff --git a/docs/nominatim.openapi.json.checksum b/docs/nominatim.openapi.json.checksum
index 70ac564..8b1592e 100644
--- a/docs/nominatim.openapi.json.checksum
+++ b/docs/nominatim.openapi.json.checksum
@@ -1 +1 @@
-sha512-12cc03cf46031d824faf470d0173f9f91793f4a3e3bfd1be3b51a6544b3d8e06c6886955dfb883b0e515cdb17799f16c5b7424b0e5d7bea1e43950bca0a5c2e0
\ No newline at end of file
+sha512-2127cc7d5d1563e4a1185d516d0c0272de9c4fea3bdff7837a8a5c18a755bb82cf82d17858160f791be92be34b4a6f1b1732e4333d33a8e2bb5a2734bc82be82
\ No newline at end of file
diff --git a/src/nominatim.openapi.json b/src/nominatim.openapi.json
new file mode 100644
index 0000000..7342ed0
--- /dev/null
+++ b/src/nominatim.openapi.json
@@ -0,0 +1,530 @@
+{
+ "openapi": "3.1.0",
+ "info": {
+ "title": "OpenStreetMap Nominatim API",
+ "version": "4.2.3",
+ "description": "OpenStreetMap Nominatim API v4.2.3\n\nNeed some help?\nhttps://nominatim.org/",
+ "termsOfService": "https://operations.osmfoundation.org/policies/nominatim/",
+ "contact": {
+ "url": "https://github.com/osm-search/Nominatim/issues"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://nominatim.openstreetmap.org"
+ },
+ {
+ "url": "http://localhost:{port}",
+ "variables": {
+ "port": {
+ "default": "80"
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/search": {
+ "get": {
+ "summary": "Look up a location from a textual description or address",
+ "operationId": "search",
+ "description": "Returns a list of locations.",
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "q",
+ "description": "Free-form query string to search for. Free-form queries are processed first left-to-right and then right-to-left if that fails. Commas are optional, but improve performance by reducing the complexity of the search."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "amenity",
+ "description": "Name and/or type of POI. Do not combine with `q=` parameter."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "street",
+ "description": "Name of street with optional housenumber. Do not combine with `q=` parameter."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "city",
+ "description": "Name of city. Do not combine with `q=` parameter."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "county",
+ "description": "Name of county. Do not combine with `q=` parameter."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "state",
+ "description": "Name of state. Do not combine with `q=` parameter."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "country",
+ "description": "Name of country. Do not combine with `q=` parameter."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "postalcode",
+ "description": "Postalcode. Do not combine with `q=` parameter."
+ },
+ {
+ "schema": {
+ "type": "string",
+ "enum": [
+ "xml",
+ "json",
+ "jsonv2",
+ "geojson",
+ "geocodejson"
+ ],
+ "default": "geocodejson"
+ },
+ "in": "query",
+ "name": "format",
+ "description": "Format of response. See [Place Output Formats](https://nominatim.org/release-docs/develop/api/Output/) for details on each format. If not specified, it is equal to `jsonv2`."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "json_callback",
+ "description": "Wrap JSON output in a callback function (JSONP) i.e. (). Only has an effect for JSON output formats."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0,
+ "default": 1
+ },
+ "in": "query",
+ "name": "addressdetails",
+ "description": "Include a breakdown of the address into elements."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "extratags",
+ "description": "Include additional information in the result if available, e.g. wikipedia link, opening hours."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "namedetails",
+ "description": "Include a list of alternative names in the results. These may include language variants, references, operator and brand."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "accept-language",
+ "description": "Preferred language order for showing search results, overrides the value specified in the [Accept-Language HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). Either use a standard RFC2616 accept-language string or a simple comma-separated list of language codes."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "countrycodes",
+ "description": "Limit search results to one or more countries. `` must be the [ISO 3166-1alpha2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. Each place in Nominatim is assigned to one country code based on OSM country boundaries. In rare cases a place may not be in any country at all, for example, in international waters."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "exclude_place_ids",
+ "description": "If you do not want certain OSM objects to appear in the search result, give a comma separated list of the `place_ids` you want to skip. This can be used to retrieve additional search results. For example, if a previous query only returned a few results, then including those here would cause the search to return other, less accurate, matches (if possible)."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "default": 10,
+ "maximum": 50,
+ "minimum": 1
+ },
+ "in": "query",
+ "name": "limit",
+ "description": "Limit the number of returned results."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "viewbox",
+ "description": "The preferred area to find search results. Any two corner points of the box are accepted as long as they span a real box. In `viewbox=,,,` x is longitude, y is latitude."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "bounded",
+ "description": "When a viewbox is given, restrict the result to items contained within that viewbox (see above). When `viewbox` and `bounded=1` are given, an amenity only search is allowed. Give the special keyword for the amenity in square brackets, e.g. `[pub]` and a selection of objects of this type is returned. There is no guarantee that the result is complete."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "polygon_geojson",
+ "description": "Output geometry of results as a GeoJSON."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "polygon_kml",
+ "description": "Output geometry of results as a KML."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "polygon_svg",
+ "description": "Output geometry of results as a SVG."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "polygon_text",
+ "description": "Output geometry of results as a WKT."
+ },
+ {
+ "schema": {
+ "type": "number",
+ "minimum": 0.0
+ },
+ "in": "query",
+ "name": "polygon_threshold",
+ "description": "Return a simplified version of the output geometry. The parameter is the tolerance in degrees with which the geometry may differ from the original geometry. Topology is preserved in the result."
+ },
+ {
+ "schema": {
+ "type": "string",
+ "format": "email"
+ },
+ "in": "query",
+ "name": "email",
+ "description": "If you are making large numbers of request please include an appropriate email address to identify your requests. See Nominatim's [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "default": 1,
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "dedupe",
+ "description": "Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split into many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match unless this parameter is set to 0."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "debug",
+ "description": "Output assorted developer debug information. Data on internals of Nominatim's Search Loop logic, and SQL queries. The output is (rough) HTML format. This overrides the specified machine readable format."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OSMGeocodeJson"
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Search"
+ ]
+ }
+ },
+ "/lookup": {
+ "get": {
+ "summary": "Query the address and other details of one or multiple OSM objects like node, way or relation.",
+ "operationId": "lookup",
+ "description": "Returns the details of an OSM object.",
+ "parameters": [
+ {
+ "schema": {
+ "type": "string",
+ "pattern": "^([RWN][0-9]+,?)+$"
+ },
+ "in": "query",
+ "required": true,
+ "name": "osm_ids",
+ "description": "Comma-separated list of OSM ids each prefixed with its type, one of node(N), way(W) or relation(R). Up to 50 ids can be queried at the same time."
+ },
+ {
+ "schema": {
+ "type": "string",
+ "enum": [
+ "xml",
+ "json",
+ "jsonv2",
+ "geojson",
+ "geocodejson"
+ ],
+ "default": "geocodejson"
+ },
+ "in": "query",
+ "name": "format",
+ "description": "Format of response. See [Place Output Formats](https://nominatim.org/release-docs/develop/api/Output/) for details on each format."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "json_callback",
+ "description": "Wrap JSON output in a callback function (JSONP) i.e. (). Only has an effect for JSON output formats."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0,
+ "default": 1
+ },
+ "in": "query",
+ "name": "addressdetails",
+ "description": "Include a breakdown of the address into elements."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "extratags",
+ "description": "Include additional information in the result if available, e.g. wikipedia link, opening hours."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "namedetails",
+ "description": "Include a list of alternative names in the results. These may include language variants, references, operator and brand."
+ },
+ {
+ "schema": {
+ "type": "string"
+ },
+ "in": "query",
+ "name": "accept-language",
+ "description": "Preferred language order for showing search results, overrides the value specified in the [Accept-Language HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). Either use a standard RFC2616 accept-language string or a simple comma-separated list of language codes."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "polygon_geojson",
+ "description": "Output geometry of results as a GeoJSON."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "polygon_kml",
+ "description": "Output geometry of results as a KML."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "polygon_svg",
+ "description": "Output geometry of results as a SVG."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "polygon_text",
+ "description": "Output geometry of results as a WKT."
+ },
+ {
+ "schema": {
+ "type": "number",
+ "minimum": 0.0
+ },
+ "in": "query",
+ "name": "polygon_threshold",
+ "description": "Return a simplified version of the output geometry. The parameter is the tolerance in degrees with which the geometry may differ from the original geometry. Topology is preserved in the result."
+ },
+ {
+ "schema": {
+ "type": "string",
+ "format": "email"
+ },
+ "in": "query",
+ "name": "email",
+ "description": "If you are making large numbers of request please include an appropriate email address to identify your requests. See Nominatim's [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details."
+ },
+ {
+ "schema": {
+ "type": "integer",
+ "maximum": 1,
+ "minimum": 0
+ },
+ "in": "query",
+ "name": "debug",
+ "description": "Output assorted developer debug information. Data on internals of Nominatim's Search Loop logic, and SQL queries. The output is (rough) HTML format. This overrides the specified machine readable format."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OSMGeocodeJson"
+ }
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Lookup"
+ ]
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "OSMGeocodeJson": {
+ "allOf": [
+ {
+ "$ref": "https://jenkin.dev/json-schema-bricks/geocodejson.schema.min.json"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "features": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "properties": {
+ "type": "object",
+ "properties": {
+ "geocoding": {
+ "type": "object",
+ "properties": {
+ "osm_type": {
+ "type": "string",
+ "examples": [
+ "node",
+ "way",
+ "relation"
+ ]
+ },
+ "osm_id": {
+ "type": "integer"
+ },
+ "osm_key": {
+ "type": "string",
+ "examples": [
+ "boundary",
+ "highway",
+ "amenity"
+ ]
+ },
+ "osm_value": {
+ "type": "string",
+ "examples": [
+ "residential",
+ "restaurant"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file