{
  "openapi": "3.1.0",
  "info": {
    "title": "Vettid open data",
    "version": "4.1.0",
    "description": "Static JSON files of https://vettid.fi: vet clinics, their services and prices, and free appointments in Finland (EUR). Rebuilt when the data is refreshed. Terms: https://vettid.fi/kayttoehdot/. The MCP server https://vettid.fi/mcp serves the same data to AI assistants."
  },
  "servers": [
    {
      "url": "https://vettid.fi"
    }
  ],
  "paths": {
    "/api/index.json": {
      "get": {
        "summary": "Services, cities and clinics",
        "description": "Every service with its free times in the next two weeks and the clinics' price range, every city with clinics, and every clinic with its services, listed prices and page.",
        "responses": {
          "200": {
            "description": "The site's catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "generatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "country": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "site": {
                      "type": "string"
                    },
                    "services": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "object",
                            "description": "Name per language (fi, sv, en, nb)",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "freeTimes": {
                            "type": "integer"
                          },
                          "clinics": {
                            "type": "integer"
                          },
                          "price": {
                            "type": "object",
                            "properties": {
                              "from": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "median": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "to": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              }
                            }
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "cities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "key": {
                            "type": "string"
                          },
                          "lat": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lon": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "clinics": {
                            "type": "integer"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "clinics": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "chain": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "city": {
                            "type": "string"
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lat": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lon": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "services": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "prices": {
                            "type": "object"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/clinics/index.json": {
      "get": {
        "summary": "Cities with their clinic counts",
        "responses": {
          "200": {
            "description": "Cities",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/clinics/{city}.json": {
      "get": {
        "summary": "One city's clinics",
        "parameters": [
          {
            "name": "city",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "City slug from /api/clinics/index.json"
          }
        ],
        "responses": {
          "200": {
            "description": "Clinics with address, chain, services and links",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/prices/index.json": {
      "get": {
        "summary": "Every price topic with each clinic's price",
        "responses": {
          "200": {
            "description": "Price topics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/prices/{topic}.json": {
      "get": {
        "summary": "One price topic",
        "parameters": [
          {
            "name": "topic",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Topic slug from /api/prices/index.json"
          }
        ],
        "responses": {
          "200": {
            "description": "Each clinic's price for the service",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/{service}/{city}/{date}.json": {
      "get": {
        "summary": "Free appointments of one service in one city on one date",
        "parameters": [
          {
            "name": "service",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Service path slug (Finnish), e.g. rokotus"
          },
          {
            "name": "city",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "City slug, e.g. helsinki"
          },
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Free appointments with clinic, time, species, price and booking link. Each clinic, string and treatment text is listed once in a table and referred to by its index (common/src/dayFile.ts): a slot's c is its clinic in clinics, s, u, pr and tn index strings (service, booking link, vet title, the clinic's treatment name), m, an and dt index modes, animals and details. Empty values are left out.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "v": {
                      "const": 1
                    },
                    "clinics": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "serviceProvider, providerSlug, cityName, location (the clinic's name), clinicSlug, addressPart1, addressPart2, mapUrl, locationPageUrl, lat, lon, coordsSource, brand, platform, currency"
                      }
                    },
                    "strings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "modes": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    },
                    "animals": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "details": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "slots": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "c",
                          "k",
                          "d",
                          "t",
                          "s",
                          "u",
                          "sp"
                        ],
                        "properties": {
                          "c": {
                            "type": "integer"
                          },
                          "k": {
                            "type": "string",
                            "description": "slot key"
                          },
                          "d": {
                            "type": "string",
                            "format": "date"
                          },
                          "t": {
                            "type": "string",
                            "description": "HH:mm:ss, local time"
                          },
                          "s": {
                            "type": "integer"
                          },
                          "u": {
                            "type": "integer"
                          },
                          "sp": {
                            "type": "string",
                            "description": "species"
                          },
                          "pr": {
                            "type": "integer"
                          },
                          "tn": {
                            "type": "integer"
                          },
                          "fn": {
                            "type": "string",
                            "description": "vet's first names"
                          },
                          "ln": {
                            "type": "string",
                            "description": "vet's surname"
                          },
                          "sx": {
                            "type": "string",
                            "description": "appended to the booking link: the link opened on this time"
                          },
                          "su": {
                            "type": "string",
                            "description": "the link opened on this time, when not the booking link + sx"
                          },
                          "m": {
                            "type": "integer",
                            "description": "absent: booked at the clinic on the booking link"
                          },
                          "du": {
                            "type": "integer",
                            "description": "minutes"
                          },
                          "ps": {
                            "type": "number",
                            "description": "price from"
                          },
                          "pe": {
                            "type": "number",
                            "description": "price"
                          },
                          "an": {
                            "type": "integer"
                          },
                          "ac": {
                            "type": "boolean",
                            "description": "the treatment itself names the animals"
                          },
                          "dt": {
                            "type": "integer"
                          },
                          "x": {
                            "type": "string"
                          },
                          "po": {
                            "type": "string",
                            "description": "price origin: booking, pricelist or manual"
                          },
                          "fs": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "ls": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}