Dagsmart

.

Dagsmart API

The Dagsmart API allows you to programmatically access lists of Swedish holidays, half-days (halvdagar) and bridge days (klämdagar) in JSON format.

The data provided through the API is equivalent to what is presented on the website https://dagsmart.se and we recommend you to read through the facts page (only in Swedish, sorry!) with definitions of the days included.

The API is free to use, subject to the rate limitations described below.

Rate Limit

The Dagsmart API currently uses the following rate limit to reduce the amount of incoming traffic to our servers and ensure maximum availability for as many users as possible.

  • Maximum 5 requests from a single IP address every 10 seconds.

Sending too many requests will show an HTTP error with status code 429 and additional requests will be blocked for 10 seconds.

Base URL

The base URL for all API requests is:

https://api.dagsmart.se

Endpoint: Holidays

GET /holidays

Returns a list of all holidays for a given year.

Parameters

  • year (optional) The year for which to present holidays provided in yyyy format, e.g. “2023”. Defaults to current year.
  • weekends (optional) Boolean flag to indicate whether the result should include saturdays and sundays as holidays. Defaults to false.

Response

Returns a JSON array with the following properties:

  • date The date for which there is a holiday.
  • code A unique textual code identifying the holiday.
  • name A JSON object with the following properties:
    • en The common English name for the holiday.
    • sv The common Swedish name for the holiday.

Example

GET /holidays?year=2023&weekends=false
[
  {
    "date": "2024-01-01",
    "code": "newYearsDay",
    "name": {
      "en": "New Year's Day",
      "sv": "nyårsdagen"
    }
  },
  {
    "date": "2024-01-06",
    "code": "epiphany",
    "name": {
      "en": "Epiphany",
      "sv": "trettondedag jul"
    }
  },
  {
    "date": "2024-03-29",
    "code": "goodFriday",
    "name": {
      "en": "Good Friday",
      "sv": "långfredagen"
    }
  },

  // ...
]

Endpoint: Bridge days (klämdagar)

GET /bridge-days

Returns a list of all bridge-days (klämdagar) for a given year.

Parameters

  • year (optional) The year for which to present bridge-days provided in yyyy format, e.g. “2023”. Defaults to current year.

Response

Returns a JSON array with the following properties:

  • date The date for which there is a bridge-day.

Example

GET /bridge-days?year=2023
[
  { "date": "2023-05-19" },
  { "date": "2023-06-05" }
]

Endpoint: Half-days (halvdagar)

GET /half-days

Returns a list of all half-days (halvdagar) for a given year.

Parameters

  • year (optional) The year for which to present half-days provided in yyyy format, e.g. “2023”. Defaults to current year.

Response

Returns a JSON array with the following properties:

  • date The date for which there is a half-day.

Example

GET /half-days?year=2023
[
  { "date": "2023-01-05" },
  { "date": "2023-04-06" },
  { "date": "2023-05-17" },
  { "date": "2023-11-03" }
]

Changelog

2024-07-26

Added code and name properties to the /holidays endpoint.

2023-09-18

First official version of the Dagsmart API is released.