{"openapi":"3.0.3","info":{"title":"BizDay API","version":"1.0.0","description":"REST API for business/workday calculations — check if a date is a workday, find the next workday, add workdays, and count workdays between dates for 30+ countries with public holiday awareness.","contact":{"url":"https://bizday.dev"},"license":{"name":"Proprietary"}},"servers":[{"url":"https://api.bizday.dev","description":"Production"}],"security":[{"BearerAuth":[]}],"paths":{"/v1/check":{"get":{"operationId":"checkWorkday","summary":"Check if a date is a workday","description":"Determine whether a specific date is a business day in a given country, accounting for weekends and public holidays.","parameters":[{"$ref":"#/components/parameters/date"},{"$ref":"#/components/parameters/country"}],"responses":{"200":{"description":"Workday check result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckResponse"},"example":{"success":true,"data":{"date":"2026-12-25","country":"GB","is_workday":false,"reason":"public_holiday","holiday":{"name":"Christmas Day","local_name":"Christmas Day","type":"Public"}},"meta":{"country":"GB","requested_date":"2026-12-25","cached":false,"timestamp":"2026-03-05T10:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/next":{"get":{"operationId":"nextWorkday","summary":"Find the next or previous workday","description":"Find the next (or previous) business day from a given date, skipping weekends and public holidays.","parameters":[{"name":"date","in":"query","description":"Date in YYYY-MM-DD format. Defaults to today if omitted.","schema":{"type":"string","format":"date","example":"2026-12-24"}},{"$ref":"#/components/parameters/country"},{"name":"direction","in":"query","description":"Search direction.","schema":{"type":"string","enum":["next","prev"],"default":"next"}}],"responses":{"200":{"description":"Next/previous workday result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NextResponse"},"example":{"success":true,"data":{"from_date":"2026-12-24","country":"GB","direction":"next","workday":"2026-12-29"},"meta":{"country":"GB","requested_date":"2026-12-24","cached":false,"timestamp":"2026-03-05T10:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/add":{"get":{"operationId":"addWorkdays","summary":"Add workdays to a date","description":"Add (or subtract) a number of business days to a date, skipping weekends and public holidays.","parameters":[{"$ref":"#/components/parameters/date"},{"$ref":"#/components/parameters/country"},{"name":"days","in":"query","required":true,"description":"Number of workdays to add. Negative values subtract. Range: -365 to 365, non-zero.","schema":{"type":"integer","minimum":-365,"maximum":365,"example":10}}],"responses":{"200":{"description":"Date with workdays added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddResponse"},"example":{"success":true,"data":{"start_date":"2026-03-05","country":"US","workdays_added":10,"result_date":"2026-03-19","weekends_skipped":4,"holidays_skipped":0},"meta":{"country":"US","requested_date":"2026-03-05","cached":false,"timestamp":"2026-03-05T10:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/between":{"get":{"operationId":"workdaysBetween","summary":"Count workdays between two dates","description":"Calculate the number of business days between two dates (start exclusive, end inclusive). Maximum range: 366 days.","parameters":[{"name":"start","in":"query","required":true,"description":"Start date (exclusive) in YYYY-MM-DD format.","schema":{"type":"string","format":"date","example":"2026-03-01"}},{"name":"end","in":"query","required":true,"description":"End date (inclusive) in YYYY-MM-DD format.","schema":{"type":"string","format":"date","example":"2026-03-31"}},{"$ref":"#/components/parameters/country"}],"responses":{"200":{"description":"Workday count between dates","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BetweenResponse"},"example":{"success":true,"data":{"country":"DE","start_date":"2026-03-01","end_date":"2026-03-31","workdays":22,"weekends":8,"holidays":0,"holiday_list":[]},"meta":{"country":"DE","cached":false,"timestamp":"2026-03-05T10:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/v1/countries":{"get":{"operationId":"listCountries","summary":"List supported countries","description":"Returns all countries supported by the API. This endpoint does not require authentication.","security":[],"parameters":[],"responses":{"200":{"description":"List of supported countries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountriesResponse"},"example":{"success":true,"data":{"countries":[{"code":"AU","name":"Australia"},{"code":"GB","name":"United Kingdom"},{"code":"US","name":"United States"}],"count":30},"meta":{"timestamp":"2026-03-05T10:00:00.000Z"}}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key prefixed with wday_. Pass via Authorization: Bearer wday_your_api_key"}},"parameters":{"date":{"name":"date","in":"query","required":true,"description":"Date in YYYY-MM-DD format.","schema":{"type":"string","format":"date","example":"2026-03-05"}},"country":{"name":"country","in":"query","required":true,"description":"ISO 3166-1 alpha-2 country code (e.g. US, GB, DE).","schema":{"type":"string","minLength":2,"maxLength":2,"example":"US"}}},"schemas":{"Meta":{"type":"object","properties":{"country":{"type":"string","example":"GB"},"requested_date":{"type":"string","format":"date","example":"2026-03-05"},"cached":{"type":"boolean","example":false},"timestamp":{"type":"string","format":"date-time"}}},"ErrorBody":{"type":"object","required":["success","error"],"properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","example":"INVALID_DATE"},"message":{"type":"string","example":"Date must be in YYYY-MM-DD format."},"docs":{"type":"string","format":"uri","example":"https://bizday.dev/docs/errors#INVALID_DATE"}}}}},"Holiday":{"type":"object","properties":{"name":{"type":"string","example":"Christmas Day"},"local_name":{"type":"string","example":"Christmas Day"},"type":{"type":"string","example":"Public"}}},"CheckResponse":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["date","country","is_workday"],"properties":{"date":{"type":"string","format":"date"},"country":{"type":"string"},"is_workday":{"type":"boolean"},"reason":{"type":"string","description":"Why the date is not a workday (e.g. \"public_holiday\", \"weekend\")."},"holiday":{"$ref":"#/components/schemas/Holiday"}}},"meta":{"$ref":"#/components/schemas/Meta"}}},"NextResponse":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["from_date","country","direction","workday"],"properties":{"from_date":{"type":"string","format":"date"},"country":{"type":"string"},"direction":{"type":"string","enum":["next","previous"]},"workday":{"type":"string","format":"date"}}},"meta":{"$ref":"#/components/schemas/Meta"}}},"AddResponse":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["start_date","country","workdays_added","result_date","weekends_skipped","holidays_skipped"],"properties":{"start_date":{"type":"string","format":"date"},"country":{"type":"string"},"workdays_added":{"type":"integer"},"result_date":{"type":"string","format":"date"},"weekends_skipped":{"type":"integer"},"holidays_skipped":{"type":"integer"}}},"meta":{"$ref":"#/components/schemas/Meta"}}},"BetweenResponse":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["country","start_date","end_date","workdays","weekends","holidays","holiday_list"],"properties":{"country":{"type":"string"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"workdays":{"type":"integer"},"weekends":{"type":"integer"},"holidays":{"type":"integer"},"holiday_list":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"name":{"type":"string"}}}}}},"meta":{"$ref":"#/components/schemas/Meta"}}},"CountriesResponse":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","required":["countries","count"],"properties":{"countries":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","example":"US"},"name":{"type":"string","example":"United States"}}}},"count":{"type":"integer","example":30}}},"meta":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"}}}}}},"responses":{"BadRequest":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"Unauthorized":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"RateLimited":{"description":"Rate limit exceeded","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Monthly request limit"},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Remaining requests this month"},"X-RateLimit-Reset":{"schema":{"type":"string","format":"date-time"},"description":"When the limit resets (1st of next month)"},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until burst limit resets"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}}