{"openapi":"3.0.0","info":{"version":"1.0.0","title":"11holidays API","description":"REST API for public holidays, bank holidays and observances of 230+ countries.\n\n## Authentication\nEvery request needs an API key in the `Authorization` header. Get a free key at [11holidays.com/api-key](https://11holidays.com/api-key).\n\n```\nAuthorization: Bearer YOUR_API_KEY\n```\n\n## SDK\nUse the official [npm package](https://www.npmjs.com/package/11holidays): `npm i 11holidays`."},"security":[{"Bearer":[]}],"tags":[{"name":"Holidays","description":"Public holidays, bank holidays and observances by country and year"},{"name":"Countries","description":"Countries with holiday data"}],"servers":[{"url":"https://api.11holidays.com","description":"API"}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer","description":"API key from https://11holidays.com/api-key"}},"schemas":{"Countries":{"type":"object","properties":{"country":{"type":"string","maxLength":2,"example":"US","description":"Country code in ISO2 format"},"name":{"type":"string","maxLength":100,"example":"United States","description":"Name of the country"}},"required":["country","name"]},"Message":{"type":"object","properties":{"message":{"type":"string","example":"No holidays found"}},"required":["message"]},"Holidays":{"type":"object","properties":{"holiday_id":{"type":"number","example":1,"description":"Unique holiday id"},"name":{"type":"string","example":"Christmas eve 1970","description":"Name of the Holiday"},"description":{"type":"string","nullable":true},"date":{"type":"string","example":"1970-12-25","description":"Date of holiday in YYYY-MM-DD format"},"type":{"type":"string","example":"Public holiday","description":"Type of holidays. e.g public holiday, bank holiday etc"},"url":{"type":"string","nullable":true},"country":{"type":"string","maxLength":2,"example":"US","description":"Country code in ISO2 format"},"occasion_id":{"type":"number","nullable":true,"example":2,"description":"Unique occasion id"},"created_at":{"type":"string","description":"Timestamp when this holiday was created"},"updated_at":{"type":"string","description":"Timestamp when this holiday was last updated"},"ref_url":{"type":"string","nullable":true}},"required":["holiday_id","name","date","type","country","created_at","updated_at"]}},"parameters":{}},"paths":{"/v1/countries":{"get":{"tags":["Countries"],"summary":"List countries","description":"Get all countries with holiday data, with ISO2 country code and name","responses":{"200":{"description":"200 OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Countries"}}}}},"401":{"description":"Unauthorized, the API key is missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"},"example":{"message":"Invalid API Key"}}}}}}},"/v1/countries/{id}":{"get":{"tags":["Countries"],"summary":"Get a country","description":"Get country by ISO2 country code","parameters":[{"schema":{"type":"string","minLength":2,"maxLength":2,"example":"US","description":"Country code in ISO2 format"},"required":true,"description":"Country code in ISO2 format","name":"id","in":"path"}],"responses":{"200":{"description":"200 OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Countries"}}}},"400":{"description":"Bad request, the query or path parameters are invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"},"example":{"message":"country: Country must be a 2-character code"}}}},"401":{"description":"Unauthorized, the API key is missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"},"example":{"message":"Invalid API Key"}}}},"404":{"description":"Not found, no record exists with the given id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"},"example":{"message":"No holidays found"}}}}}}},"/v1/holidays":{"get":{"tags":["Holidays"],"summary":"List holidays","description":"Get all public holidays, bank holidays and observances of a country for a year","parameters":[{"schema":{"type":"string","minLength":2,"maxLength":2,"example":"US","description":"Country code in ISO2 format"},"required":true,"description":"Country code in ISO2 format","name":"country","in":"query"},{"schema":{"type":"integer","minimum":1000,"maximum":9999,"example":1970,"description":"Year in YYYY format"},"required":true,"description":"Year in YYYY format","name":"year","in":"query"}],"responses":{"200":{"description":"200 OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Holidays"}}}}},"400":{"description":"Bad request, the query or path parameters are invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"},"example":{"message":"country: Country must be a 2-character code"}}}},"401":{"description":"Unauthorized, the API key is missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"},"example":{"message":"Invalid API Key"}}}}}}},"/v1/holidays/{id}":{"get":{"tags":["Holidays"],"summary":"Get a holiday","description":"Get holiday by id","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"example":1,"description":"Unique holiday id"},"required":true,"description":"Unique holiday id","name":"id","in":"path"}],"responses":{"200":{"description":"200 OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Holidays"}}}},"400":{"description":"Bad request, the query or path parameters are invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"},"example":{"message":"country: Country must be a 2-character code"}}}},"401":{"description":"Unauthorized, the API key is missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"},"example":{"message":"Invalid API Key"}}}},"404":{"description":"Not found, no record exists with the given id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"},"example":{"message":"No holidays found"}}}}}}}}}