Skip to content Skip to Quick Links

Introduction

The Hansard Database provides a one-stop search for users' easy retrieval of information on business conducted in Council meetings since the Fifth Legislative Council (2012-2016).

The information of the database can be obtained in the form of open data via web application programming interface (API) as described in this page.

Any comments are welcomed (please e-mail to pid@legco.gov.hk).


Web Application Programming Interface (API)

Note:
  1. For Internet Explorer users, please uncheck "Turn on feed reading view" in the "Settings" of the "Feed and Web slices" section under the "Content" tab of the Internet Options, and then re-start the browser in order to view data in XML format.
  2. Some browsers such as the Internet Explorer will download the data in JSON format instead of displaying them in the browsers. If you encounter such a case, you may download the file and open it with a text editor, or try to use some other browsers such as Chrome.
  3. When Chinese characters are used in a web api command, please perform URL encoding for it first, or use a browser such as Chrome that can encode Chinese characters automatically.

The web api provides the following information:

  1. Hansard (Official records of the proceedings of the Legislative Council)
  2. Sections (Meeting sections)
  3. Subjects (Subjects under discussion)
  4. Speakers (President, Members or designated public officers that make the speech)
  5. Rundown (Agenda of the Council meeting)
  6. Questions (Questions to the Government)
  7. Bills (Government bills or Members’ bills)
  8. Motions (Government motions or Members’ motions)
  9. Petitions (Presentation of petitions)
  10. Addresses (Addresses by the Chief Executive, Members or designated public officers)
  11. Statements (Statements by designated public officers)
  12. VotingResults (Decision on motions or questions put to the Council or Committee of the Whole Council)
  13. SummoningBells (Bells that summon Members when a quorum is not present)

Corresponding to the above information, the open data web api can be run at:

https://app.legco.gov.hk/OpenData/HansardDB/Hansard (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/Hansard?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/Sections (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/Sections?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/Subjects (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/Subjects?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/Rundown (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/Rundown?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/Speakers (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/Speakers?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/Questions (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/Questions?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/Bills (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/Bills?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/Motions (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/Motions?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/Petitions (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/Petitions?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/Addresses (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/Addresses?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/Statements (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/Statements?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/VotingResults (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/VotingResults?$format=xml (XML format)

https://app.legco.gov.hk/OpenData/HansardDB/SummoningBells (JSON format)
https://app.legco.gov.hk/OpenData/HansardDB/SummoningBells?$format=xml (XML format)

To get the meta data schema of the dataset, please run the following:

https://app.legco.gov.hk/OpenData/HansardDB/$metadata

The following query string options can be applied:

  • $format - specify whether the data to be returned in json or xml format, e.g. $format=json
  • $top=N - select only the first N entries of the set, where N is a positive integer, e.g. $top=10
  • $skip=N - select only the remaining entries (starting with Entry N+1) where N is a positive integer, e.g. $skip=10
  • $orderby - what values are used to order the retrieved data, e.g. $orderby=MeetingDate
  • $select - select specific fields to be returned, e.g. $select=MeetingDate,SubjectName,MemberName,HansardFileURL
  • $filter - select specific entries according to provided conditions, e.g. $filter=substringof('Council Meeting',SubjectName) eq true
  • $inlinecount - specify "$inlinecount=allpages" to include the total number of records in the returned data
  • $expand - link up data

For the available operators and functions to be used with $filter option, please refer to the documentation of the Open Data Protocol.


Examples

The following examples illustrate some of the ways to retrieve data according to the Open Data Protocol.