Developers

API Documentation

Quickstart · v0.1

Authentication

Send your API key as a bearer token. Anonymous requests work at lower limits; a key unlocks registered-tier quotas.

curl https://data.anka.dev/datasets \
-H "Authorization: Bearer hkda_••••"

Common headers

  • AuthorizationBearer <api-key> for registered access.
  • Accept-Languageen (default), tc, or sc.
  • Content-Type: application/json on POST bodies.

Datasets & endpoints

Every dataset, one JSON surface. Each card below shows the endpoint, how often the source updates, what it returns, and a real sample response. All endpoints accept anonymous requests at lower limits.

Transport

GET/data/transport/mtrReal-time
MTR trains

Live arrival times for the next trains across every MTR line. Updated about once a minute; not cached.

Sample response
{
  "sys_time": "2026-06-14 10:45:33",
  "data": {
    "TML-TIS": {
      "UP": [
        {
          "seq": "1",
          "dest": "TUM",
          "plat": "1",
          "time": "2026-06-14 10:49:29",
          "ttnt": "4"
        }
      ],
      "DOWN": [
        {
          "seq": "1",
          "dest": "HUN",
          "plat": "2",
          "time": "2026-06-14 10:48:02",
          "ttnt": "3"
        }
      ]
    }
  }
}
GET/data/transport/bus/kmb/routeReal-time
KMB & LWB buses

Routes, stops and live ETAs for Kowloon Motor Bus and Long Win Bus. Sub-resources: /route, /stop, /route-stop, /eta/{stop}/{route}/{type}.

Sample response
{
  "type": "RouteList",
  "generated_timestamp": "2026-06-14T10:45:26+08:00",
  "data": [
    {
      "route": "1",
      "bound": "O",
      "service_type": "1",
      "orig_en": "CHUK YUEN ESTATE",
      "dest_en": "STAR FERRY"
    }
  ]
}
GET/data/transport/traffic-camerasReal-time
Traffic cameras

All Transport Department traffic cameras with location and a live snapshot image URL. 1,013 cameras; images refresh continuously.

Sample response
[
  {
    "key": "H429F",
    "region": "Hong Kong Island",
    "district": "Southern",
    "description": "Aberdeen Praya Road near Fish Market",
    "location": {
      "latitude": 22.24845,
      "longitude": 114.1505
    },
    "snapshot_url": "https://tdcctv.data.one.gov.hk/H429F.JPG"
  }
]
GET/data/transport/parking?region=hkYearly
Metered parking spaces

Distribution of metered parking spaces by district and street. Region: hk, kln, nt. Yearly dataset, cached aggressively.

Sample response
[
  {
    "District": "Central & Western",
    "Street": "Des Voeux Road Central",
    "No. of Metered Parking Spaces": 14
  }
]
GET/data/transport/ferry/star-ferryStatic
Star Ferry

Star Ferry timetables and fare tables across its routes. Static, refreshed yearly.

Sample response
{
  "timetable": [
    {
      "Ferry Service Details - Central / Tsim Sha Tsui Service": "0630 - 2330 hours"
    }
  ],
  "faretable": [
    {
      "Fare Type": "Adult",
      "Weekdays (HK$)": 5
    }
  ]
}
GET/data/transport/passenger-trafficDaily
Passenger traffic

Daily inbound/outbound passenger counts at every control point, split by HK residents, Mainland and other visitors. Updated daily.

Sample response
[
  {
    "Date": "01-01-2021",
    "Control Point": "Airport",
    "Arrival / Departure": "Arrival",
    "Hong Kong Residents": 341,
    "Mainland Visitors": 0,
    "Other Visitors": 9,
    "Total": 350
  }
]

Weather & environment

GET/data/weather/temperature?station=HKO&data_type=maxMonthly
Temperatures & rainfall

Daily max / mean / min temperatures and total rainfall from HK Observatory stations. CSV→JSON. data_type: max, mean, min, rainfall.

Sample response
[
  {
    "年/Year": "2024",
    "月/Month": "6",
    "日/Day": "14",
    "數值/Value": "29.8",
    "數據完整性/data Completeness": "C"
  }
]
GET/data/environment/water/riverRecent
Water quality

Recent river and marine water-quality readings from the Environmental Protection Department. type: river, marine.

Sample response
[
  {
    "Water Control Zone": "Deep Bay",
    "River": "River Ganges",
    "Station": "GR1",
    "Sampling Date (MM/YYYY)": "06/2024",
    "Dissolved Oxygen (mg/L)": "7.8"
  }
]

Geography & city

GET/data/address?q=CausewayOn-demand
Address lookup

Structured Hong Kong address search (building, street+number, estate). Returns Chinese and English address components and district.

Sample response
{
  "SuggestedAddress": [
    {
      "Address": {
        "PremisesAddress": {
          "EngPremisesAddress": {
            "BuildingName": "CAUSEWAY TOWER",
            "EngStreet": {
              "StreetName": "CAUSEWAY ROAD",
              "BuildingNoFrom": "16"
            },
            "EngDistrict": {
              "DcDistrict": "WAN CHAI DISTRICT"
            },
            "Region": "HK"
          }
        }
      }
    }
  ]
}
GET/data/city/lamp-postsQuarterly
Lamp posts

Location of every public lighting lamp post maintained by the Highways Department, with coordinates and district.

Sample response
[
  {
    "Lamppost No": "LP00001",
    "District": "Yau Tsim Mong",
    "Type": "High-pressure Sodium",
    "Latitude": 22.3193,
    "Longitude": 114.1694
  }
]
GET/data/geography/historical-mapsStatic
Historical maps

Geo-referenced historical maps of Hong Kong (1889–1970). Returns download URLs for GeoTIFF/ZIP archives — bytes are not proxied.

Sample response
[
  {
    "name": "Plan of the City of Victoria (1889)",
    "year": 1889,
    "format": "GeoTIFF",
    "url": "https://www.landsd.gov.hk/landsd_psi_data/SMO/image/City_of_Victoria_HongKong1889.zip"
  }
]
GET/data/schools/nearest?lat=22.3193&lng=114.1694On-demand
Nearest schools

Schools nearest to a latitude/longitude, with name, category and address. Powered by the data.gov.hk spatial API.

Sample response
[
  {
    "name": "King's College",
    "district": "Central & Western",
    "category": "Aided",
    "address": "63A Bonham Road"
  }
]

Statistics & records

GET/data/statistics/census/:tableIdReference
Census & statistics

~200 Census & Statistics tables — CPI, labour, trade, population, GDP, births, deaths and more. One route covers the lot. tableId e.g. 130-06613, 510-60001.

Sample response
{
  "header": {
    "status": {
      "code": 0,
      "name": "Success"
    },
    "title": "Median monthly household income by type of housing"
  },
  "dataSet": [
    [
      "2024",
      "Q3",
      "25,000",
      "Public rental housing"
    ]
  ]
}
GET/data/holidaysYearly
Public holidays

Hong Kong public holidays (jCal/iCal JSON). Small, static, cached for a week.

Sample response
{
  "vcalendar": [
    {
      "x-wr-calname": "Hong Kong Public Holidays",
      "vevent": [
        {
          "dtstart": "20250101",
          "summary": "The first day of January"
        }
      ]
    }
  ]
}
GET/data/legislature/legco/bills?top=2Reference
Legislative Council

Bills, votes, meetings and questions from LegCo, via its OData API. collection: bills, votes, meetings. top limits rows (≤200).

Sample response
[
  {
    "internal_key": "B2023_04",
    "bill_title_eng": "Adoption (Amendment) Bill 2023",
    "gazette_no": "LN203"
  }
]
GET/data/housing/property-registrations?period=202505Monthly
Property registrations

Land Registry monthly statistics on instruments received for registration. period: YYYYMM.

Sample response
[
  {
    "Year": 2025,
    "Month": 5,
    "Description": "Number of Urban deeds received for registration (ASP Building Units)",
    "Units": "2,968",
    "Consideration (nearest $ million)": "31,278"
  }
]
GET/data/housing/property-market?table=1.1&freq=QQuarterly
Property market

Rating & Valuation Department property market statistics — rents and prices by class and district. table e.g. 1.1; freq: Q (quarterly) or A (annual).

Sample response
[
  {
    "Period": "2025 Q1",
    "Class A - Hong Kong": "12,400",
    "Class B - Hong Kong": "18,100"
  }
]
GET/data/finance/companies?date=20250106&type=LWeekly
Companies registry

Newly incorporated / registered companies from the Companies Registry. date: YYYYMMDD; type: L (long) or F (full).

Sample response
[
  {
    "Seq": "1",
    "Current Company Name in English": "157 New Energy Era (Hong Kong) Technology Co., Limited",
    "Current Company Name in Chinese": "新能時代(香港)科技有限公司",
    "BR Number": "77561081"
  }
]

Recreation

GET/data/recreation/programmesDaily
Recreation programmes

LCSD community recreation and sports programmes with availability, district, dates and fees. Updated daily.

Sample response
[
  {
    "ACTIVITY_NO": "IS250064TEN",
    "EN_PGM_NAME": "Tennis Training Course",
    "EN_DISTRICT": "Islands",
    "PGM_START_DATE": "2026-03-20",
    "FEE": 170,
    "QUOTA": 18,
    "PLACES_LEFT": 0
  }
]

Catalogue & query

GET/datasets?limit=2Catalogue
Datasets

List dataset IDs (paginated) or full metadata with /datasets/:id. Backed by the CKAN catalogue — all 332 datasets.

Sample response
{
  "data": [
    "hk-immd-set5-statistics-daily-passenger-traffic",
    "hk-dpo-als_01-als"
  ],
  "pagination": {
    "total": 332,
    "limit": 2,
    "offset": 0,
    "has_more": true
  }
}
GET/categoriesCatalogue
Categories

The 19 data categories and how many datasets each contains.

Sample response
{
  "data": [
    {
      "name": "commerce-and-industry",
      "title": "Commerce and Industry",
      "package_count": 83
    },
    {
      "name": "transport",
      "title": "Transport",
      "package_count": 19
    }
  ]
}
POST/data/queryOn-demand
Query

Filter any tabular dataset with SQL-like operators (eq, gt, bw, ct, …). Works across every CSV/JSON dataset in the catalogue.

Sample response
{
  "resource": "…daily_passenger_traffic.csv",
  "filters": [
    {
      "column": "Control Point",
      "operator": "eq",
      "value": "Airport"
    }
  ],
  "data": [
    {
      "Date": "01-01-2021",
      "Control Point": "Airport",
      "Total": "350"
    }
  ]
}

Responses

Success returns the resource directly with a 2xx status. Errors return an errorobject — the HTTP status code is the signal, there is no success wrapper.

{ "error": { "code": "QUOTA_EXCEEDED", "message": "…" } }

Rate limits

  • Anonymous — 30 req/min, 1,000 req/month.
  • Registered — 300 req/min, 100,000 req/month.

Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset. Need a key? Create one in the portal.