UNCLASSIFIED

DEVELOPER DOCUMENTATION

The Nominatim search service can be used to search for map features by name. The search API is available at the following URL:

https://osm-nominatim.gs.mil/search?q=<query>[&<params>]

where <query> is the name to search for, and <params> specifies that parameters of the search. The possible parameters are:

Parameter Description
format=[html|xml|json|jsonv2] Output format
json_callback=<string> Wrap json output in a callback function (JSONP) i.e. <string>(<json>)
accept-language=<browser language string> Preferred language order for showing search results, overrides the value specified in the "Accept-Language" HTTP header. Either uses standard RFC 2616 accept-language string or a simple comma separated list of language codes.
q=<query> Query string to search for
countrycodes=<countrycode>[,<countrycode>][,<countrycode>]... Limit search results to a specific country (or a list of countries). <countrycode> should be the ISO 3166-1alpha2 code, e.g. gb for the United Kingdom, de for Germany, etc.
viewbox=<x1>,<y1>,<x2>,<y2> The preferred area to find search results. Any two corner points of the box are accepted in any order as long as they span a real box.
bounded=[0|1] Restrict the results to only items contained with the viewbox (see above). Restricting the results to the bounding box also enables searching by amenity only. For example a search query of just "[pub]" would normally be rejected but with bounded=1 will result in a list of items matching within the bounding box.
addressdetails=[0|1] Include a breakdown of the address into elements
exclude_place_ids=<place_id,[place_id],[place_id]> If you do not want certain openstreetmap objects to appear in the search result, give a comma separated list of the place_id's you want to skip. This can be used to broaden 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)
limit=<integer> Limit the number of returned results. Default is 10.
dedupe=[0|1] Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split in many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return one match; this is controlled by the dedupe parameter which defaults to 1. Since the limit is, for reasons of efficiency, enforced before and not after de-duplicating, it is possible that de-duplicating leaves you with less results than requested.
polygon_geojson=1 Output geometry of results in GeoJSON format.
polygon_kml=1 Output geometry of results in KML format.
polygon_svg=1 Output geometry of results in SVG format.
polygon_text=1 Output geometry of results as Well Known Text (WKT).
extratags=1 Include additional information in the result if available, e.g. Wikipedia link, opening hours.
namedetails=1 Include a list of alternative names in the results. These may include language variants, references, operator and brand.

An example query that finds features with the name "Timbuktu" and returns the results as a JSON document would look like:

https://osm-nominatim.gs.mil/search?q=Timbuktu&format=jsonv2

To perform the same search, but also include the geometry of each result in GeoJSON format, the query would look like:

https://osm-nominatim.gs.mil/search?q=Timbuktu&format=jsonv2&polygon_geojson=1

DIDN'T FIND WHAT YOU WERE LOOKING FOR?

UNCLASSIFIED