{
 "openapi": "3.1.0",
 "info": {
  "title": "Open Company Atlas API",
  "version": "1.0.0",
  "summary": "Read-only look-ups in the Open Company Atlas.",
  "description": "Public company profiles, search, statistics and open positions of the Open Company Atlas. No sign-in. Limits: 100 requests per day and address (search 50), 10 per minute. No contact details, no persons, no register numbers, no raw attributes and no lists of connections are returned. Documentation: https://opencompanyatlas.com/en/api/",
  "license": {
   "name": "CC BY 4.0",
   "identifier": "CC-BY-4.0"
  },
  "contact": {
   "name": "Open Company Atlas",
   "url": "https://opencompanyatlas.com/en/support/"
  }
 },
 "servers": [
  {
   "url": "https://opencompanyatlas.com"
  }
 ],
 "paths": {
  "/api/v1/company/{id}": {
   "get": {
    "operationId": "getCompany",
    "summary": "One company by number",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Company number (the number at the end of the profile address).",
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The company.",
      "headers": {
       "X-RateLimit-Limit": {
        "schema": {
         "type": "integer"
        },
        "description": "Daily limit for this endpoint group."
       },
       "X-RateLimit-Remaining": {
        "schema": {
         "type": "integer"
        },
        "description": "Requests left today."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CompanyResponse"
        }
       }
      }
     },
     "404": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded (100 per day, 50 for search, 10 per minute per address).",
      "headers": {
       "Retry-After": {
        "schema": {
         "type": "integer"
        },
        "description": "Seconds to wait."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "API switched off.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/company": {
   "get": {
    "operationId": "getCompanyByDomain",
    "summary": "One company by domain",
    "parameters": [
     {
      "name": "domain",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Host name such as example.com (also a former or second domain of the company)."
     }
    ],
    "responses": {
     "200": {
      "description": "The company.",
      "headers": {
       "X-RateLimit-Limit": {
        "schema": {
         "type": "integer"
        },
        "description": "Daily limit for this endpoint group."
       },
       "X-RateLimit-Remaining": {
        "schema": {
         "type": "integer"
        },
        "description": "Requests left today."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CompanyResponse"
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded (100 per day, 50 for search, 10 per minute per address).",
      "headers": {
       "Retry-After": {
        "schema": {
         "type": "integer"
        },
        "description": "Seconds to wait."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "API switched off.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/company/{id}/jobs": {
   "get": {
    "operationId": "getCompanyJobs",
    "summary": "Open positions of one company (at most 50)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Company number (the number at the end of the profile address).",
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Open positions.",
      "headers": {
       "X-RateLimit-Limit": {
        "schema": {
         "type": "integer"
        },
        "description": "Daily limit for this endpoint group."
       },
       "X-RateLimit-Remaining": {
        "schema": {
         "type": "integer"
        },
        "description": "Requests left today."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/JobsResponse"
        }
       }
      }
     },
     "404": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded (100 per day, 50 for search, 10 per minute per address).",
      "headers": {
       "Retry-After": {
        "schema": {
         "type": "integer"
        },
        "description": "Seconds to wait."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "API switched off.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/search": {
   "get": {
    "operationId": "searchCompanies",
    "summary": "Search (at most 20 results, no paging)",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 80
      },
      "description": "Name, domain, product, brand or activity."
     },
     {
      "name": "country",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z]{2}$",
       "description": "ISO 3166-1 alpha-2 country code, e.g. DE."
      }
     },
     {
      "name": "nace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "NACE section letter (A-U) or code prefix such as 25, 25.1, 25.11."
     }
    ],
    "responses": {
     "200": {
      "description": "Results.",
      "headers": {
       "X-RateLimit-Limit": {
        "schema": {
         "type": "integer"
        },
        "description": "Daily limit for this endpoint group."
       },
       "X-RateLimit-Remaining": {
        "schema": {
         "type": "integer"
        },
        "description": "Requests left today."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SearchResponse"
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded (100 per day, 50 for search, 10 per minute per address).",
      "headers": {
       "Retry-After": {
        "schema": {
         "type": "integer"
        },
        "description": "Seconds to wait."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "API switched off.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/stats": {
   "get": {
    "operationId": "getStats",
    "summary": "Company counts by country and NACE section",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z]{2}$",
       "description": "ISO 3166-1 alpha-2 country code, e.g. DE."
      },
      "description": "Omit for the world overview."
     },
     {
      "name": "section",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z]$"
      },
      "description": "NACE section letter; needs country."
     }
    ],
    "responses": {
     "200": {
      "description": "Statistics.",
      "headers": {
       "X-RateLimit-Limit": {
        "schema": {
         "type": "integer"
        },
        "description": "Daily limit for this endpoint group."
       },
       "X-RateLimit-Remaining": {
        "schema": {
         "type": "integer"
        },
        "description": "Requests left today."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/StatsResponse"
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded (100 per day, 50 for search, 10 per minute per address).",
      "headers": {
       "Retry-After": {
        "schema": {
         "type": "integer"
        },
        "description": "Seconds to wait."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "API switched off.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Envelope": {
    "type": "object",
    "properties": {
     "license": {
      "const": "CC BY 4.0"
     },
     "licenseUrl": {
      "type": "string",
      "format": "uri"
     },
     "attribution": {
      "type": "string"
     }
    }
   },
   "Error": {
    "type": "object",
    "required": [
     "error"
    ],
    "properties": {
     "license": {
      "type": "string"
     },
     "attribution": {
      "type": "string"
     },
     "error": {
      "type": "object",
      "required": [
       "code",
       "message"
      ],
      "properties": {
       "code": {
        "type": "string"
       },
       "message": {
        "type": "string"
       }
      }
     }
    }
   },
   "Nace": {
    "type": [
     "object",
     "null"
    ],
    "properties": {
     "code": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "scheme": {
      "type": "string"
     },
     "note": {
      "type": "string"
     }
    }
   },
   "Company": {
    "type": "object",
    "required": [
     "id",
     "name",
     "domain",
     "profile_url",
     "open_jobs",
     "connections"
    ],
    "properties": {
     "id": {
      "type": "integer"
     },
     "name": {
      "type": "string"
     },
     "domain": {
      "type": "string"
     },
     "website": {
      "type": [
       "string",
       "null"
      ]
     },
     "country": {
      "type": [
       "string",
       "null"
      ]
     },
     "country_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "region": {
      "type": [
       "string",
       "null"
      ]
     },
     "city": {
      "type": [
       "string",
       "null"
      ]
     },
     "nace": {
      "$ref": "#/components/schemas/Nace"
     },
     "isicV4": {
      "type": [
       "string",
       "null"
      ]
     },
     "description": {
      "type": "object",
      "properties": {
       "en": {
        "type": [
         "string",
         "null"
        ]
       },
       "de": {
        "type": [
         "string",
         "null"
        ]
       }
      }
     },
     "foundingYear": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Only if the company states it on its website and the passage is kept as evidence."
     },
     "profile_url": {
      "type": "string",
      "format": "uri"
     },
     "open_jobs": {
      "type": "integer"
     },
     "connections": {
      "type": "integer",
      "description": "Number of other atlas companies named as customer, partner or dealer, or naming this company. Count only."
     }
    }
   },
   "CompanyResponse": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Envelope"
     },
     {
      "type": "object",
      "required": [
       "company"
      ],
      "properties": {
       "company": {
        "$ref": "#/components/schemas/Company"
       }
      }
     }
    ]
   },
   "Job": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "title": {
      "type": "string"
     },
     "location": {
      "type": [
       "string",
       "null"
      ]
     },
     "url": {
      "type": "string",
      "format": "uri"
     },
     "datePosted": {
      "type": "string",
      "format": "date"
     },
     "validThrough": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "JobsResponse": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Envelope"
     },
     {
      "type": "object",
      "properties": {
       "company_id": {
        "type": "integer"
       },
       "count": {
        "type": "integer"
       },
       "total_open": {
        "type": "integer"
       },
       "jobs": {
        "type": "array",
        "maxItems": 50,
        "items": {
         "$ref": "#/components/schemas/Job"
        }
       },
       "note": {
        "type": "string"
       }
      }
     }
    ]
   },
   "SearchResult": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "name": {
      "type": "string"
     },
     "domain": {
      "type": "string"
     },
     "country": {
      "type": [
       "string",
       "null"
      ]
     },
     "region": {
      "type": [
       "string",
       "null"
      ]
     },
     "city": {
      "type": [
       "string",
       "null"
      ]
     },
     "nace": {
      "type": [
       "object",
       "null"
      ],
      "properties": {
       "code": {
        "type": "string"
       },
       "name": {
        "type": "string"
       }
      }
     },
     "matched_on": {
      "enum": [
       "name",
       "domain",
       "product",
       "brand",
       "activity",
       "text"
      ]
     },
     "profile_url": {
      "type": "string",
      "format": "uri"
     }
    }
   },
   "SearchResponse": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Envelope"
     },
     {
      "type": "object",
      "properties": {
       "query": {
        "type": "object"
       },
       "count": {
        "type": "integer"
       },
       "results": {
        "type": "array",
        "maxItems": 20,
        "items": {
         "$ref": "#/components/schemas/SearchResult"
        }
       },
       "more_matches_exist": {
        "type": "boolean"
       },
       "partial": {
        "type": "boolean"
       },
       "note": {
        "type": "string"
       }
      }
     }
    ]
   },
   "StatsResponse": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Envelope"
     },
     {
      "type": "object",
      "properties": {
       "stats": {
        "type": "object",
        "properties": {
         "scope": {
          "enum": [
           "world",
           "country",
           "section"
          ]
         },
         "country": {
          "type": [
           "string",
           "null"
          ]
         },
         "section": {
          "type": [
           "string",
           "null"
          ]
         },
         "companies": {
          "type": "integer"
         },
         "as_of": {
          "type": "string",
          "format": "date"
         },
         "page_url": {
          "type": "string",
          "format": "uri"
         },
         "sections": {
          "type": "array",
          "items": {
           "type": "object"
          }
         },
         "countries": {
          "type": "array",
          "items": {
           "type": "object"
          }
         },
         "regions": {
          "type": "array",
          "items": {
           "type": "object"
          }
         },
         "classes": {
          "type": "array",
          "items": {
           "type": "object"
          }
         },
         "divisions": {
          "type": "array",
          "items": {
           "type": "object"
          }
         },
         "job_postings": {
          "type": "integer"
         }
        }
       }
      }
     }
    ]
   }
  }
 }
}