{
  "components": {
    "schemas": {
      "SaleTransaction": {
        "description": "Sale transaction record. Dictionary field types are given as text or numeric; the documented JSON example represents the numeric area and price as strings. Both representations are allowed here to preserve that discrepancy.",
        "properties": {
          "asp_sign_date": {
            "description": "Date of Agreement for Sale and Purchase (ASP). The dictionary specifies the date pattern dd-mm-yyyy, while the documented JSON example uses 15/01/2025; the example representation is retained without imposing a conflicting format.",
            "examples": [
              "15/01/2025"
            ],
            "type": "string"
          },
          "block_name": {
            "description": "Block name of the purchased flat.",
            "examples": [
              "BLOCK A"
            ],
            "type": "string"
          },
          "court_estate_name": {
            "description": "Court or estate name of the purchased flat.",
            "examples": [
              "SIU WU COURT"
            ],
            "type": "string"
          },
          "flat_num": {
            "description": "Flat number of the purchased flat.",
            "examples": [
              "16"
            ],
            "type": "string"
          },
          "floor_num": {
            "description": "Floor number of the purchased flat.",
            "examples": [
              "10"
            ],
            "type": "string"
          },
          "sale_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Sale price of the purchased flat. The dictionary specifies numeric with a stated pattern/precision of 999999999999999.99, but the documented JSON example represents this value as a string.",
            "examples": [
              "2382300.0"
            ]
          },
          "saleable_area": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Saleable area of the purchased flat in square meters. The dictionary specifies numeric with a stated pattern/precision of 9999999.999, but the documented JSON example represents this value as a string.",
            "examples": [
              "37.4"
            ]
          },
          "scheme_name": {
            "description": "Subsidised home ownership scheme name.",
            "examples": [
              "Sale of Home Ownership Scheme Flats 2024"
            ],
            "type": "string"
          },
          "scheme_type": {
            "description": "Subsidised home ownership scheme type. The documented possible value is HOS.",
            "examples": [
              "HOS"
            ],
            "type": "string"
          },
          "wing": {
            "description": "Wing of the purchased flat.",
            "examples": [
              ""
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "TransactionsResponse": {
        "description": "JSON response wrapper shown in the documented example. The example does not establish that this is a complete response contract.",
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SaleTransaction"
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    }
  },
  "externalDocs": {
    "description": "Official API data specification",
    "url": "https://data.housingauthority.gov.hk/dataset/ssfs/ssfs_sale_transactions_024_data_dictionary.pdf"
  },
  "info": {
    "description": "API documentation version 1.0, dated 14 October 2025. Returns sales transaction data for 2024 HOS flats. Authentication is not required. The Simplified Chinese language selection returns Traditional Chinese data because Simplified Chinese data is not provided.",
    "title": "Transactions in the Sale of Home Ownership Scheme (HOS) Flats 2024",
    "version": "1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/export/{dataresource}/{lang}/{format}": {
      "get": {
        "description": "Returns transaction data for the Sale of Home Ownership Scheme Flats 2024. The documented response formats are JSON, CSV, and XML; response encoding is UTF-8.",
        "operationId": "getHosFlats2024SaleTransactions",
        "parameters": [
          {
            "description": "Dataset resource identifier.",
            "example": "ssfs-sale-transactions-024",
            "in": "path",
            "name": "dataresource",
            "required": true,
            "schema": {
              "const": "ssfs-sale-transactions-024",
              "type": "string"
            }
          },
          {
            "description": "Response language. The Simplified Chinese selection returns Traditional Chinese data because this dataset does not provide Simplified Chinese data.",
            "examples": {
              "english": {
                "value": "en"
              },
              "simplifiedChineseSelection": {
                "value": "sc"
              },
              "traditionalChinese": {
                "value": "tc"
              }
            },
            "in": "path",
            "name": "lang",
            "required": true,
            "schema": {
              "enum": [
                "en",
                "tc",
                "sc"
              ],
              "type": "string"
            }
          },
          {
            "description": "Requested response file format.",
            "examples": {
              "csv": {
                "value": "csv"
              },
              "json": {
                "value": "json"
              },
              "xml": {
                "value": "xml"
              }
            },
            "in": "path",
            "name": "format",
            "required": true,
            "schema": {
              "enum": [
                "json",
                "csv",
                "xml"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "documentedJsonResponse": {
                    "summary": "Documented JSON response example",
                    "value": {
                      "data": [
                        {
                          "asp_sign_date": "15/01/2025",
                          "block_name": "BLOCK A",
                          "court_estate_name": "SIU WU COURT",
                          "flat_num": "16",
                          "floor_num": "10",
                          "sale_price": "2382300.0",
                          "saleable_area": "37.4",
                          "scheme_name": "Sale of Home Ownership Scheme Flats 2024",
                          "scheme_type": "HOS",
                          "wing": ""
                        }
                      ]
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/TransactionsResponse"
                }
              },
              "application/xml": {
                "schema": {
                  "description": "XML file response; the detailed XML structure is not specified.",
                  "type": "string"
                }
              },
              "text/csv": {
                "schema": {
                  "description": "CSV file response; the detailed CSV structure is not specified.",
                  "type": "string"
                }
              }
            },
            "description": "Success. For JSON, the response is an object containing a data array of sale transaction records. The documented response formats also include CSV and XML; their detailed response structures are not specified."
          },
          "400": {
            "description": "Bad Request."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "summary": "Get HOS flats 2024 sale transactions"
      }
    }
  },
  "servers": [
    {
      "url": "https://data.housingauthority.gov.hk/psi/rest"
    }
  ]
}
