{
  "openapi": "3.0.1",
  "info": {
    "title": "Calendario laboral España: festivos y días hábiles",
    "description": "Festivos nacionales y autonómicos de España según el BOE y cálculo de días hábiles: comprobar fechas, sumar y contar días hábiles por comunidad autónoma.",
    "version": "0.1",
    "x-build-id": "8VxYN1p6MfSx0SLAu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/angel.carreira~calendario-laboral-espana/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-angel.carreira-calendario-laboral-espana",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/angel.carreira~calendario-laboral-espana/runs": {
      "post": {
        "operationId": "runs-sync-angel.carreira-calendario-laboral-espana",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/angel.carreira~calendario-laboral-espana/run-sync": {
      "post": {
        "operationId": "run-sync-angel.carreira-calendario-laboral-espana",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "operacion": {
            "title": "Operación",
            "enum": [
              "festivos",
              "esHabil",
              "sumarDiasHabiles",
              "contarDiasHabiles"
            ],
            "type": "string",
            "description": "Operación de una consulta única. Si rellenas «Consultas en lote», este campo y sus parámetros se ignoran."
          },
          "anio": {
            "title": "Año",
            "minimum": 1,
            "maximum": 9999,
            "type": "integer",
            "description": "Año del calendario para la operación «festivos». Hay datos de 2026 y 2027; cualquier otro año devuelve un error en esa consulta."
          },
          "comunidad": {
            "title": "Comunidad o ciudad autónoma",
            "pattern": "^ES-[A-Z]{2}$",
            "type": "string",
            "description": "Código ISO 3166-2:ES (ES-AN, ES-AR, ES-AS, ES-IB, ES-CN, ES-CB, ES-CL, ES-CM, ES-CT, ES-EX, ES-GA, ES-MD, ES-MC, ES-NC, ES-PV, ES-RI, ES-VC, ES-CE, ES-ML). Si se omite, solo se aplican las fiestas nacionales."
          },
          "fecha": {
            "title": "Fecha",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Día civil en formato AAAA-MM-DD (sin hora ni zona horaria) para «esHabil» y «sumarDiasHabiles»."
          },
          "n": {
            "title": "Días hábiles a sumar",
            "type": "integer",
            "description": "Número entero de días hábiles que se suman a «fecha». Usa un valor negativo para restar."
          },
          "desde": {
            "title": "Desde (excluido)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Día inicial del cómputo, excluido, en formato AAAA-MM-DD. El intervalo es (desde, hasta]."
          },
          "hasta": {
            "title": "Hasta (incluido)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Día final del cómputo, incluido, en formato AAAA-MM-DD. El intervalo es (desde, hasta]."
          },
          "sabadoHabil": {
            "title": "Contar el sábado como hábil",
            "type": "boolean",
            "description": "Si está activo, el sábado cuenta como día hábil salvo que sea festivo. Por defecto, sábado y domingo no son hábiles."
          },
          "consultas": {
            "title": "Consultas en lote",
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "description": "Hasta 1000 consultas. Si se rellena, tiene prioridad sobre la consulta única y se ignoran sus campos.",
            "items": {
              "type": "object",
              "properties": {
                "operacion": {
                  "title": "Operación",
                  "type": "string",
                  "description": "Operación de esta consulta.",
                  "editor": "select",
                  "enum": [
                    "festivos",
                    "esHabil",
                    "sumarDiasHabiles",
                    "contarDiasHabiles"
                  ],
                  "enumTitles": [
                    "Festivos del año",
                    "¿Es día hábil?",
                    "Sumar días hábiles",
                    "Contar días hábiles"
                  ]
                },
                "anio": {
                  "title": "Año",
                  "type": "integer",
                  "description": "Año del calendario para «festivos».",
                  "editor": "number",
                  "minimum": 1,
                  "maximum": 9999
                },
                "comunidad": {
                  "title": "Comunidad o ciudad autónoma",
                  "type": "string",
                  "description": "Código ISO 3166-2:ES (por ejemplo, ES-MD). Si se omite, solo cuentan las fiestas nacionales.",
                  "editor": "textfield",
                  "pattern": "^ES-[A-Z]{2}$",
                  "errorMessage": {
                    "pattern": "El código debe tener la forma ES-XX (por ejemplo, ES-MD)."
                  }
                },
                "fecha": {
                  "title": "Fecha",
                  "type": "string",
                  "description": "Día civil AAAA-MM-DD para «esHabil» y «sumarDiasHabiles».",
                  "editor": "textfield",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "errorMessage": {
                    "pattern": "La fecha debe tener el formato AAAA-MM-DD."
                  }
                },
                "n": {
                  "title": "Días hábiles a sumar",
                  "type": "integer",
                  "description": "Días hábiles que se suman a «fecha»; negativo para restar.",
                  "editor": "number"
                },
                "desde": {
                  "title": "Desde (excluido)",
                  "type": "string",
                  "description": "Día inicial excluido, en formato AAAA-MM-DD.",
                  "editor": "textfield",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "errorMessage": {
                    "pattern": "La fecha debe tener el formato AAAA-MM-DD."
                  }
                },
                "hasta": {
                  "title": "Hasta (incluido)",
                  "type": "string",
                  "description": "Día final incluido, en formato AAAA-MM-DD.",
                  "editor": "textfield",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "errorMessage": {
                    "pattern": "La fecha debe tener el formato AAAA-MM-DD."
                  }
                },
                "sabadoHabil": {
                  "title": "Contar el sábado como hábil",
                  "type": "boolean",
                  "description": "Si es true, el sábado cuenta como hábil salvo que sea festivo.",
                  "editor": "checkbox"
                }
              },
              "required": [
                "operacion"
              ],
              "additionalProperties": false
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}