Skip to content Skip to Quick Links

Introduction

Starting from the 2012-2013 session onwards, voting results of the Council, the House Committee and the Finance Committee and its Subcommittees are available in form of open data in XML and JSON format.

The information can be obtained 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 open data web api can be run at:

https://app.legco.gov.hk/vrdb/odata/vVotingResult (JSON format)
https://app.legco.gov.hk/vrdb/odata/vVotingResult?$format=xml (XML format)

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

https://app.legco.gov.hk/vrdb/odata/$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=vote_time
  • $select - select specific fields to be returned, e.g. $select=motion_en,name_en,vote
  • $filter - select specific entries according to provided conditions, e.g. $filter=year(start_date) eq 2014
  • $inlinecount - specify "$inlinecount=allpages" to include the total number of records in the returned 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.