Historical Datasets

This page provides access to the past records of datasets on DATA.GOV.HK.

Please make your selection criteria on the left side and then click [Add to Cart] on the right side to select historical data for download under the [Download Cart].
    The download cart is empty


    1. Historical Archive File List API

    API endpoint:
    https://api.data.gov.hk/v1/historical-archive/list-files

    HTTP Request Method: GET

    Retrieves a list of files that are available within the given period specified in start and end and match the values specified in the category, provider and format parameters.

    At most max number of results will be returned, with the first number of skip items omitted. Pagination can be achieved by utilizing these two parameters.

    Status code 200 will be returned along with a list of file and the total result count in JSON format if it is a successful call.
    Status code 400 will be returned along with a list of error in JSON format if the request contains syntax error(s) such as missing required parameter.

    Parameter Description Required
    start Start data of a period (inclusive) in YYYYMMDD format, e.g.: 20160101 Yes
    end End data of a period (inclusive) in YYYYMMDD format, e.g.: 20161231 Yes
    category Category ID, e.g.: information-technology-and-broadcasting.
    The full list of the Category ID is listed below:
    Category ID Category Description
    city-management City Management
    climate-and-weather Climate and Weather
    commerce-and-industry Commerce and Industry
    development Development
    education Education
    employment-and-labour Employment and Labour
    environment Environment
    finance Finance
    food Food
    health Health
    housing Housing
    information-technology-and-broadcasting IT and Broadcasting
    law-and-security Law and Security
    population Population
    recreation-and-culture Recreation and Culture
    social-welfare Social Welfare
    transport Transport
    miscellaneous Miscellaneous
    No
    provider Provider ID, e.g.: hk-ogcio.
    The full list of the Provider ID is listed below:
    Provider ID Provider Name
    hk-afcd Agriculture, Fisheries and Conservation Department
    hk-archsd Architectural Services Department
    hk-bd Buildings Department
    hk-cad Civil Aviation Department
    hk-cedd Civil Engineering and Development Department
    hk-censtatd Census and Statistics Department
    hk-ceo Chief Executive's Office
    hk-cr Companies Registry
    hk-csd Correctional Services Department
    hk-customs Customs and Excise Department
    hk-dh Department of Health
    hk-devb Development Bureau
    hk-edb Education Bureau
    hk-emsd Electrical and Mechanical Services Department
    hk-epd Environmental Protection Department
    hk-eu Efficiency Unit
    hk-fehd Food and Environmental Hygiene Department
    hk-fso Financial Secretary's Office
    hk-fstb Financial Services and the Treasury Bureau
    hk-gld Government Logistics Department
    hk-govtlab Government Laboratory
    hk-gpa Government Property Agency
    hk-hko Hong Kong Observatory
    hk-hkpf Hong Kong Police Force
    hk-housing Hong Kong Housing Authority
    hk-ipd Intellectual Property Department
    hk-ird Inland Revenue Department
    hk-isd Information Services Department
    hk-itc Innovation and Technology Commission
    hk-landsd Lands Department
    hk-lcsd Leisure and Cultural Services Department
    hk-lr Land Registry
    hk-md Marine Department
    hk-oci Office of the Commissioner of Insurance
    hk-ofca Office of the Communications Authority
    hk-ofnaa Office for Film, Newspaper and Article Administration
    hk-ogcio Office of the Government Chief Information Officer
    hk-oro Official Receiver's Office
    hk-reo Registration and Electoral Office
    hk-rthk Radio Television Hong Kong
    hk-rvd Rating and Valuation Department
    hk-swd Social Welfare Department
    hk-td Transport Department
    hk-tid Trade and Industry Department
    hk-try Treasury
    hk-ugc University Grants Committee Secretariat
    hk-wfsfaa Working Family and Student Financial Assistance Agency
    centaline Centaline Property Agency Limited
    clp CLP Power Hong Kong Limited
    hkelectric The Hongkong Electric Company, Limited
    mtr MTR Corporation Limited
    rehabsociety The Hong Kong Society for Rehabilitation
    hktramways Hong Kong Tramways, Limited
    No
    format File format, in its file format extension, e.g.: xls. No
    search Keyword search. Only the matching results with the dataset/resource names will be returned. No
    order Sort order. Valid options are: dataset-en, dataset-tc, dataset-sc, resource-en, resource-tc, resource-sc and url. Default is by url.

    The -en/-tc/-sc suffix denotes the respective language field for ordering.

    The results can be sorted by:
    1. dataset name and resource name - if order is by dataset-en, dataset-tc or dataset-sc.
    2. resource name - if order is by resource-en, resource-tc or resource-sc.
    3. URL, if order is by url.
    No
    skip The first x number of records to omit. No
    max Maximum number of records to return. Default is 500, maximum is 500. No

    2. Historical Archive File Version API

    API endpoint:
    https://api.data.gov.hk/v1/historical-archive/list-file-versions

    HTTP Request Method: GET

    Retrieves the list of historical version of a file (given in url) within a date period (given in start and end).
    Only the first 10,000 results will be returned.

    Status code 200 will be returned along with a list of historical version timestamps, total count and the total size in bytes in JSON format if it is a successful call.
    Status code 400 will be returned along with a list of error in JSON format if the request contains syntax error(s) such as missing required parameter.

    Parameter Description Required
    url URL of a file, the URL can be found from the Historical Archive File List API result above. Yes
    start Start data of a date range (inclusive) in YYYYMMDD format, e.g.: 20160101. Yes
    end End data of a date range (inclusive) in YYYYMMDD format, e.g.: 20161231. Yes

    3. Historical Archive File Download API

    API endpoint:
    https://api.data.gov.hk/v1/historical-archive/get-file

    HTTP Request Method: GET

    Retrieves a historical version of a specific file (given in url) based on the given time.

    Status code 302 will be returned if it is a successful call, the requester should then follow the redirection and receive a Status code 200 along with the requesting file.
    Status code 400 will be returned along with a list of error in JSON format if the request contains syntax error(s) such as missing required parameter.
    Status code 404 will be returned along with a list of error in JSON format if the requesting historical version of the file is not available.

    Parameter Description Required
    url URL of a file, the URL can be found in the Historical Archive File List API result. Yes
    time Exact date and time of an archived file in YYYYMMDD-hhmm format, e.g.: 20160101-0000. Yes

    4. Historical Archive Schema Download API

    API endpoint:
    https://api.data.gov.hk/v1/historical-archive/get-schema

    HTTP Request Method: GET

    Retrieves a historical version of a specific schema (given in its dataset url) based on the given date.

    Status code 302 will be returned if it is a successful call, the requester should then follow the redirection and receive a Status code 200 along with the requesting file.
    Status code 400 will be returned along with a list of error in JSON format if the request contains syntax error(s) such as missing required parameter.
    Status code 404 will be returned along with a list of error in JSON format if the requesting historical version of the file is not available.

    Parameter Description Required
    url URL of a dataset. Yes
    date Date in YYYYMMDD format, e.g.: 20160101. Yes

    5. Historical Archive Data Dictionary Download API

    API endpoint:
    https://api.data.gov.hk/v1/historical-archive/get-data-dictionary

    HTTP Request Method: GET

    Retrieves a historical version of a specific data dictionary (given in its dataset url) based on the given date.

    Status code 302 will be returned if it is a successful call, the requester should then follow the redirection and receive a Status code 200 along with the requesting file.
    Status code 400 will be returned along with a list of error in JSON format if the request contains syntax error(s) such as missing required parameter.
    Status code 404 will be returned along with a list of error in JSON format if the requesting historical version of the file is not available.

    Parameter Description Required
    url URL of a dataset. Yes
    date Date in YYYYMMDD format, e.g.: 20160101. Yes