How to use the City of Stockholm Open API

Postad av: Johannes Söderlund,

This post will briefly describe how developers can get information from the City of Stockholm’s Open API.


All City Services is presented on the City of Stockholm’s website in an e-service called Compare Services.
Here you can find pre-schools, schools, home-services, nursing homes and such.

Each service unit has the following information:

Presentation page on for a pre-school.


You can also retrieve data on public places in the City of Stockholm in a similar way.

The addresses for the API’s are:

How to use the API

  1. Data is retrieved via HTTP / GET and the format is XML or JSON.
  2. To retrieve data the API requires an API key. Create your key on
  3. Api-key / authentication
    For every HTTP / GET request use the parameter ‘apikey’ plus value.An “endpoint” is the last directory name before the last and final ”/”.Example:
    / Service Guide Service /
    Anything after the ”endpoint” is regarded as an ”identifier”.Examples with parameter:
  4. Listing / Segmentation
    Data can be accessed in different ways. Based on the results you can see how to further segment the results.

    The following method lists all possible liststings (aka ”starting endpoint”):

    This provides (among other things):
    <List uri=”ServiceUnits”/>
    <List uri=”ServiceUnitTypes”/>
    <List uri=”ServiceUnitTypeGroups”/>
    <List uri=”GeographicalAreas”/>
    <List uri=”Files”/>

    The url above will render the following result:
    <ServiceUnitTypeInfo id=”9911eb71-854b-4033-9f90-00ab2a72d739″singularName=”Personlig assistans”/>
    <ServiceUnitTypeInfo id=”a4116a6a-af53-4672-b492-01d7adeae987″singularName=”Motionssp?r”/>
    <ServiceUnitTypeInfo id=”fd27590d-11ad-4811-9327-13e5a9fe9794″singularName=”Konsthall”/>
    <ServiceUnitTypeInfo id=”3a8dadd5-e10c-415c-8b37-1a25729afffa”singularName=”Familjedaghem”/>
    <ServiceUnitTypeInfo id=”930b3308-43e9-471f-b8f4-2bf4f135e30d”singularName=”Ledsagning”/>
    <ServiceUnitTypeInfo id=”c72b4fcc-3f50-4dc4-aac3-303c6797d430″singularName=”Hemtj?nst”/>
    <ServiceUnitTypeInfo id=”f1f37ab7-8f65-40fe-97cb-31676d1bab34″singularName=”Servicebostad”/>
    <ServiceUnitTypeInfo id=”4effe8e3-ef54-4f43-8d50-372a4495d435″singularName=”Servicehus”/>
    <!– more rows –>
    <ServiceUnitTypeInfo id=”fcc0db7f-065e-43f9-94f0-fb7c4467ffde”singularName=”Vinterfotbollsplan”/>
    <ServiceUnitTypeInfo id=”ac4854fb-fba3-4d01-83ce-ff7992310846″singularName=”?tervinningscentral”/>

    Further information on types of services
    The service type ”Swimming” where the id attribute is used as identifier in the endpoint /Service unit types / ‘.

    <ServiceUnitTypeGroupInfo name=”Idrott/Motion”/>
    <List uri=”ServiceUnits”/>

    With the example above you can scroll through the entire database.

  5. Searching
    Method aka ”endpoint” using QueryString ”name” is ”ServiceUnits”
    and can be used to search among services.


  6. Format
    The default format is XML. JSON is supplied by adding the ”json” as a further identifier.


Kategori: eGovernment

1 kommentar

  1. Hi,
    I developed an Android application using the city of Helsinki REST api; today I saw Stockholm offers a similar api, so it could be really simple for me to release a similar application based on the city of Stockholm api (the name will be Go Stockholm).
    Could you please tell me which is the best way to make a general search?
    Due to language difficulties (you seem to provide info only in Swedish), I can’t understand which is the best way to query the database.
    So far I’m able to retrieve ‘museum’ like:

    but if I want to retrieve ‘sjukhus’ (hospital) in a similar manner:

    I obtain only 4 items with that word (searching for that word in the page), which is way too few.
    Could you please provide me a general example of a search by word, for instance ‘museum’, ‘metro’ or ‘hospital’?
    I’d be thankful.
    Kind regards,
    Alessio Salvadorini


E-postadressen publiceras inte. Obligatoriska fält är märkta *

Subscribe to comments