{
  "openapi": "3.1.0",
  "info": {
    "title": "Urgent VISA API",
    "version": "1.0.0",
    "summary": "Visa requirements for any passport and any destination.",
    "description": "Free, public, no key. Built so AI models can answer traveller visa questions without scraping HTML.",
    "contact": {
      "name": "Urgent VISA",
      "email": "dagrang@gmail.com",
      "url": "https://urgentvisa.org"
    },
    "license": {
      "name": "RSL - free with attribution",
      "url": "https://urgentvisa.org/license.xml"
    }
  },
  "servers": [
    {
      "url": "https://urgentvisa.org"
    }
  ],
  "x-mcp": {
    "endpoint": "https://urgentvisa.org/mcp",
    "transport": "streamable-http"
  },
  "paths": {
    "/api/visa": {
      "get": {
        "operationId": "getVisa",
        "summary": "Visa requirement for one passport + destination pair",
        "parameters": [
          {
            "name": "passport",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ISO-3166-1 alpha-2, e.g. fr"
          },
          {
            "name": "destination",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Destination slug, e.g. japan"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Requirement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Requirement"
                }
              }
            }
          }
        }
      }
    },
    "/api/extension": {
      "get": {
        "operationId": "getExtension",
        "summary": "Stay-extension rule for one passport + destination pair",
        "parameters": [
          {
            "name": "passport",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "destination",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Extension rule"
          }
        }
      }
    },
    "/api/nationalities": {
      "get": {
        "operationId": "listNationalities",
        "summary": "All supported passports",
        "responses": {
          "200": {
            "description": "List"
          }
        }
      }
    },
    "/api/destinations": {
      "get": {
        "operationId": "listDestinations",
        "summary": "All supported destinations",
        "responses": {
          "200": {
            "description": "List"
          }
        }
      }
    },
    "/api/passport": {
      "get": {
        "operationId": "getPassportPower",
        "summary": "Every destination reachable on one passport, grouped by visa category",
        "parameters": [
          {
            "name": "passport",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Grouped destinations"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Requirement": {
        "type": "object",
        "properties": {
          "passport": {
            "type": "string"
          },
          "destination": {
            "type": "string"
          },
          "visa_category": {
            "type": "string",
            "enum": [
              "visa-free",
              "freedom of movement",
              "e-visa",
              "e-visa / visa on arrival",
              "visa on arrival",
              "eTA",
              "ESTA (Visa Waiver)",
              "eVisitor",
              "visa required"
            ]
          },
          "fee": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "processing_time": {
            "type": "string"
          },
          "max_stay": {
            "type": "string"
          },
          "validity": {
            "type": "string"
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_url": {
            "type": "string"
          },
          "last_verified": {
            "type": "string",
            "format": "date"
          },
          "page_url": {
            "type": "string"
          }
        }
      }
    }
  }
}