{
  "id": "th_district_code",
  "kind": "datatype",
  "status": "draft",
  "name": "Thai district code (amphoe, khet)",
  "doc": "Four-digit code of a district of Thailand (amphoe, or khet in Bangkok): the two-digit province code (th_province_code) and two digits of the district, as in 1001 for Phra Nakhon and 1030 for Chatuchak in Bangkok. The open data of the Bangkok Metropolitan Administration carries it in a column named dcode beside the district name.",
  "is_pii": false,
  "categories": [
    "geo",
    "government"
  ],
  "country": [
    "TH"
  ],
  "langs": [
    "common"
  ],
  "classification": "identifier",
  "regexp": "^(?:1[0-9]|2[0-7]|[34][0-9]|5[0-8]|6[0-7]|7[0-7]|8[0-6]|9[0-6])\\d{2}$",
  "examples": [
    {
      "value": "1001",
      "description": "Phra Nakhon district, Bangkok",
      "valid": true
    },
    {
      "value": "1030",
      "description": "Chatuchak district, Bangkok",
      "valid": true
    },
    {
      "value": "8301",
      "description": "Mueang Phuket district",
      "valid": true
    },
    {
      "value": "2801",
      "description": "28 is not a province code",
      "valid": false
    }
  ],
  "links": [
    {
      "type": "wikipedia",
      "url": "https://en.wikipedia.org/wiki/List_of_districts_of_Bangkok"
    }
  ],
  "translations": {
    "th": {
      "name": "รหัสอำเภอ"
    },
    "ru": {
      "name": "Код района Таиланда (ампхе, кхет)"
    }
  },
  "detected_by": {
    "tools": [
      "metacrafter"
    ],
    "metacrafter_rules": [
      {
        "rule": "thdistrictcodebyname",
        "type": "field",
        "match": "regex",
        "file": "th/th_codes.yaml"
      }
    ]
  },
  "quality": {
    "score": 90,
    "missing": [
      "mapping (Wikidata, Schema.org, ...)"
    ]
  },
  "source": {
    "path": "data/datatypes/TH/geo/th_district_code.yaml",
    "url": "https://github.com/apicrafter/metacrafter-registry/blob/main/data/datatypes/TH/geo/th_district_code.yaml",
    "edit_url": "https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/TH/geo/th_district_code.yaml"
  },
  "urls": {
    "html": "https://registry.apicrafter.io/datatype/th_district_code",
    "json": "https://registry.apicrafter.io/api/v1/datatypes/th_district_code.json"
  }
}