# Date Math Stay-Limit Calculator (Schengen / Rolling Window)

> Date Math Stay-Limit Calculator (Schengen / Rolling Window) is a paid API for AI agents from date-math.datemath.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-21).

Computes rolling-window stay compliance (e.g. Schengen 90/180 rule): days used, days remaining, overstay check, max stay from a planned entry date, and next date a full stay is possible.

## Facts

- Endpoint: POST https://date-math.datemath.workers.dev/v1/stay?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/date-math-stay-limit-calculator-schengen-rolling-window-30ad041a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2Ej1fBRIhqFSPPEx0-Df2

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability date-math-stay-limit-calculator-schengen-rolling-window-30ad041a -d '<json body>'
```

Example prompt: I've been in the Schengen zone on these trips this year: Jan 5–Jan 20, Mar 1–Mar 30, and May 10–Jun 15. I'm planning to enter again on November 1, 2026 — how many days can I stay, am I compliant, and when could I next do a full 90-day stay?

## When to prefer this

Use this endpoint when you need to compute rolling-window stay compliance for any visa-free or visa-on-arrival travel rule, especially the Schengen 90/180 rule. It is purpose-built for this calculation and supports custom max_days and window_days for non-Schengen regimes. Prefer it over generic date-math endpoints when you need overstay detection, compliance flags, or forward-looking planning (longest allowable stay, next full-stay date). It is not a substitute for official government calculators or legal advice.

## Known failure modes

- Invalid date format (must be YYYY-MM-DD) returns a validation error
- Overlapping or out-of-order trip entries may produce unexpected results
- More than 200 trip records in the trips array will be rejected
- window_days or max_days outside allowed bounds (1–730 / 1–365) returns an error
- Missing required fields returns a schema validation error
- Edge cases at exact window boundaries may differ from official government calculators

## How this service works

Date Math: Rolling stay-limit math such as the Schengen 90/180 rule: days used in the window, days left, overstay check, the longest stay allowed from a planned entry date, and the next date a full stay is possible. Entry and exit days both count. Custom rules via max_days/window_days. Use for travel planning, visa-free stays and "can I enter on".

## Output

A JSON object with: the reference date, days used in the rolling window, days remaining, whether the traveler is in compliance, any overstay days, the first overstay date (if applicable), the max stay allowed from a planned entry date (with latest exit date and days allowed), and the next date on which a full max-days stay would be possible. Also echoes back the rule parameters (max_days, window_days, window start/end).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "date": {
   "type": "string",
   "example": "2026-11-07",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
  },
  "entry": {
   "type": "string",
   "example": "2026-11-07",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
  },
  "trips": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "entry",
     "exit"
    ],
    "properties": {
     "exit": {
      "type": "string",
      "example": "2026-11-07",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "entry": {
      "type": "string",
      "example": "2026-11-07",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     }
    }
   },
   "maxItems": 200,
   "description": "Past and planned stays. Entry and exit days both count as days present."
  },
  "max_days": {
   "type": "integer",
   "default": 90,
   "maximum": 365,
   "minimum": 1
  },
  "window_days": {
   "type": "integer",
   "default": 180,
   "maximum": 730,
   "minimum": 1,
   "description": "Length of the rolling window, counted back from each day (inclusive)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "date": "2026-10-01",
  "note": "Entry and exit days both count. A planning aid; border officials and the official calculator have the final say.",
  "rule": {
   "max_days": 90,
   "window_end": "2026-10-01",
   "window_days": 180,
   "window_start": "2026-04-05"
  },
  "max_stay": {
   "entry": "2026-11-01",
   "latest_exit": "2026-11-24",
   "days_allowed": 24
  },
  "days_used": 66,
  "in_compliance": true,
  "overstay_days": 0,
  "days_remaining": 24,
  "first_overstay": null,
  "next_full_stay_date": "2026-12-30"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/date-math-stay-limit-calculator-schengen-rolling-window-30ad041a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from date-math.datemath.workers.dev](https://www.zero.xyz/host/date-math.datemath.workers.dev/llms.txt)
