Get started

    API Endpoint

        https://lunchaimjardevi.com/api/v4/                

The Luncha I Mjärdevi API can be used to get the raw data of what food is being served in Mjärdevi today. It is provided as is with no guarantee that it will always be up to date.

If you use the API for anything a link would be very much appriciated but is not required, I would also love to hear about it!

Those interested in helping out with adding more restaurants or improving the scrapers you can do so at GitHub

For any questions or suggestions you can contact me at luncha@ptjwebben.se

API Key

You will need a key to use this API. There are no automatic limitations to the key but use your good judgement. If a key is causing problems I will temporarily ban it and contact the owner so we can resolve the issue, this is the only time the email will be used.

get restaurants


# Here is a curl example
curl \
-X GET https://lunchaimjardevi.com/api/v4/getRestaurants?key=APIKEY
                

To get a list of restaurants you need to make a GET/POST call to the following url :
https://lunchaimjardevi.com/api/v4/getRestaurants



Result example :

{
	"error": "none",
	"restaurants": [{
		"id": "1",
		"name": "Br\u00f6dernas K\u00f6k",
		"shortName": "brodernas",
		"isFoodtruck": false,
		"website": "https:\/\/www.brodernaskok.se\/meny",
		"lastUpdate": "1657572107",
		"coordLat": "58.39423",
		"coordLong": "15.55948",
		"parserNeedsUpdate": "0",
		"static": true,
		"note": ""
	}, {
		"id": "2",
		"name": "Chili & Lime",
		"shortName": "chili",
		"isFoodtruck": false,
		"website": "http:\/\/chili-lime.se\/",
		"lastUpdate": "1657577104",
		"coordLat": "58.39423",
		"coordLong": "15.55948",
		"parserNeedsUpdate": "0",
		"static": false,
		"note": "Semesterst\u00e4ngt vecka 28 - 31"
	}, {
		"id": "4",
		"name": "Husman",
		"shortName": "husman",
		"isFoodtruck": false,
		"website": "https:\/\/restauranghusman.se\/",
		"lastUpdate": "1657577105",
		"coordLat": "58.394943",
		"coordLong": "15.561091",
		"parserNeedsUpdate": "0",
		"static": false,
		"note": "Semesterst\u00e4ngt vecka 28 - 31"
	}, {
		"id": "19",
		"name": "Sukaldari",
		"shortName": "sukaldari",
		"isFoodtruck": true,
		"website": "https:\/\/www.facebook.com\/Sukaldari.se\/",
		"lastUpdate": "1657572107",
		"coordLat": "58.394139260932896",
		"coordLong": "15.556225412015065",
		"parserNeedsUpdate": "0",
		"static": true,
		"note": "Semesterst\u00e4ngt. Tillbaka i Augusti"
	}]
}
                

QUERY PARAMETERS

Field Type Required Description
key string yes See API Key
showOutsideMjardevi boolean no Include the restaurants outside Mjardevi that Luncha supports

RESPONSE

See example to the right for a full response. Below you can see a description about the restaurant objects that are returned in the response

Field Type Description
id integer The restaurants id on Luncha
name String The restaurants name
shortName String An alternative to id that is easier to remember
isFoodtruck boolean true if the restaurant is a foodtruck
website String Link to the restaurants website
lastUpdate integer When was the restaurants menu last updated, provided in Unixtime
coorLat String Latitude coordinate
coorLong String Longitude coordinate
parserNeedsUpdate integer If this is 1 dev is working on a new parser
static boolean If this true at least one item on the menu is static in the Luncha database and will not be automatically updated. The menu can be a mix of auto updated and static items
note String This is a note about the restaurant left by the Luncha dev
location String What location category is the restaurant in, for example Mjärdevi, Tornby, LiU etc

get restarurant info


# Here is a curl example
curl \
-X GET https://lunchaimjardevi.com/api/v4/getRestaurantInfo?id=1&key=APIKEY
                

https://lunchaimjardevi.com/api/v4/getRestaurantInfo



Result example :

{
    "error": "none",
    "info": {
        "id": "1",
        "name": "Brödernas Kök",
        "shortName": "brodernas",
        "isFoodtruck": false,
        "website": "https://www.brodernaskok.se/meny",
        "facebook": "https://www.facebook.com/BrodernasKokMjardevi",
        "lastUpdate": "1695470558",
        "coordLat": "58.39423",
        "coordLong": "15.55948",
        "static": false,
        "note": ""
    }
}
                

QUERY PARAMETERS

Field Type Required Description
id integer yes* The id of the restaurant, you can get it by calling getRestaurants
shortName String yes* The shortName of the restaurant
key string yes See API Key

* You must use either id or shortName. If both are included only id will be used

RESPONSE

See example to the right for a full response. Below you can see a description about the info object that is returned in the response

Field Type Description
id integer The restaurants id on Luncha
name String Name of the restaurant
shortName String An alternative to id that is easier to remember
isFoodtruck boolean true if the restaurant is a foodtruck
website string Link to the restaurants website
facebook string Link to the restaurants facebook page
lastUpdate integer When was the restaurants menu last updated, provided in Unixtime
coordLat string Latitude coordinate
coordLong string Laongitude coordinate
static boolean If this true at least one item on the menu is static in the Luncha database and will not be automatically updated. The menu can be a mix of auto updated and static items
note boolean This is a note about the restaurant left by the Luncha dev
location String What location category is the restaurant in, for example Mjärdevi, Tornby, LiU etc

get menu


# Here is a curl example
curl \
-X GET https://lunchaimjardevi.com/api/v4/getMenu?id=2&key=APIKEY
                

https://lunchaimjardevi.com/api/v4/getMenu



Result example :

{
	"error": "none",
	"name": "Pegs & Tails",
	"menuItems": [{
		"title": "Fransk kycklinggryta",
		"description": "Kycklinggryta serveras med potatispur\u00e9",
		"static": false
	}, {
		"title": "Pytt Bellman",
		"description": "Gr\u00e4ddstuvad pyttipanna serveras med \u00e4ggula, saltgurka & r\u00f6dbeta",
		"static": false
	}, {
		"title": "Laxpudding",
		"description": "Laxpudding serveras med skirat sm\u00f6r, dillkr\u00e4m & citron",
		"static": false
	}, {
		"title": "Bakad blomk\u00e5l",
		"description": "Bakad blomk\u00e5l serveras med rostad s\u00f6tpotatis & pumpakr\u00e4m",
		"static": false
	}]
}
                

QUERY PARAMETERS

Field Type Required Description
id integer yes* The id of the restaurant, you can get it by calling getRestaurants
shortName String yes* The shortName of the restaurant
key string yes See API Key

* You must use either id or shortName. If both are included only id will be used

RESPONSE

See example to the right for a full response. Below you can see a description about the menuitem objects that are returned in the response

Field Type Description
name String Name of the food item
description String How the restaurant has described the item
static boolean If this item is static in the Luncha database or not

validate key


# Here is a curl example
curl \
-X GET https://lunchaimjardevi.com/api/v4/validateKey?key=APIKEY
                

https://lunchaimjardevi.com/api/v4/validateKey



Result example :

{
    "valid": true
}
                

QUERY PARAMETERS

Field Type Required Description
key string yes See API Key

RESPONSE

See example to the right for a full response.

Field Type Description
valid boolean Returns true if the api key is valid

Errors

The API uses the following error codes:

Error Code Meaning
none There was no error
invalidId No restaurant with the specified ID exist
needsNewParser The website has been updated so the automatic parser no longer works. If you get this error I am aware that it has broken and will fix it as soon as possible
noMenuForTodayYet This is a generic error that can have multiple reasons.
Luncha I Mjärdevi will try to get the menu once every hour between 00 and 13 on weekdays.
The error can happen for the following reasons:
  • The restaurant is closed today
  • The restaurants website has not been updated with todays menu yet
  • The design of the restaurants website has been updated so it needs a new parser and I have not marked it as such yet