HK Data Atlas SDK

以 Python 或 TypeScript 使用香港公共 API。每種語言只需安裝一個 hkdataatlas 套件,按發布機構選用模組。

GitHub · npm · PyPI

TypeScript

npm install hkdataatlas
import { banksBranchLocator } from 'hkdataatlas/hkma';
const response = await banksBranchLocator.getBanksBranchLocator(
  { lang: 'en', pagesize: 1 },
  { signal: AbortSignal.timeout(15000) },
);
console.log(response.status, response.data);

Python

uv add hkdataatlas

或使用 pip:pip install hkdataatlas。

from hkdataatlas.hkma.banks_branch_locator import Client
from hkdataatlas.hkma.banks_branch_locator.api.default import get_banks_branch_locator

with Client(base_url="https://api.hkma.gov.hk/public/bank-svf-info") as client:
    response = get_banks_branch_locator.sync_detailed(client=client, lang="en", pagesize=1)
    print(response.status_code, response.parsed)

以上範例查詢香港金融管理局的銀行分行資料。

查看模組及方法及完整 README,或瀏覽 API 文件。API 的使用條款及供應情況以原發布機構為準。