PastPlace Gazetteer Search API
If you were expecting search results rather than this page, you
mis-specified the parameters. The options are:
- q: The query string. This can be a place name, a place
id, or a coordinate pair. In the latter case, you either use the
parameter twice (i.e. search?q=lon&q=lat), or you use a
comma to separate them (i.e. search?q=lon,lat). Please
note that in either case you need to specify first the longitude and
then latitude (both in WGS84, decimal degree).
- container: If you search by place name, you can
specify a container (such as county name, etc.).
- mode: Specify either "fuzzy" (default) or
"precise" when you search by place name to search for name
variants or exact place name, respectively.
- type: Specify either "place" (default) or
"unit" to query for a place or administrative unit by name
or ID (name search not implemented yet for units), respectively.
- verbose: Specify either "true" (default) or
"false" when searching for a place to return detailed
search results (including gazetteer text, nearby places and contained
units) or concise search results, respectively.
- format: Specify "xml" to receive the search
result as XML data (default), "html" to have the search
result printed as a HTML table, "rdf" to receive the result
as RDF/XML, "n3" to receive N3/Turtle data, or
"json" to have a JSON data array returned.
- json_callback: Specifies a JSON callback function
name. If you specified to have your result returned as JSON, the
parameter value will be wrapped around it.
Examples
- http://data.pastplace.org/search?q=portsmouth&format=xml&mode=precise
— queries the place name "portsmouth" and returns the
result as XML data.
- http://data.pastplace.org/search?q=portsmouth&format=xml&mode=precise&container=hampshire
— queries the place name "portsmouth" in the
container named "hampshire" and returns the result as XML
data.
- http://data.pastplace.org/search?q=portsmouth&format=xml&container=hampshire
— queries the place name "portsmouth" and name
variants in the container named "hampshire" and returns the
result as XML data.
- http://data.pastplace.org/search?q=portsmouth&format=json&json_callback=my_callback_func
— queries the place name "portsmouth" and name
variants and returns the result as JSON data array, using
"my_callback_func" as call back, i.e. the returned value is
my_callback_func(JSON data)
.
- http://data.pastplace.org/search?q=-1.7,50.8 —
queries for the nearest 20 places for the specified coordinates
(longitude=-1.7, latitude=50.8) and sends you to the HTML result
page.
- http://data.pastplace.org/search?q=-1.7&q=50.8&format=html
— same as the above, but with q specified twice.
- http://data.pastplace.org/search?q=429&format=xml
— queries the place ID "429" and returns the result
as XML data.
- http://data.pastplace.org/search?q=10200246&type=unit&format=xml
— queries the unit ID "10200246" and returns the
result as XML data.