{
  "openapi": "3.0.3",
  "info": {
    "title": "vat.reviews API",
    "version": "1.0.0",
    "description": "Search every company in 13 European countries - names, VAT/SIREN, directors, financials, and status. VAT.txt item 228: this spec was generated from the same server.cpp routes VAT-Reviews/script/check-api-routes.py already verifies against the live client every deploy, so it cannot silently drift from what the API actually serves.",
    "contact": { "email": "info@vat.reviews" }
  },
  "servers": [{ "url": "https://vat.reviews/api/v1" }],
  "security": [{ "ApiKeyAuth": [] }],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token issued from your account's API keys page."
      }
    },
    "schemas": {
      "Company": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "example": "0403091220" },
          "country": { "type": "string", "example": "be" },
          "names": { "type": "array", "items": { "type": "string" } },
          "form": { "type": "string" },
          "street": { "type": "string" },
          "number": { "type": "string" },
          "zip": { "type": "string" },
          "city": { "type": "string" },
          "naces": { "type": "array", "items": { "type": "string" } },
          "dateStart": { "type": "string", "example": "19750101" },
          "deadTo": { "type": "integer", "example": 0 },
          "situation": { "type": "string", "example": "000" },
          "directors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": { "type": "string" },
                "name": { "type": "string" },
                "since": { "type": "string" }
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": { "error": { "type": "string" } }
      }
    }
  },
  "paths": {
    "/company/{country}/{vat}": {
      "get": {
        "summary": "Full company detail",
        "description": "Identity, form, activity, directors for one company.",
        "parameters": [
          { "name": "country", "in": "path", "required": true, "schema": { "type": "string", "example": "be" } },
          { "name": "vat", "in": "path", "required": true, "schema": { "type": "string", "example": "0403091220" } }
        ],
        "responses": {
          "200": { "description": "Company found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Company" } } } },
          "404": { "description": "No such company", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/company/{country}/{vat}/addresses": {
      "get": {
        "summary": "Company address history",
        "parameters": [
          { "name": "country", "in": "path", "required": true, "schema": { "type": "string", "example": "be" } },
          { "name": "vat", "in": "path", "required": true, "schema": { "type": "string", "example": "0403091220" } }
        ],
        "responses": { "200": { "description": "Address history" } }
      }
    },
    "/financials/{country}/{vat}": {
      "get": {
        "summary": "Filed accounts, year by year",
        "description": "{country} may be omitted (/financials/{vat}) - the server then guesses the country from the id's shape/length - but is strongly recommended, since the same numeric id can be a valid company number in more than one country.",
        "parameters": [
          { "name": "country", "in": "path", "required": true, "schema": { "type": "string", "example": "be" } },
          { "name": "vat", "in": "path", "required": true, "schema": { "type": "string", "example": "0403091220" } }
        ],
        "responses": { "200": { "description": "Financial history" } }
      }
    },
    "/tenders/{country}/{vat}": {
      "get": {
        "summary": "Public procurement notices (TED)",
        "description": "{country} may be omitted (/tenders/{vat}) - the server then guesses the country from the id's shape/length - but is strongly recommended, since the same numeric id can be a valid company number in more than one country.",
        "parameters": [
          { "name": "country", "in": "path", "required": true, "schema": { "type": "string", "example": "be" } },
          { "name": "vat", "in": "path", "required": true, "schema": { "type": "string", "example": "0403091220" } }
        ],
        "responses": { "200": { "description": "Tender notices" } }
      }
    },
    "/publications/{country}/{vat}": {
      "get": {
        "summary": "Official gazette filings",
        "description": "Moniteur Belge (BE), BODACC (FR), or The Gazette (UK), depending on country. {country} may be omitted (/publications/{vat}) - the server then guesses the country from the id's shape/length - but is strongly recommended, since the same numeric id can be a valid company number in more than one country, and omitting it can route a non-Belgian id to the wrong country's fetcher.",
        "parameters": [
          { "name": "country", "in": "path", "required": true, "schema": { "type": "string", "example": "be" } },
          { "name": "vat", "in": "path", "required": true, "schema": { "type": "string", "example": "0403091220" } }
        ],
        "responses": { "200": { "description": "Publication notices" } }
      }
    },
    "/address/{country}/{vat}": {
      "get": {
        "summary": "Everyone at the same address as this company",
        "description": "Companies registered at the same street/number/zip as the given COMPANY, with year-by-year history. Takes a company id, NOT an address string: /address/be/0400542494 answers 'who else is in this company's building' (1367 companies, verified against production). The country prefix is strongly recommended, since the server otherwise guesses the country from the id's shape/length, and the same numeric id can be valid in more than one country. CORRECTED 2026-09-10: this endpoint was previously documented as taking a hyphenated address ('be/1930-Zaventem-Weiveldlaan-19'); that form returns 404, as did the example published here, so anyone following this document got nothing but 404s. The server has always behaved as described above - AtThisAddress.tsx has called it this way since VAT 16/21.",
        "parameters": [
          { "name": "country", "in": "path", "required": true, "schema": { "type": "string" }, "example": "be" },
          { "name": "vat", "in": "path", "required": true, "schema": { "type": "string" }, "example": "0400542494" }
        ],
        "responses": { "200": { "description": "Companies sharing this company's address" } }
      }
    },
    "/similar/{country}/{vat}": {
      "get": {
        "summary": "Similar companies nearby",
        "description": "Companies sharing the subject's primary NACE activity code in the same postcode. Returns 200 with an empty companies[] (not 404) when the company has no activity code or no postcode on file, since 'nothing similar' is a valid answer about a company that does exist. Establishments are excluded - only named enterprises are returned.",
        "parameters": [
          { "name": "country", "in": "path", "required": true, "schema": { "type": "string" }, "example": "be" },
          { "name": "vat", "in": "path", "required": true, "schema": { "type": "string" }, "example": "0403.170.701" },
          { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "example": "5", "default": 6, "maximum": 50 } }
        ],
        "responses": { "200": { "description": "Companies sharing this NACE code in the same postcode" } }
      }
    },
    "/business-centers": {
      "get": {
        "summary": "Addresses hosting many companies",
        "description": "Business centres / domiciliation addresses, ranked by company count.",
        "responses": { "200": { "description": "Business centre list" } }
      }
    },
    "/director": {
      "get": {
        "summary": "Every company a person directs",
        "parameters": [
          { "name": "last", "in": "query", "required": true, "schema": { "type": "string", "example": "Michel" } },
          { "name": "first", "in": "query", "required": false, "schema": { "type": "string", "example": "Louis" } }
        ],
        "responses": { "200": { "description": "Companies this person directs or has directed" } }
      }
    },
    "/nace": {
      "get": {
        "summary": "NACE activity code table",
        "responses": { "200": { "description": "NACE code => label map" } }
      }
    },
    "/forms": {
      "get": {
        "summary": "Legal form code table",
        "responses": { "200": { "description": "Legal form code => label map, per country" } }
      }
    },
    "/coverage": {
      "get": {
        "summary": "Per-country data coverage percentages",
        "responses": { "200": { "description": "Coverage stats" } }
      }
    }
  }
}
