API Documentation

Model

Info Get

Returns the model information for the specified model id.

GET /api/info/<int:modelid>
GET /api/info/<int:modelid>/<int:revision>

Sample (prettified) Response:

{
	"id": 423,
	"title": "Eiffel Tower",
	"lat": 48.8583,
	"lon": 2.2945,
	"desc": "A model of the world famous Eiffel Tower",
	"tags": {
		"shape": "pyramidal",
		"building": "yes",
		"tourism": "attraction",
	}
	"author": "22633299",
	"date": "2017-03-28",
	"categories": ["monuments", "tall"]
	]
}

Model Get

Returns a glb model corresponding to the specified model id.

GET /api/model/<int:modelid>
GET /api/model/<int:modelid>/<int:revision>

Sample Response: a gltf-binary file.

Lookups

Tag Lookup

Returns model ids that have the specified tag as one of their tags.

GET /api/tag/<string:tag>
GET /api/tag/<string:tag>/<int:pageid>

Sample Response:

[3, 5]

Category Lookup

Returns model ids that have the specified category as one of their categories.

GET /api/category/<string:tag>
GET /api/category/<string:tag>/<int:pageid>

Sample Response:

[6, 8]

Author Lookup

Returns model ids that have the specified author as one of their categories. Here uid refers to the OSM user id.

GET /api/author/<string:uid>
GET /api/author/<string:uid>/<int:pageid>

Sample Response:

[6, 8]

Searches

Title Search

Returns model ids that contain the specified string in their title.

GET /api/search/title/<string:title>
GET /api/search/title/<string:title>/<int:pageid>

Sample Response:

[2, 10, 17]

Latitude and Longitude Search

Returns model ids that have the specified category as one of their categories.

GET /api/search/<float:lat>/<float:lon>/<float:range>
GET /api/search/<float:lat>/<float:lon>/<float:range>/<int:pageid>

Sample Response:

[2, 10, 17]

Full Search

Permits combining various criteria to find the exact kinds of models we need. Search query is sent in the request body. If any parameter is not specified, it's ignored and won't be filtered from the results.

Notes:

  • The "lat", "lon" and "range" attributes do what is described in the Latitude and Longitude Search endpoint.
  • The "title" attribute does what is described in the Title Search endpoint.
  • The "tags" attribute finds models that match all tags.
  • The "categories" attribute finds models that match all categories.
  • The "author" attribute does what is described in the Author Lookup endpoint.
  • Only models that match all attributes are returned
  • The "format" attribute allows you to retrieve more than the model id, allowing quick access to the location and title of many models around a point, for example.
POST /api/search/full

Live request body (try pressing Submit!):


Response:

(None yet)

Sample request body:

{
"lat": 48.8583,
"lon": 2.2945,
"range": 1000,
"title": "Eiffel",
"tags": {
"shape": "pyramidal",
"building": "yes"
},
"categories": [
"monuments",
"tall"
],
"page": 1,
"author": "22633299"
}

Sample Response:

[6, 8]

Sample request body with format attribute:

{
"lat": 48.8583,
"lon": 2.2945,
"range": 1000,
"format": ["id", "latitude", "longitude", "title"]
}

Sample Response:

[[1, 48.8583, 2.2945, "Eiffel Tower"], [64, 48.85831, 2.2945, "Near Eiffel Tower"]]