{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/internetdata-io/json-schema/internetdata-io-database-schema.json",
  "title": "Database",
  "description": "One database FAMILY, with your organization's license beside it. A\nlicense covers the family, while a download names a specific version,\nso the IDs passed to `download` and `checksum` come from `versions`.\n",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/internetdata-io-openapi.yaml#/components/schemas/Database",
  "type": "object",
  "required": [
    "base",
    "name",
    "summary",
    "standing",
    "open",
    "license_type",
    "starts",
    "expires",
    "renews_at",
    "notice_due_at",
    "versions"
  ],
  "properties": {
    "base": {
      "type": "string",
      "description": "The family, e.g. `vpn_ip`. What a license is held against."
    },
    "name": {
      "type": "string"
    },
    "summary": {
      "type": "string",
      "description": "One line on what the newest version contains."
    },
    "standing": {
      "$ref": "#/$defs/Standing"
    },
    "open": {
      "type": "boolean",
      "description": "An Open database: free under CC BY-SA 4.0 (credit InternetData,\nhttps://internetdata.io, and share what you build from it under\nthe same license). Every organization holds a `standard` license\nto it from the start, which `standing` and `license_type` report\nlike any other.\n"
    },
    "license_type": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "evaluation",
        "standard",
        "redistribute",
        null
      ],
      "description": "What your license permits you to do with the data. Null when there\nis no license, which is every family with standing `unlicensed`.\n"
    },
    "starts": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "expires": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "A hard stop. Null when the license has no end date, which is the normal case for a rolling agreement, and when there is no license. A rolling license reports its turnover date in renews_at instead."
    },
    "renews_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When a rolling license next renews. Null when the license has no defined term, when expires sets a hard stop instead, and when there is no license."
    },
    "notice_due_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "The last day notice of non-renewal can be given for the term ending at renews_at. Null whenever renews_at is, and when the agreement records no notice period."
    },
    "versions": {
      "type": "array",
      "description": "Every published version of this family, oldest first. Old versions\nare frozen rather than migrated, so both stay downloadable.\n",
      "items": {
        "$ref": "#/$defs/DatabaseVersion"
      }
    }
  },
  "$defs": {
    "DatabaseFormat": {
      "type": "string",
      "description": "A file format a database version is published in.",
      "enum": [
        "csvgz",
        "mmdb"
      ]
    },
    "DatabaseVersion": {
      "type": "object",
      "required": [
        "id",
        "version",
        "summary",
        "formats"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The versioned ID. Pass this to `download`, `checksum` and `metadata`."
        },
        "version": {
          "type": "integer"
        },
        "summary": {
          "type": "string"
        },
        "formats": {
          "type": "array",
          "description": "The formats this version is BUILT in. Asking for another is a 400,\nnot a gap - the `_provider` catalogs are keyed by provider ID, so no\nMMDB exists for them.\n",
          "items": {
            "$ref": "#/$defs/DatabaseFormat"
          }
        },
        "sample_formats": {
          "type": "array",
          "description": "The formats an evaluation sample is published in, if any.",
          "items": {
            "$ref": "#/$defs/DatabaseFormat"
          }
        }
      }
    },
    "Standing": {
      "type": "string",
      "description": "Where your license for a database family stands today. `licensed` is a\nlive grant, `expired` one whose term has ended, and `unlicensed` a\ndatabase published but never bought.\n",
      "enum": [
        "licensed",
        "expired",
        "unlicensed"
      ]
    }
  }
}