X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ecd5a3fdf9acd355b77af1b05781450a2df31b5e..6e5f595d48be5745dfd9b8d902ccb9a0a4a80601:/docs/api/Status.md diff --git a/docs/api/Status.md b/docs/api/Status.md index 51581b8a..a34c86c1 100644 --- a/docs/api/Status.md +++ b/docs/api/Status.md @@ -1,35 +1,50 @@ # Status -Useful for checking if the service and database is running. The JSON output also shows +Report on the state of the service and database. Useful for checking if the +service is up and running. The JSON output also reports when the database was last updated. +## Endpoint + +The status API has the following format: + +``` +https://nominatim.openstreetmap.org/status +``` + +!!! danger "Deprecation warning" + The API can also be used with the URL + `https://nominatim.openstreetmap.org/status.php`. This is now deprecated + and will be removed in future versions. + + ## Parameters -* `format=[text|json]` (defaults to 'text') +The status endpoint takes a single optional parameter: + +| Parameter | Value | Default | +|-----------| ----- | ------- | +| format | one of: `text`, `json` | 'text' | + +Selects the output format. See below. ## Output #### Text format -``` - https://nominatim.openstreetmap.org/status.php -``` - -will return HTTP status code 200 and print `OK`. +When everything is okay, a status code 200 is returned and a simple message: `OK` -On error it will return HTTP status code 500 and print a message, e.g. +On error it will return HTTP status code 500 and print a detailed error message, e.g. `ERROR: Database connection failed`. #### JSON format -``` - https://nominatim.openstreetmap.org/status.php?format=json -``` +Always returns a HTTP code 200, when the status call could be executed. -will return HTTP code 200 and a structure +On success a JSON dictionary with the following structure is returned: ```json { @@ -45,8 +60,8 @@ The `software_version` field contains the version of Nominatim used to serve the API. The `database_version` field contains the version of the data format in the database. -On error will also return HTTP status code 200 and a structure with error -code and message, e.g. +On error will return a shorter JSON dictionary with the error message +and status only, e.g. ```json { @@ -54,14 +69,3 @@ code and message, e.g. "message": "Database connection failed" } ``` - -Possible status codes are - - | | message | notes | - |------------------|----------------------|---------------------------------------------------| - | 700 | "No database" | connection failed | - | 701 | "Module failed" | database could not load nominatim.so | - | 702 | "Module call failed" | nominatim.so loaded but calling a function failed | - | 70 | "Query failed" | test query against a database table failed | - | 704 | "No value" | test query worked but returned no results | - | 705 | "Import date is not available" | No import dates were returned (enabling replication can fix this) |