6 releases

0.1.7 Oct 6, 2022
0.1.6 Oct 3, 2022
0.1.1 Sep 30, 2022

#1145 in Asynchronous

35 downloads per month

MIT license

426 lines

Holiday API Rust Library

License Test Status Crates.io wakatime

Unofficial library for Holiday API written in Rust. This repo implements interface for original HolidayAPI endpoints seen here.


This project is heavily inspired by holidayapi-node and holiday-api-rust repositories.


Add the following to your Cargo.toml

holidayapi_rust = "0.1.7"

Or use cargo cli:

$ cargo add holidayapi_rust



use holidayapi_rust::prelude::*;

let holiday_api = HolidayAPI::new("00000000-0000-0000-0000-000000000000").unwrap();

async fn main() {
	// Fetch supported countries and subdivisions
	let countries: Vec<Country> = holiday_api.countries().get().await.unwrap();

	// Fetch supported languages
	let languages: Vec<Language> = holiday_api.languages().get().await.unwrap();

	// Fetch holidays with minimum parameters
	let holidays: Vec<Holiday> = holiday_api.holidays("US", 2020).get().await.unwrap();

Builder pattern

use holidayapi_rust::prelude::*;

let holiday_api = HolidayAPI::new(VALID_KEY).unwrap();

// Holidays
let specific_request: Vec<Holiday> = holiday_api
	.holidays("jp", 2021)

// Countries
let specific_request: Vec<Country> = holiday_api
	.search("hello world")

// Languages
let specific_request: Vec<Language> = holiday_api

Future ideas

  • Refactor async call using IntoFuture to remove unnecessary .get() calls.
  • Implements memoization for api calls.
  • Add new utility functions on top of raw API.


~323K SLoC