香港开放数据访问服务

version : 1.0.0

list_datasets

Get a list of dataset IDs from data.gov.hk Args: limit: Maximum number of datasets to return (default: 1000) offset: Offset of the first dataset to return language: Language code (en, tc, sc)

limit(null)

offset(null)

language(string)

结果(Result)

get_dataset_details

Get detailed information about a specific dataset Args: dataset_id: The ID or name of the dataset to retrieve language: Language code (en, tc, sc) include_tracking: Add tracking information to dataset and resources

*dataset_id(string)

language(string)

include_tracking(boolean)

结果(Result)

list_categories

Get a list of data categories (groups) Args: order_by: Field to sort by ('name' or 'packages') - deprecated, use sort instead sort: Sorting of results ('name asc', 'package_count desc', etc.) limit: Maximum number of categories to return offset: Offset for pagination all_fields: Return full group dictionaries instead of just names language: Language code (en, tc, sc)

order_by(string)

sort(string)

limit(null)

offset(null)

all_fields(boolean)

language(string)

结果(Result)

get_category_details

Get detailed information about a specific category (group) Args: category_id: The ID or name of the category to retrieve include_datasets: Include a truncated list of the category's datasets include_dataset_count: Include the full package count include_extras: Include the category's extra fields include_users: Include the category's users include_groups: Include the category's sub groups include_tags: Include the category's tags include_followers: Include the category's number of followers language: Language code (en, tc, sc)

*category_id(string)

include_datasets(boolean)

include_dataset_count(boolean)

include_extras(boolean)

include_users(boolean)

include_groups(boolean)

include_tags(boolean)

include_followers(boolean)

language(string)

结果(Result)

search_datasets

Search for datasets by query term using the package_search API. This function searches across dataset titles, descriptions, and other metadata to find datasets matching the query term. Args: query: The solr query string (e.g., "transport", "weather", "*:*" for all) limit: Maximum number of datasets to return (default: 10, max: 1000) offset: Offset for pagination language: Language code (en, tc, sc) Returns: A dictionary containing: - count: Total number of matching datasets - results: List of matching datasets (up to limit) - has_more: Boolean indicating if there are more results available

query(string)

limit(integer)

offset(integer)

language(string)

结果(Result)

get_supported_formats

Get a list of file formats supported by data.gov.hk Returns: A list of supported file formats

结果(Result)

search_datasets_with_facets

Search for datasets and return faceted results for better data exploration. Args: query: The solr query string language: Language code (en, tc, sc) Returns: A dictionary containing: - count: Total number of matching datasets - search_facets: Faceted information about the results - sample_results: First 3 matching datasets

query(string)

language(string)

结果(Result)

get_datasets_by_format

Get datasets that have resources in a specific file format. Args: file_format: The file format to filter by (e.g., "CSV", "JSON", "GeoJSON") limit: Maximum number of datasets to return language: Language code (en, tc, sc) Returns: A dictionary containing: - count: Total number of matching datasets - results: List of matching datasets

*file_format(string)

limit(integer)

language(string)

结果(Result)