Canteens¶
The Canteens API allows to query for all canteens or a geographical filtered subset. Canteens are supposed to not change very often and should be cached locally.
List canteens¶
List all canteens:
Parameters¶
near[lat],near[lng]-
(Optional) Set of coordinates to search for canteens near the given location. Both coordinates must be specified and be valid floating point numbers.
Example:
near[dist]-
(Optional) Distance in kilometers to search near given coordinates. Requires latitude and longitude to be specified too. Defaults to 10 kilometers. Example:
ids- (Optional) List of comma-separated canteen IDs that should be returned.
hasCoordinates- (Optional) Restrict returned canteens to ones with coordinated specified (
true) or not (false).
Response¶
HTTP/2.0 200 Ok
Link: <https://openmensa.org/api/v2/canteens?page=2>; rel="next",
<https://openmensa.org/api/v2/canteens?page=5>; rel="last"
Content-Type: application/json; charset=utf-8
[
{
"id": 1,
"name": "Mensa UniCampus Magdeburg",
"city": "Magdeburg",
"address": "Pfälzer Str. 1, 39106 Magdeburg",
"coordinates": null
},
{
"id": 104,
"name": "Bistro Tasty Studio Babelsberg",
"city": "Potsdam",
"address": "August-Bebel-Str. 26-53, 14482 Potsdam, Deutschland",
"coordinates": [
52.3877669669544,
13.1209909915924
]
}
]
Get a single canteen¶
Response¶
GET /api/v2/canteens/1
HTTP/2.0 200 Ok
Content-Type: application/json; charset=utf-8
{
"id": 1,
"name": "Mensa UniCampus Magdeburg",
"city": "Magdeburg",
"address": "Pfälzer Str. 1, 39106 Magdeburg",
"coordinates": [
52.139618827301895,
11.647599935531616
]
}
idint- Unique numerical identifier in the API and database
name- The canteens name
address- Human readable real-world locator (vulgo street address)
coordinates[int, int]- (Optional) List of latitude and longitude in north-eastern direction. Negative values imply southern or western hemisphere. Can be
nullif no coordinates were given, or they are unknown.