====== Address Lookup Service ======
The Hong Kong Government Address Lookup Service take a HTTP get request, and return the look up result in the default XML format, or JSON format. The addresses information for this API is supposed to be updated every month.
===== Basic Request and Result =====
The request URL is ''https://www.als.ogcio.gov.hk/lookup?q='', and the input could be any free text related to the address you are looking up, such as the street number, street name, building name, estate name, etc... The more correct information your provided in the query, the more accurate the results would be returned.
Assume you want to search the street number for ''100'', but since the query input is a free text, it might not understand the ''100'' is the street number or a part of the building name, and so it will give your any result related to your input.
https://www.als.ogcio.gov.hk/lookup?q=THE_ADDRESS_IN_FREE_TEXT
==== Example 1: ====
Searching for the building ''The One'' [[https://www.als.ogcio.gov.hk/lookup?q=the%20one]]
https://www.als.ogcio.gov.hk/lookup?q=the%20one
Result: (With the first one is what I am looking for)
the_one
THE ONE
NATHAN ROAD
100
YTM
KLN
817874
835811
22.2998
114.1724
817879
835833
22.2998
114.1726
.
.
.
==== Example 2 ====
Searching for the ''100 Nathan'' [[https://www.als.ogcio.gov.hk/lookup?q=100%20nathan]]
https://www.als.ogcio.gov.hk/lookup?q=100%20nathan
Result: (With the first one is what I am looking for)
100 nathan
THE ONE
NATHAN ROAD
100
YTM
KLN
817874
835811
22.2998
114.1724
817879
835833
22.2998
114.1726
.
.
.
===== Options =====
==== In HTTP Header ====
''Accept'' - Control the result in XML or JSON. The default option is ''application/xml'', but it could be changed to ''application/json'' for JSON result.
''Accept-Encoding'' - ''gzip'' if you want to the result to be zipped. The default option is no compression.
''Accept-Language'' - The query result language. Default is both Chinese and English, but it could change to either accept ''en'' for English, or ''zh-Hant'' for Traditional Chinese.
==== In Request Query ====
''n'' - Number of the address records to be returned. The following example force the number of returned result to be 1.
https://www.als.ogcio.gov.hk/lookup?q=100%20nathan&n=1
===== Additional Resource =====
The documentation of this API: [[https://www.als.ogcio.gov.hk/docs/Data_Dictionary_for_ALS_EN.pdf]]