NewConnect Claude, Cursor, ChatGPT, and other AI agents to API Ninjas via our MCP server

Working Days API

The Working Days API provides information about working days and non-working days (weekends and public holidays) for countries around the world.

Available endpoints:

  • /v1/workingdays - Get a list of working days and non-working days for a given country and year/month
  • /v1/isworkingday - Check if a specific date is a working day
(4.2)

From 8,050 users

1,500+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
323ms347ms420ms772ms1004ms

Didn't find what you were looking for? Suggest an improvement


/v1/workingdays GET

https://api.api-ninjas.com/v1/workingdays

Returns a list of working days and non-working days for a given country and year/month.

To check if a specific date is a working day, use the /v1/isworkingday endpoint instead.

Parameters

  • country  required

    2-letter ISO country code.

  • year  optional premium only

    Calendar year between 1980 and 2050 (inclusive). By default, the current year is used.

  • month  optional

    Month number (1-12). If provided, returns data for just that month.

  • weekend  optional

    Comma-separated list of weekend days (mon, tue, wed, thu, fri, sat, sun). This parameter is optional: if not provided, the default weekend days will be determined based on the country. If specified, your values will override the country defaults.

  • public_holidays  optional

    Whether to include public holidays as non-working days (true/false). Defaults to true.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • num_working_days

    Total number of working days in the period.

  • num_non_working_days

    Total number of non-working days in the period.

  • working_days

    List of dates that are working days.

  • non_working_days

    List of dates that are non-working days, with reasons and holiday names if applicable.

Sample Request Live Demo!

country
year premium
month
weekend
public_holidays

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/workingdays?country=US

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    num_working_days:251,
    num_non_working_days:114,
    working_days:[
      "2025-01-02",
      "2025-01-03",
      "2025-01-06",
      "2025-01-07",
      "..."
    ],
    non_working_days:[
      {
        date:"2025-01-01",
        reasons:[
          "public holiday",
          "..."
        ],
        holiday_name:"New Year's Day"
      },
      {
        date:"2025-01-04",
        reasons:[
          "weekend",
          "..."
        ]
      },
      "..."
    ]
}

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/workingdays?country=US&year=2025" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.


/v1/isworkingday GET

https://api.api-ninjas.com/v1/workingdays

Returns whether a given date is a working day for a given country.

Parameters

  • country  required

    2-letter ISO country code.

  • date  required

    Date in YYYY-MM-DD format. Must be between 1980-01-01 and 2050-12-31 (inclusive).

  • weekend  optional

    Comma-separated list of weekend days (mon,tue,wed,thu,fri,sat,sun). This parameter is optional: if not provided, the default weekend days will be determined based on the country. If specified, your values will override the country defaults.

  • public_holidays  optional

    Whether to include public holidays as non-working days (true/false). Defaults to true.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • date

    The queried date.

  • country

    2-letter ISO country code.

  • day_of_week

    Day of the week (Monday through Sunday).

  • is_workday

    Whether the date is a working day.

  • non_working_reason

    List of reasons why the date is not a working day (if applicable).

  • public_holiday_name

    Name of the public holiday (if applicable).

Sample Request Live Demo!

country
date
weekend
public_holidays

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/isworkingday?country=US&date=2025-01-01

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    date:"2025-01-01",
    country:"US",
    day_of_week:"Wednesday",
    is_workday:false,
    non_working_reason:[
      "public holiday"
    ],
    public_holiday_name:"New Year's Day"
}