Lounasaika.net API V1 BETA
(updated 2012-12-05)

Audience

This document is intended for website and mobile developers who want to use student restaurant menu data provided by Lounasaika.net API. It provides an introduction to using this API. Any feedback will be greatly appreciated.

Please note that you are strongly encouraged to register your app by sending an email to api@lounasaika.net.

Availability

The service is hosted by Github Pages which ensures excellent availability.

Requests

Lounasaika.net API supports one request which provides all restaurant menus for current week:

http://www.lounasaika.net/api/v1/menus.json

The JSON returned by this request is shown below. Note that actual JSON may contain less whitespace. You should not make assumptions about the amount or format of whitespace between requests.

The example contains two restaurants, Teekkariravintolat and TUAS-talo, which are both located on the same campus, Otaniemi. Opening times are fixed form and nicely parsable. URL's for available languages are listed under 'url' element. Under 'meals' element you can find menus in all available languages (currently Finnish and English).

[
  {
    "name": "Teekkariravintolat",
    "address": "Otakaari 24, Espoo",
    "campus": "Otaniemi",
    "open": "Mon-Thu 10:30-16:00, Fri 10:30-15:00, Sat 11:30-15:00",
    "url": {
      "fi": "http://www.sodexo.fi/dipoli"
    },
    "location": {
      "lat": 60.1847778,
      "lng": 24.8309887
    },
    "meals": {
      "fi": [
        [
          "Maanantain broileripuikot",
          "Maanantain mozzarellasalaatti"
        ],
        [
          "Tiistain leike",
          "Tiistain keitto"
        ],
        [
          "Keskiviikon spaghetti"
        ],
        [
          "Torstailohi"
        ],
        [
          "Perjantain curry"
        ],
        [
          "Lauantainakit"
        ]
      ],
      "en": [
        [
          "Monday chicken sticks",
          "Monday mozzarella salad"
        ],
        [
          "Tuesday schnitzel",
          "Tuesday soup"
        ],
        [
          "Spaghetti à la Wednesday"
        ],
        [
          "Thursday salmon"
        ],
        [
          "Curry of Friday"
        ],
        [
          "Saturday sausages"
        ]
      ]
    }
  },
  {
    "name": "TUAS-talo",
    "address": "Otaniementie 17, Espoo",
    "campus": "Otaniemi",
    "open": "Mon-Thu 10:30-16:00, Fri 10:30-14:00",
    "url": {
      "fi": "http://www.amica.fi/TUAS",
      "en": "http://www.amica.fi/en/TUAS"
    },
    "location": {
      "lat": 60.1868196,
      "lng": 24.8187598
    },
    "meals": {
      "fi": [],
      "en": []
    }
  }
]

Note that these results generally need to be parsed if you wish to extract values from the results. Parsing JSON is relatively easy. See Parsing JSON for some recommended design patterns.