← Back to API Ninjas
Get public holidays for a given country and year
Returns public holidays for a country and calendar year. Requires a `country`. To test whether one date is a public holiday use /ispublicholiday.
API Ninjas·$0.001 per call
Example code
// Using @orth/sdk - The simplest way to call APIs
// Install: npm install @orth/sdk
import Orthogonal from "@orth/sdk";
const orthogonal = new Orthogonal({
apiKey: process.env.ORTHOGONAL_API_KEY,
});
const output = await orthogonal.run({
api: "api-ninjas",
path: "/v1/publicholidays",
query: {
"country": "example"
}
});
console.log(output);Query parameters
countryrequired
string
2-letter ISO country code or full country name.
year
number
Calendar year between 1980 and 2050 (inclusive). Defaults to current year. (Default: 2023)