package_list API
To get the full dataset list, the package_list
API can be used:
https://data.gov.hk/en-data/api/3/action/package_list
package_list
API can be used with two optional parameters: limit
and offset
.
limit (int)
: Sets the maximum number of dataset to be returned.
offset (int)
: Sets the offset of the first dataset to be returned, use with limit.
For example, if we want to get the first 10 datasets starting from the 5th datasets in English, we can call https://data.gov.hk/en-data/api/3/action/package_list?limit=10&offset=5
The returned JSON will look similar to:
{
"help": "Return a list of the names of the site’s datasets (packages).\n\n …",
"result": [
"centaline-centanetod-ccipropertyinfo",
"clp-team1-electric-vehicle-charging-location",
"hk-afcd-afcdlist-pesticides-licensee-1",
"hk-afcd-afcdlist-pesticides-licensee-2",
…
],
"success": true
}
Tip: Dataset IDs returned in the result array can be used in other APIs for further processing.