{
  "openapi": "3.0.1",
  "info": {
    "title": "Schengen 90/180 & Residence Day Calculator API",
    "description": "Count days for the Schengen 90/180 rule, UK settlement and Statutory Residence Test, US substantial presence and 330-day tests, and Canadian citizenship and PR. Get days used, days left, the first breach date and whether a planned trip fits. Every rule cites its official source.",
    "version": "0.1",
    "x-build-id": "YchfMxPJelyh4z1Q4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetchgrove~stay-limit-calculator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetchgrove-stay-limit-calculator",
        "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/fetchgrove~stay-limit-calculator/runs": {
      "post": {
        "operationId": "runs-sync-fetchgrove-stay-limit-calculator",
        "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/fetchgrove~stay-limit-calculator/run-sync": {
      "post": {
        "operationId": "run-sync-fetchgrove-stay-limit-calculator",
        "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": {
          "travellers": {
            "title": "Travellers and trips",
            "type": "array",
            "description": "One entry per traveller: { \"ref\": \"t1\", \"trips\": [{ \"country\": \"FR\", \"from\": \"2026-05-01\", \"to\": \"2026-05-20\" }] }. ref is your own opaque label (letters, digits, dots, dashes, underscores or colons): never a name, email, phone or document number. Each trip is a stay in one country, both dates inclusive (YYYY-MM-DD): from is the day you arrived, to the day you left. country is an ISO 3166-1 code (FR, GB, US, CA) or a subdivision where it matters (ES-CN Canary Islands, PT-20 Azores, FR-GF French Guiana). Optional per trip: status (confirmed, planned or estimated). Instead of (or as well as) trips, a traveller can have tripsText: plain text with one trip per line, such as \"FR 2026-03-01 2026-03-30\", \"ES-CN 2026-01-05 to 2026-01-20\" or \"US 2026-02-10..2026-02-20\" (# starts a comment; blank lines are ignored; a tripsText that is blank or only comments adds no trips and leaves the traveller's trips as they are). Optional per traveller, for the Canada rules: prDate (the day you became a permanent resident) and temporaryResidencePeriods ([{ from, to }] when you were in Canada as a temporary resident or protected person before that). For rules that count absences (UK settlement, Canada), days not inside any listed trip are treated as days at home, so list every trip abroad. Leave empty to run one built-in example traveller."
          },
          "tripsText": {
            "title": "Trips as plain text (one traveller)",
            "type": "string",
            "description": "The quickest way to check one traveller: one trip per line, written COUNTRY ARRIVAL DEPARTURE with dates as YYYY-MM-DD, both days included. Examples: FR 2026-03-01 2026-03-30, ES-CN 2026-01-05 to 2026-01-20, US 2026-02-10..2026-02-20. Fields may also be separated by commas or tabs, and a status (planned or estimated) may follow the dates. Lines starting with # and blank lines are ignored; anything after # is a comment. Empty text is ignored; text with comments only and no trip lines gives an error row for this traveller (uncharged). A line that cannot be read gives an error row for this traveller, naming the line, and nothing is charged. If Travellers is also filled in, this text is one more traveller."
          },
          "rules": {
            "title": "Rules",
            "type": "array",
            "description": "Rules to check for every traveller. Each traveller and rule gives one result row.",
            "items": {
              "type": "string",
              "enum": [
                "schengen-90-180",
                "uk-settlement-180",
                "uk-srt-day-count",
                "us-substantial-presence",
                "us-330-day",
                "canada-citizenship-1095",
                "canada-pr-730",
                "rolling-183",
                "uk-naturalisation"
              ],
              "enumTitles": [
                "Schengen: 90 days in any 180",
                "UK settlement: at most 180 days away in any 12 months",
                "UK Statutory Residence Test: UK days in the tax year",
                "US substantial presence test",
                "US 330-day physical presence test",
                "Canada citizenship: 1,095 days in 5 years",
                "Canada permanent resident: 730 days in 5 years",
                "Any country: 183 days in a 12-month period",
                "UK citizenship by naturalisation: 450 days away in 5 years (270 in 3 for a spouse), 90 in the last 12 months"
              ]
            },
            "default": [
              "schengen-90-180"
            ]
          },
          "asOf": {
            "title": "As of",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "The date to report on (YYYY-MM-DD). Trips after it are included as planned travel. Defaults to today (UTC)."
          },
          "plan": {
            "title": "Planned trip",
            "type": "object",
            "description": "Optional question about a planned trip: { \"entry\": \"2026-11-01\", \"days\": 30, \"country\": \"FR\" }. For each rule it applies to, the result says whether it fits, the longest stay from that entry (maxStay, latestExit) and the earliest entry for a stay of that length. For UK settlement and Canada PR the planned trip is an absence abroad."
          },
          "applicationDate": {
            "title": "Citizenship application date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "For canada-citizenship-1095 and uk-naturalisation: the date you will sign the application, or for the UK the date the Home Office receives it (YYYY-MM-DD). Defaults to the As of date."
          },
          "rolling183Country": {
            "title": "Country for the 183-day count",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "For rolling-183: the ISO 3166-1 alpha-2 country to count (for example ES). If empty, the planned country is used, or else the country with the most days."
          },
          "ukNaturalisationRoute": {
            "title": "UK naturalisation route",
            "enum": [
              "standard",
              "spouse"
            ],
            "type": "string",
            "description": "For uk-naturalisation. standard: section 6(1), 5-year qualifying period, at most 450 days outside the UK. spouse: section 6(2), for the husband, wife or civil partner of a British citizen, 3-year period, at most 270 days. Both: at most 90 days outside the UK in the final 12 months.",
            "default": "standard"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}