{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/enterprise-wikimedia-com/json-schema/enterprise-wikimedia-com-snapshot-schema.json",
  "title": "snapshot",
  "description": "Compressed bundle of a project namespace's articles, or of the Wikidata Main Graph's items or properties, as NDJSON, served by the Snapshot endpoints",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/enterprise-wikimedia-com-openapi.yml#/components/schemas/snapshot",
  "type": "object",
  "properties": {
    "identifier": {
      "type": "string",
      "description": "Identifier of the snapshot, combining the project identifier and namespace, e.g. `enwiki_namespace_0`. The Wikidata snapshots are `wikidata_items` and `wikidata_properties`; the Wikidata snapshot endpoints take `items` or `properties` as their `{identifier}` path parameter, not this value"
    },
    "version": {
      "type": "string",
      "description": "Content hash of the snapshot file. Changes whenever the snapshot contents change"
    },
    "date_modified": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of when the snapshot was last updated"
    },
    "in_language": {
      "$ref": "#/$defs/language",
      "description": "Language of the project the snapshot belongs to"
    },
    "is_part_of": {
      "$ref": "#/$defs/project",
      "description": "Project the snapshot belongs to"
    },
    "namespace": {
      "$ref": "#/$defs/article_namespace",
      "description": "Namespace of the articles in the snapshot"
    },
    "size": {
      "$ref": "#/$defs/size",
      "description": "Size of the snapshot file in decimal megabytes (`unit_text` is `MB`). For the exact byte count, use `Content-Length` from a HEAD request on the download endpoint."
    },
    "chunks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identifiers of the chunk files this snapshot is split into for download, e.g. `enwiki_namespace_0_chunk_0`"
    },
    "record_count": {
      "type": "integer",
      "description": "Number of records (NDJSON lines) in the snapshot file. A small number of snapshots on small wikis omit the field. Treat a missing value as unknown, not as zero"
    }
  },
  "$defs": {
    "article_namespace": {
      "type": "object",
      "description": "Namespace the page belongs to",
      "properties": {
        "identifier": {
          "type": "number",
          "description": "Numeric identifier of the namespace. Names and descriptions are available from the Namespaces metadata endpoints"
        }
      }
    },
    "language": {
      "type": "object",
      "description": "Language of a Wikimedia project or article",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "Wikimedia [language code](https://www.wikidata.org/wiki/Help:Wikimedia_language_codes/lists/all) of the language"
        },
        "name": {
          "type": "string",
          "description": "Full name of the language"
        },
        "alternate_name": {
          "type": "string",
          "description": "Alternate name of the language"
        },
        "direction": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "ltr",
            "rtl",
            null
          ],
          "description": "Direction the language is written in, `ltr` (left-to-right) or `rtl` (right-to-left)"
        }
      }
    },
    "project": {
      "type": "object",
      "description": "Wikimedia project a resource belongs to",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "Unique identifier of the project, combining language and project code, e.g. `enwiki` for English Wikipedia"
        },
        "code": {
          "type": "string",
          "description": "Code of the project type, e.g. `wiki` for Wikipedia projects"
        },
        "name": {
          "type": "string",
          "description": "Name of the project"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "URL of the project"
        },
        "in_language": {
          "$ref": "#/$defs/language",
          "description": "Primary language of the project"
        }
      }
    },
    "size": {
      "type": "object",
      "description": "Size of a resource, in the unit given by `unit_text`.",
      "properties": {
        "unit_text": {
          "type": "string",
          "description": "`MB` on snapshots, chunks and batches: decimal megabytes, bytes divided by 1,000,000, to three decimals. `B` on article versions: bytes of wikitext."
        },
        "value": {
          "type": "number",
          "description": "Size in the unit given by `unit_text`. For the exact byte count of a download, use the `Content-Length` header from a HEAD request on its download endpoint."
        }
      }
    }
  }
}