{
  "components": {
    "schemas": {
      "Transaction": {
        "description": "A GSH Flats 2024 sale transaction. The field dictionary identifies the following data fields. The sample represents all values as strings, including numeric-valued fields, while the dictionary calls area and price Numeric; both representations are allowed here to preserve that discrepancy.",
        "properties": {
          "asp_sign_date": {
            "description": "Date of Agreement for Sale and Purchase (ASP). Dictionary format is dd-mm-yyyy; the sample uses 31/07/2025.",
            "type": "string"
          },
          "block_name": {
            "description": "Block name of the purchased flat.",
            "type": "string"
          },
          "court_estate_name": {
            "description": "Court/estate name of the purchased flat.",
            "type": "string"
          },
          "flat_num": {
            "description": "Flat number of the purchased unit.",
            "type": "string"
          },
          "floor_num": {
            "description": "Floor number of the purchased flat.",
            "type": "string"
          },
          "sale_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Sale price of the purchased flat. The dictionary specifies Numeric with pattern-like bound notation 999999999999999.99, while the response example encodes this value as a string."
          },
          "saleable_area": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Saleable area of the purchased flat in square metres. The dictionary specifies Numeric with pattern-like bound notation 9999999.999, while the response example encodes this value as a string."
          },
          "scheme_name": {
            "description": "Subsidised home ownership scheme name.",
            "type": "string"
          },
          "scheme_type": {
            "description": "Subsidised home ownership scheme type. The dictionary identifies GSH.",
            "type": "string"
          },
          "wing": {
            "description": "Wing of the purchased flat.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TransactionsResponse": {
        "description": "JSON response envelope shown in the source example. The example is illustrative and does not establish that the object is otherwise closed or that all fields are universally required.",
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Transaction"
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    }
  },
  "externalDocs": {
    "description": "Official API data specification",
    "url": "https://data.housingauthority.gov.hk/dataset/ssfs/ssfs_sale_transactions_g24_data_dictionary.pdf"
  },
  "info": {
    "description": "Retrieves transactions in the sale of Green Form Subsidised Home Ownership Scheme (GSH) Flats 2024. The publisher documentation is version 1.0 dated 25 February 2026. Authentication is documented as not required. Although Simplified Chinese is listed as a language option, the source says this dataset does not provide Simplified Chinese data and returns Traditional Chinese instead.",
    "title": "Transactions in the Sale of GSH Flats 2024 API",
    "version": "1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/psi/rest/export/{dataresource}/{lang}/{format}": {
      "get": {
        "description": "Returns sales transaction data for the 2024 GSH flats dataset. The documentation lists JSON, CSV, and XML response formats and UTF-8 encoding. The example documents a JSON response envelope containing a data array. The companion dataset page is https://data.gov.hk/en-data/dataset/hk-housing-gsh2024-ssfs-sale-transactions-g24.",
        "operationId": "getGsh2024SaleTransactions",
        "parameters": [
          {
            "description": "Dataset resource identifier. The documented valid value is ssfs-sale-transactions-g24.",
            "in": "path",
            "name": "dataresource",
            "required": true,
            "schema": {
              "enum": [
                "ssfs-sale-transactions-g24"
              ],
              "type": "string"
            }
          },
          {
            "description": "Response language. The source lists en (English), tc (Traditional Chinese), and sc (Simplified Chinese); it also states that this dataset does not provide Simplified Chinese and returns Traditional Chinese data instead.",
            "in": "path",
            "name": "lang",
            "required": true,
            "schema": {
              "enum": [
                "en",
                "tc",
                "sc"
              ],
              "type": "string"
            }
          },
          {
            "description": "Requested file format.",
            "in": "path",
            "name": "format",
            "required": true,
            "schema": {
              "enum": [
                "json",
                "csv",
                "xml"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "documentedExample": {
                    "summary": "Documented JSON response example",
                    "value": {
                      "data": [
                        {
                          "asp_sign_date": "31/07/2025",
                          "block_name": "BLOCK C",
                          "court_estate_name": "WANG CHI COURT",
                          "flat_num": "11",
                          "floor_num": "27",
                          "sale_price": "3244100.0",
                          "saleable_area": "43.3",
                          "scheme_name": " Sale of Green Form Subsidised Home Ownership Scheme Flats 2024 (including Sale of Recovered Flats from Estates under Tenants Purchase Scheme)",
                          "scheme_type": "GSH",
                          "wing": ""
                        }
                      ]
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/TransactionsResponse"
                }
              },
              "application/xml": {
                "schema": {
                  "description": "XML response; the source documents the format but does not specify its serialized structure.",
                  "type": "string"
                }
              },
              "text/csv": {
                "schema": {
                  "description": "CSV response; the source documents the format but does not specify its serialized structure.",
                  "type": "string"
                }
              }
            },
            "description": "Success. The documented response formats are JSON, CSV, and XML. The JSON example has a data array; a representative transaction object and the field dictionary are provided for JSON."
          },
          "400": {
            "description": "Bad Request."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "summary": "Get GSH Flats 2024 sale transactions"
      }
    }
  },
  "servers": [
    {
      "url": "https://data.housingauthority.gov.hk"
    }
  ]
}
