# Business Days API
> Working-day date math. Count the business days between two dates, add or subtract a number of working days from a date (negative goes backwards), and check whether a given date is a business day — all skipping weekends and any holidays you supply. Configure which days count as the weekend (Saturday/Sunday by default, or e.g. Friday/Saturday) and pass a list of custom holiday dates to exclude. Perfect for SLA and support deadlines, delivery and lead-time estimates, payroll and invoicing periods, and financial settlement dates. Pure local UTC date math — no key, no third-party service, deterministic and instant. Live. 4 endpoints. Distinct from a calendar date toolkit (which counts calendar days) and a holidays directory (which lists holidays).

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/businessdays-api/..."
```

## Pricing
- **Free** (Free) — 1,300 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 18,000 calls/Mo, 8 req/s
- **Pro** ($24/Mo) — 162,000 calls/Mo, 20 req/s
- **Mega** ($60/Mo) — 830,000 calls/Mo, 50 req/s

## Endpoints

### Days

#### `GET /v1/add` — Add working days to a date

**Parameters:**
- `date` (query, required, string) — Start date Example: `2026-06-01`
- `days` (query, required, string) — Working days to add (may be negative) Example: `10`
- `weekend` (query, optional, string) — Weekend days, e.g. sat,sun or fri,sat (default sat,sun)
- `holidays` (query, optional, string) — Custom holidays YYYY-MM-DD,... to exclude

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/businessdays-api/v1/add?date=2026-06-01&days=10"
```

**Response:**
```json
{
    "data": {
        "date": "2026-06-01",
        "result": "2026-06-15",
        "weekday": "Monday",
        "days_added": 10
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:55.133Z",
        "request_id": "1d5aa0c2-7a80-4e1d-98fd-f68f46c0c834"
    },
    "status": "ok",
    "message": "Add working days to a date",
    "success": true
}
```

#### `GET /v1/between` — Business days between two dates

**Parameters:**
- `start` (query, required, string) — Start date Example: `2026-06-01`
- `end` (query, required, string) — End date Example: `2026-06-30`
- `weekend` (query, optional, string) — Weekend days, e.g. sat,sun or fri,sat (default sat,sun)
- `holidays` (query, optional, string) — Custom holidays YYYY-MM-DD,... to exclude
- `include_end` (query, optional, string) — false to exclude the end date

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/businessdays-api/v1/between?start=2026-06-01&end=2026-06-30"
```

**Response:**
```json
{
    "data": {
        "end": "2026-06-30",
        "start": "2026-06-01",
        "weekend": [
            0,
            6
        ],
        "include_end": true,
        "business_days": 22
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:55.235Z",
        "request_id": "292a72c2-2506-4278-a282-7d0cc0f8a69a"
    },
    "status": "ok",
    "message": "Business days between two dates",
    "success": true
}
```

#### `GET /v1/is-business-day` — Classify a date

**Parameters:**
- `date` (query, required, string) — Date Example: `2026-06-06`
- `weekend` (query, optional, string) — Weekend days, e.g. sat,sun or fri,sat (default sat,sun)
- `holidays` (query, optional, string) — Custom holidays YYYY-MM-DD,... to exclude

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/businessdays-api/v1/is-business-day?date=2026-06-06"
```

**Response:**
```json
{
    "data": {
        "date": "2026-06-06",
        "weekday": "Saturday",
        "is_holiday": false,
        "is_weekend": true,
        "is_business_day": false
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:55.356Z",
        "request_id": "b7645352-8fee-4cd7-8436-6dc248c81c00"
    },
    "status": "ok",
    "message": "Classify a date",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/businessdays-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "auth": "none upstream; this gateway requires x-api-key",
        "name": "Business Days API",
        "note": "Working-day calculations. /v1/between?start=&end= counts business days (include_end=false to exclude); /v1/add?date=&days=N adds/subtracts N working days (N may be negative); /v1/is-business-day?date= classifies a date. Configure ?weekend=sat,sun (or fri,sat, or 0..6) and pass ?holidays=YYYY-MM-DD,... for custom holidays. UTC, deterministic, instant.",
        "source": "Local working-day math — no key, no upstream",
        "endpoints": 4
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:55.468Z",
        "request_id": "f5d27c5e-166b-4116-8b3d-81292aecc38c"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/businessdays-api
OpenAPI spec: https://www.oanor.com/api/businessdays-api/openapi.json
