UK Bank Holiday Lookup Data Connector

The UK Bank Holiday Lookup Data Connector provides access to the official Bank Holiday Dataset published by the UK government. This Data Connector can be used to retrieve bank holiday names, dates and other details for several years. No authentication is required for this API.

Constructor

UKBankHolidayLookup() → {object}

A UK Bank Holiday Lookup Data Connector is available at connectors.verjio.ukbankholidays.

You may also use this constructor to create a new UK Bank Holiday Lookup Data Connector.

Returns:
object

The UK Bank Holiday Lookup Data Connector.

Functions

getAll() → {object}

Retrieves all available bank holidays for England and Wales, Scotland and Northern Ireland.

Returns:
object

Object with bank holiday details.

Example:
var bankHolidays = connectors.verjio.ukbankholidays.getAll()

bankHolidays.events.forEach(event => {
  tables.bankHolidays.insertRow();
  tables.bankHolidays.name.value = event.title;
  tables.bankHolidays.date.value = event.date;
});

getNext(regionopt) → (nullable) {object}

Retrieve details of the next, upcoming bank holiday. The region can also be specified using the optional parameter.

Parameters:
Name Type Attributes Description
region UKBankHolidayLookup.UKBankHolidaysRegion <optional>

Optional region to filter bank holidays by.

Returns:
object

Object with bank holiday details. Returns null if the region is specified and not valid.

getRegion(region) → (nullable) {object}

Retrieves all available bank holidays for the specified region.

Parameters:
Name Type Description
region UKBankHolidayLookup.UKBankHolidaysRegion

The region to retrieve bank holidays for.

Returns:
object

Object with bank holiday details. Returns null if the region is not valid.

Example:
// Get bank holidays for England and Wales
var bankHolidays = connectors.verjio.ukbankholidays.getRegion(
  connectors.verjio.ukbankholidays.regions.ENGLAND_WALES
);

bankHolidays.events.forEach(event => {
  tables.bankHolidays.insertRow();
  tables.bankHolidays.name.value = event.title;
  tables.bankHolidays.date.value = event.date;
});

getYear(year, regionopt) → (nullable) {object}

Retrieves bank holidays for the specified year. The region can also be specified using the optional second parameter.

Parameters:
Name Type Attributes Description
year string  

Year to retrieve bank holidays for in 'YYYY' format, e.g. '2024'. Defaults to the current year.

region UKBankHolidayLookup.UKBankHolidaysRegion <optional>

Optional region to filter bank holidays by.

Returns:
object

Object with bank holiday details. Returns null if the region is specified and not valid.

Examples:
// Get bank holidays for the year of 2025 in Scotland
var bankHolidays = connectors.verjio.ukbankholidays.getYear(
  2025,
  connectors.verjio.ukbankholidays.regions.SCOTLAND
);
// Get bank holidays for the current year in all regions
var bankHolidays = connectors.verjio.ukbankholidays.getYear();

isBankHoliday(date, regionopt) → {boolean}

Determines if the specified date is a bank holiday, optionally specifying a region.

Parameters:
Name Type Attributes Description
date object  

Date to check. Specified as a JavaScript Date.

region UKBankHolidayLookup.UKBankHolidaysRegion <optional>

Optional region to use as filter.

See:
Returns:
boolean

true if it is a bank holiday, false otherwise.

isBankHolidayToday(regionopt) → {boolean}

Determines if today is a bank holiday, optionally specifying a region.

Parameters:
Name Type Attributes Description
region UKBankHolidayLookup.UKBankHolidaysRegion <optional>

Optional region to use as filter.

See:
Returns:
boolean

true if it is a bank holiday, false otherwise.

Type definitions

UKBankHolidaysRegion

Constants used to identify regions of the UK for their respective bank holidays.

These can be accessed via connectors.verjio.ukbankholidays.regions.

Properties:
Name Type Description
ENGLAND_WALES string

Bank holidays for England and Wales.

SCOTLAND string

Bank holidays for Scotland.

NORTHERN_IRELAND string

Bank holidays for Northern Ireland.

Copyright Ebase Technology 2024