{
 "openapi": "3.1.0",
 "info": {
  "title": "Landed in Spain API",
  "version": "1.0.0",
  "summary": "Read-only directory, visa and insurance data for people moving to Spain.",
  "description": "Static JSON files, regenerated with every build of Landed in Spain. No key, no auth, CORS open. Every listing field is one its profile page shows, with the URL each fact came from. null means not stated, not no. Google ratings are Google data. Insurance rows are editorial and alphabetical: not quotes or rankings. For agents there is also an MCP server at https://landedinspain.com/mcp.",
  "license": {
   "name": "Attribution requested (see x-licence)",
   "url": "https://landedinspain.com/agents/"
  },
  "contact": {
   "name": "Landed in Spain",
   "url": "https://landedinspain.com/agents/",
   "email": "hello@landedinspain.com"
  }
 },
 "x-licence": {
  "name": "Landed in Spain directory data",
  "summary": "Public business information (names, addresses, phone numbers, websites, services) compiled by Landed in Spain from each business's own website, Google Maps and official registers, with a source URL for each fact. You may reuse it with attribution and a link to the profile URL. Google ratings and review counts are Google's data, shown as \"Google rating\"; do not present them as our reviews or as your own. Visa facts quote official Spanish government pages. Insurance rows are what each insurer publishes, in alphabetical order: they are not quotes, rankings or advice.",
  "attribution": "Data from Landed in Spain (https://landedinspain.com), with a link to the page cited.",
  "url": "https://landedinspain.com/agents/"
 },
 "servers": [
  {
   "url": "https://landedinspain.com/api/v1"
  }
 ],
 "externalDocs": {
  "description": "Agents and developers",
  "url": "https://landedinspain.com/agents/"
 },
 "tags": [
  {
   "name": "directory"
  },
  {
   "name": "visas"
  },
  {
   "name": "insurance"
  },
  {
   "name": "content"
  }
 ],
 "paths": {
  "/index.json": {
   "get": {
    "operationId": "getIndex",
    "tags": [
     "content"
    ],
    "summary": "Endpoints, counts and licence",
    "responses": {
     "200": {
      "description": "Index",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/categories.json": {
   "get": {
    "operationId": "listCategories",
    "tags": [
     "directory"
    ],
    "summary": "Directory categories, with per-city counts",
    "responses": {
     "200": {
      "description": "Categories",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "categories": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Category"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/cities.json": {
   "get": {
    "operationId": "listCities",
    "tags": [
     "directory"
    ],
    "summary": "Cities covered, with per-category counts",
    "responses": {
     "200": {
      "description": "Cities",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "cities": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/City"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/listings/{category}/{city}.json": {
   "get": {
    "operationId": "listListings",
    "tags": [
     "directory"
    ],
    "summary": "Every listing in a category and city, in the order the page shows them",
    "parameters": [
     {
      "name": "category",
      "in": "path",
      "required": true,
      "description": "Category in URL form",
      "schema": {
       "type": "string",
       "enum": [
        "immigration-lawyers",
        "english-speaking-lawyers",
        "gestorias",
        "tax-advisers",
        "insurance-brokers",
        "removals",
        "international-schools"
       ]
      }
     },
     {
      "name": "city",
      "in": "path",
      "required": true,
      "description": "City slug",
      "schema": {
       "type": "string",
       "enum": [
        "madrid",
        "barcelona",
        "valencia",
        "malaga",
        "alicante",
        "marbella",
        "seville",
        "murcia",
        "las-palmas",
        "zaragoza",
        "palma",
        "granada",
        "bilbao",
        "santa-cruz-de-tenerife",
        "cordoba",
        "torrevieja",
        "girona",
        "san-sebastian",
        "benidorm",
        "fuengirola",
        "denia",
        "mijas",
        "sitges",
        "estepona",
        "javea",
        "national"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Listings",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "category": {
           "type": "object"
          },
          "city": {
           "type": "object"
          },
          "count": {
           "type": "integer"
          },
          "order": {
           "type": "string"
          },
          "page_url": {
           "type": "string",
           "format": "uri"
          },
          "markdown_url": {
           "type": "string",
           "format": "uri"
          },
          "listings": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Listing"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/listings/{listing_id}.json": {
   "get": {
    "operationId": "getListing",
    "tags": [
     "directory"
    ],
    "summary": "One listing, with the source of each fact",
    "parameters": [
     {
      "name": "listing_id",
      "in": "path",
      "required": true,
      "description": "Listing id (field id)",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Listing",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "listing": {
           "$ref": "#/components/schemas/Listing"
          },
          "licence": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/search-index.json": {
   "get": {
    "operationId": "getSearchIndex",
    "tags": [
     "directory"
    ],
    "summary": "Compact rows for every listing (short keys, see the keys field), for client-side filtering",
    "responses": {
     "200": {
      "description": "Search index",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "keys": {
           "type": "string"
          },
          "rows": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/listings.jsonl": {
   "get": {
    "operationId": "getBulkListings",
    "tags": [
     "directory"
    ],
    "summary": "Bulk download: every listing, one JSON object per line (Listing schema). Also /listings.jsonl.gz",
    "responses": {
     "200": {
      "description": "JSON Lines",
      "content": {
       "application/jsonl": {
        "schema": {
         "$ref": "#/components/schemas/Listing"
        }
       }
      }
     }
    }
   }
  },
  "/visas.json": {
   "get": {
    "operationId": "listVisas",
    "tags": [
     "visas"
    ],
    "summary": "Visas and the nationality pages for each",
    "responses": {
     "200": {
      "description": "Visas",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "visas": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Visa"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/visas/{visa}.json": {
   "get": {
    "operationId": "getVisa",
    "tags": [
     "visas"
    ],
    "summary": "Rules common to every nationality, each quoting an official source",
    "parameters": [
     {
      "name": "visa",
      "in": "path",
      "required": true,
      "description": "Visa key",
      "schema": {
       "type": "string",
       "enum": [
        "nlv",
        "dnv",
        "student",
        "hqp",
        "entrepreneur",
        "family_reunification",
        "eu_family",
        "golden_visa",
        "arraigo"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Visa",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "visa": {
           "$ref": "#/components/schemas/Visa"
          },
          "facts": {
           "$ref": "#/components/schemas/Facts"
          },
          "sources": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/visas/{visa}/{nationality}.json": {
   "get": {
    "operationId": "getVisaForNationality",
    "tags": [
     "visas"
    ],
    "summary": "Facts for one visa and nationality (the consulate's own facts over the common ones)",
    "parameters": [
     {
      "name": "visa",
      "in": "path",
      "required": true,
      "description": "Visa key",
      "schema": {
       "type": "string",
       "enum": [
        "nlv",
        "dnv",
        "student",
        "hqp",
        "entrepreneur",
        "family_reunification",
        "eu_family",
        "golden_visa",
        "arraigo"
       ]
      }
     },
     {
      "name": "nationality",
      "in": "path",
      "required": true,
      "description": "Nationality key",
      "schema": {
       "type": "string",
       "enum": [
        "us",
        "uk",
        "ca",
        "au",
        "nz",
        "ie",
        "in",
        "za"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Visa facts",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "visa": {
           "type": "object"
          },
          "nationality": {
           "type": "object"
          },
          "page_url": {
           "type": "string"
          },
          "facts": {
           "$ref": "#/components/schemas/Facts"
          },
          "facts_from_nationality": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "sources": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/insurance/products.json": {
   "get": {
    "operationId": "listInsuranceProducts",
    "tags": [
     "insurance"
    ],
    "summary": "Visa health insurance policies, alphabetical, as each insurer publishes them. Not quotes or rankings",
    "responses": {
     "200": {
      "description": "Products",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "note": {
           "type": "string"
          },
          "products": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Product"
           }
          },
          "insurers": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/guides.json": {
   "get": {
    "operationId": "listGuides",
    "tags": [
     "content"
    ],
    "summary": "Guides, visa, insurance, city and about pages with markdown URLs",
    "responses": {
     "200": {
      "description": "Guides",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "guides": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Guide"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  },
  "/pages.json": {
   "get": {
    "operationId": "listPages",
    "tags": [
     "content"
    ],
    "summary": "Every page except profiles (short keys: p path, t type, h heading, d description, x indexable)",
    "responses": {
     "200": {
      "description": "Pages",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "404": {
      "description": "No such file"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Listing": {
    "type": "object",
    "description": "Every field the profile page shows, with where each fact came from. null means not stated, not no.",
    "properties": {
     "id": {
      "type": "string"
     },
     "slug": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "kind": {
      "type": "string",
      "enum": [
       "firm",
       "school"
      ]
     },
     "categories": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "category_labels": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "city": {
      "type": "string"
     },
     "city_slug": {
      "type": "string"
     },
     "region": {
      "type": [
       "string",
       "null"
      ]
     },
     "address": {
      "type": [
       "string",
       "null"
      ]
     },
     "lat": {
      "type": [
       "number",
       "null"
      ]
     },
     "lng": {
      "type": [
       "number",
       "null"
      ]
     },
     "phone": {
      "type": [
       "string",
       "null"
      ]
     },
     "website": {
      "type": [
       "string",
       "null"
      ]
     },
     "email_public": {
      "type": [
       "string",
       "null"
      ],
      "description": "Only an address published on the business's own website"
     },
     "google_rating": {
      "type": [
       "number",
       "null"
      ],
      "description": "Google rating (Google data, not ours)"
     },
     "google_reviews": {
      "type": [
       "number",
       "null"
      ]
     },
     "work_hours": {
      "type": [
       "object",
       "null"
      ],
      "additionalProperties": {
       "type": "string"
      }
     },
     "languages": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "ISO 639-1 codes"
     },
     "english_speaking": {
      "type": [
       "boolean",
       "null"
      ]
     },
     "visas_handled": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "services": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "fixed_fee_from_eur": {
      "type": [
       "number",
       "null"
      ],
      "description": "Lowest fixed fee the business publishes, with evidence.fixed_fee_from_eur as the source"
     },
     "remote_service": {
      "type": [
       "boolean",
       "null"
      ]
     },
     "school_curricula": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "school_fees_eur": {},
     "bar_number": {
      "type": [
       "string",
       "null"
      ]
     },
     "dgsfp_code": {
      "type": [
       "string",
       "null"
      ],
      "description": "Spanish insurance register code"
     },
     "verified_registry": {
      "type": [
       "object",
       "null"
      ],
      "properties": {
       "key": {
        "type": "string"
       },
       "name": {
        "type": "string"
       },
       "id": {
        "type": [
         "string",
         "null"
        ]
       },
       "url": {
        "type": [
         "string",
         "null"
        ]
       }
      }
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "description_translated": {
      "type": "boolean"
     },
     "profile_url": {
      "type": "string",
      "format": "uri"
     },
     "markdown_url": {
      "type": "string",
      "format": "uri"
     },
     "json_url": {
      "type": "string",
      "format": "uri"
     },
     "maps_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "evidence": {
      "type": "object",
      "description": "Field name to the URL that shows it",
      "additionalProperties": {
       "type": "string"
      }
     },
     "sources": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "url": {
         "type": "string",
         "format": "uri"
        },
        "kind": {
         "type": "string",
         "enum": [
          "google_maps",
          "own_website",
          "registry"
         ]
        },
        "retrieved_at": {
         "type": [
          "string",
          "null"
         ],
         "description": "ISO date-time the source was read"
        }
       },
       "required": [
        "url"
       ]
      }
     },
     "last_checked": {
      "type": [
       "string",
       "null"
      ]
     },
     "indexable": {
      "type": "boolean"
     }
    },
    "required": [
     "id",
     "slug",
     "name",
     "kind",
     "categories",
     "city_slug",
     "profile_url",
     "sources"
    ]
   },
   "Source": {
    "type": "object",
    "properties": {
     "url": {
      "type": "string",
      "format": "uri"
     },
     "kind": {
      "type": "string",
      "enum": [
       "google_maps",
       "own_website",
       "registry"
      ]
     },
     "retrieved_at": {
      "type": [
       "string",
       "null"
      ],
      "description": "ISO date-time the source was read"
     }
    },
    "required": [
     "url"
    ]
   },
   "Category": {
    "type": "object",
    "properties": {
     "key": {
      "type": "string"
     },
     "path": {
      "type": "string"
     },
     "label": {
      "type": "string"
     },
     "singular": {
      "type": "string"
     },
     "description": {
      "type": "string"
     },
     "listing_count": {
      "type": "integer"
     },
     "cities": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "city_slug": {
         "type": "string"
        },
        "city": {
         "type": "string"
        },
        "count": {
         "type": "integer"
        },
        "json_url": {
         "type": "string",
         "format": "uri"
        }
       }
      }
     },
     "page_url": {
      "type": "string",
      "format": "uri"
     },
     "markdown_url": {
      "type": "string",
      "format": "uri"
     }
    },
    "required": [
     "key",
     "path",
     "label"
    ]
   },
   "City": {
    "type": "object",
    "properties": {
     "slug": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "region": {
      "type": [
       "string",
       "null"
      ]
     },
     "province": {
      "type": [
       "string",
       "null"
      ]
     },
     "lat": {
      "type": [
       "number",
       "null"
      ]
     },
     "lng": {
      "type": [
       "number",
       "null"
      ]
     },
     "population": {
      "type": [
       "number",
       "null"
      ]
     },
     "nationwide": {
      "type": "boolean"
     },
     "listing_count": {
      "type": "integer"
     },
     "categories": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "page_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "markdown_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "sources": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    },
    "required": [
     "slug",
     "name"
    ]
   },
   "Fact": {
    "type": "object",
    "properties": {
     "value": {},
     "source_url": {
      "type": [
       "string",
       "null"
      ],
      "description": "Official page the fact comes from"
     },
     "retrieved_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "quote": {
      "type": [
       "string",
       "null"
      ],
      "description": "The words on the official page"
     }
    },
    "required": [
     "value"
    ]
   },
   "Facts": {
    "type": "object",
    "description": "Field name to fact. Fields follow the visa pages: who_its_for, income_threshold_eur_month, income_rule_text, required_documents, insurance_rules.*, fees, processing_time, where_to_apply, appointment_method, validity, renewal, page_last_updated, conflicts",
    "additionalProperties": {
     "$ref": "#/components/schemas/Fact"
    }
   },
   "Visa": {
    "type": "object",
    "properties": {
     "key": {
      "type": "string"
     },
     "path": {
      "type": "string"
     },
     "label": {
      "type": "string"
     },
     "who": {
      "type": "string"
     },
     "closed_to_new_applicants": {
      "type": "boolean"
     },
     "page_url": {
      "type": "string"
     },
     "markdown_url": {
      "type": "string"
     },
     "json_url": {
      "type": "string"
     },
     "has_facts": {
      "type": "boolean"
     },
     "nationalities": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "key": {
         "type": "string"
        },
        "label": {
         "type": "string"
        },
        "page_url": {
         "type": "string"
        },
        "json_url": {
         "type": "string"
        },
        "has_facts": {
         "type": "boolean"
        }
       }
      }
     }
    }
   },
   "Product": {
    "type": "object",
    "description": "What the insurer publishes about one policy. Not a quote, a ranking or advice.",
    "properties": {
     "id": {
      "type": "string"
     },
     "insurer": {
      "type": "string"
     },
     "insurer_slug": {
      "type": "string"
     },
     "product": {
      "type": "string"
     },
     "dgsfp_code": {
      "type": [
       "string",
       "null"
      ]
     },
     "visas_stated": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Visas the insurer says the policy meets"
     },
     "no_copay": {
      "type": [
       "boolean",
       "null"
      ]
     },
     "waiting_periods": {
      "type": [
       "string",
       "null"
      ]
     },
     "repatriation": {
      "type": [
       "boolean",
       "string",
       "null"
      ]
     },
     "consulate_certificate": {
      "type": [
       "boolean",
       "string",
       "null"
      ]
     },
     "price_from_eur_month_as_published": {
      "type": [
       "number",
       "null"
      ],
      "description": "Lowest monthly price the insurer publishes, if it publishes one. Not a quote."
     },
     "price_kind": {
      "type": [
       "string",
       "null"
      ]
     },
     "needs_quote": {
      "type": [
       "boolean",
       "null"
      ]
     },
     "product_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "insurer_page_url": {
      "type": "string",
      "format": "uri"
     },
     "sources": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "url": {
         "type": "string",
         "format": "uri"
        },
        "retrieved_at": {
         "type": [
          "string",
          "null"
         ]
        }
       }
      }
     },
     "retrieved_at": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "id",
     "insurer",
     "product"
    ]
   },
   "Guide": {
    "type": "object",
    "properties": {
     "slug": {
      "type": "string",
      "description": "Pass this to get_guide"
     },
     "kind": {
      "type": "string",
      "enum": [
       "guide",
       "visa",
       "insurance",
       "city",
       "about"
      ]
     },
     "type": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "description": {
      "type": "string"
     },
     "indexable": {
      "type": "boolean"
     },
     "updated": {
      "type": [
       "string",
       "null"
      ]
     },
     "page_url": {
      "type": "string",
      "format": "uri"
     },
     "markdown_url": {
      "type": "string",
      "format": "uri"
     }
    },
    "required": [
     "slug",
     "title",
     "page_url",
     "markdown_url"
    ]
   }
  }
 }
}