Web Services API

OpenPOIs has two APIs available for use. It implements the industry standard Web Feature Service API for geographic data query, and also has its own custom API.

Custom API

Request base URL

http://openpois.net/poiquery.php?

Parameters

parameter type description
id UUID globally unique id of the POI
if present, all other parameters (except format) are ignored
format string
MIME type of the return value
options: text/html, geojson, application/json or application/xml
default: text/html
name string primary name/label of the POI
required if id is not present
bbox comma-separated decimals geographic bounding box in EPSG:4326 (lat/lon)
format: left,lower,right,upper
if present, lat/lon/radius are ignored
lat decimal latitude
required for lat/lon/radius search
lon decimal longitude
required for lat/lon/radius search
radius decimal search distance from lat/lon in meters
used only for lat/lon/radius search
default: 50
start date POI came into existence after this date (POIs with no start date are included)
ex: 2011-10-01
end date POI ended existence before this date (POIs with no end date are included)
ex: 2012-05-01
maxfeatures integer maximum number of POIs to return
default: 25 (maximum allowed is 25 also)

Query Examples

ID

http://openpois.net/poiquery.php?id=a75da8b9-5e85-46f2-9546-35c87ef0dda3&format=application/json

RESTful ID

http://openpois.net/pois/a75da8b9-5e85-46f2-9546-35c87ef0dda3

http://openpois.net/pois/a75da8b9-5e85-46f2-9546-35c87ef0dda3.geojson

http://openpois.net/pois/a75da8b9-5e85-46f2-9546-35c87ef0dda3.json

http://openpois.net/pois/a75da8b9-5e85-46f2-9546-35c87ef0dda3.xml

http://openpois.net/pois/a75da8b9-5e85-46f2-9546-35c87ef0dda3.rdf (in Pelagios Gazetteer Interconnection format)

Radius and point

http://openpois.net/poiquery.php?lat=42.349433712876&lon=-71.040894451933&maxfeatures=9&format=application/xml

Bounding box

http://openpois.net/poiquery.php?bbox=-71.10,42.35,-71.00,42.45&maxfeatures=20&format=application/json

Time and area

http://openpois.net/poiquery.php?lat=25.959&lon=119.519&maxfeatures=1&format=xml&radius=1000&start=944


OGC Web Feature Service (WFS) API

OpenPOIs implements the the OGC WFS standard using Mapserver's implementation. WFS is a full-featured API with many more options than are shown here, but here are some examples on how to use it. For more information, see the spec or Mapserver's documentation.

NOTE: Due to the complex nature of the POI schema, the WFS API only recognizes a few fields of a POI -- the POI's ID, primary label and geographic coordinates. Until more work is done to expand the capabilities of the WFS API, use the custom API above to get all the POI data, or use the WFS API, and then take the POI ID contained in WFS responses to query against the custom API when you need full POI data.

GetCapabilities

http://openpois.net/openpoiwfs?request=GetCapabilities&service=WFS&version=1.1.0

DescribeFeatureType (see the GML schema)

http://openpois.net/openpoiwfs?request=DescribeFeatureType&service=WFS&version=1.1.0&typename=minipoi

Get a single POI by ID

http://openpois.net/openpois.net/openpoiwfs?request=GetFeature&service=WFS&version=1.1.0&typename=minipoi&featureid=minipoi.a75da8b9-5e85-46f2-9546-35c87ef0dda3

Get a group of POIs by bounding box

http://openpois.net/openpoiwfs?request=GetFeature&service=WFS&version=1.1.0&typename=minipoi&bbox=-71.05,42.40,-71.00,42.45&srsname=epsg:4326