]> git.openstreetmap.org Git - nominatim.git/blob - docs/api/Status.md
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / docs / api / Status.md
1 # Status
2
3 Useful for checking if the service and database is running. The JSON output also shows
4 when the database was last updated.
5
6 ## Parameters
7
8 * `format=[text|json]` (defaults to 'text')
9
10
11 ## Output
12
13 #### Text format
14
15 ```
16    https://nominatim.openstreetmap.org/status.php
17 ```
18
19 will return HTTP status code 200 and print `OK`.
20
21 On error it will return HTTP status code 500 and print a message, e.g.
22 `ERROR: Database connection failed`.
23
24
25
26 #### JSON format
27
28 ```
29    https://nominatim.openstreetmap.org/status.php?format=json
30 ```
31
32 will return HTTP code 200 and a structure
33
34 ```json
35   {
36       "status": 0,
37       "message": "OK",
38       "data_updated": "2020-05-04T14:47:00+00:00",
39       "software_version": "3.6.0-0",
40       "database_version": "3.6.0-0"
41   }
42 ```
43
44 The `software_version` field contains the version of Nominatim used to serve
45 the API. The `database_version` field contains the version of the data format
46 in the database.
47
48 On error will also return HTTP status code 200 and a structure with error
49 code and message, e.g.
50
51 ```json
52    {
53        "status": 700,
54        "message": "Database connection failed"
55    }
56 ```
57
58 Possible status codes are
59
60    |     | message              | notes                                             |
61    |-----|----------------------|---------------------------------------------------|
62    | 700 | "No database"        | connection failed                                 |
63    | 701 | "Module failed"      | database could not load nominatim.so              |
64    | 702 | "Module call failed" | nominatim.so loaded but calling a function failed |
65    | 703 | "Query failed"       | test query against a database table failed        |
66    | 704 | "No value"           | test query worked but returned no results         |