@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api BC Data Catalogue API
@base https://catalogue.data.gov.bc.ca/api/3
@version 3.0.1
@auth OAuth2 | ApiKey ckan_api_key in header
@endpoints 22
@hint download_for_search
@toc action(22)

@endpoint GET /action/tag_list
@desc Get a list of tags
@optional {offset: int=0 # The offset (index) of the first tag to return, limit: int=100 # The number of tags to be returned per page}
@returns(200) List of tags

@endpoint GET /action/status_show
@desc Get the site status
@returns(200) Returns the site status, version, installed extensions

@endpoint GET /action/package_list
@desc Get a list of all packages (datasets)
@optional {offset: int=0 # The offset (index) of the first package to return, limit: int=100 # The number of packages to be returned per page}
@returns(200) List of packages

@endpoint GET /action/package_search
@desc Find packages (datasets) matching query terms
@optional {q: str="Okanagan Lake" # A query string}
@returns(200) List of packages

@endpoint GET /action/package_show
@desc Get metadata about one specific package (dataset)
@optional {id: str=grizzly-bear-population-units # The package name}
@returns(200) A package metadata object

@endpoint GET /action/package_activity_list
@desc Get the activity stream of a package (dataset)
@optional {id: str=grizzly-bear-population-units # The id or name of the package, offset: int=0 # Where to start getting activity items from, limit: int=31 # The maximum number of activities to return}
@returns(200) List of activities

@endpoint GET /action/package_activity_list_html
@desc Get the activity stream of a package (dataset), HTML format
@optional {id: str=grizzly-bear-population-units # The id or name of the package, offset: int=0 # Where to start getting activity items from, limit: int=31 # The maximum number of activities to return}
@returns(200) List of activities rendered as HTML snippet

@endpoint GET /action/package_autocomplete
@desc Find packages (datasets) matching a query
@optional {q: str="Okanagan Lake" # The string to query, limit: int=10 # The maximum number of resource formats to return}
@returns(200) List of datasets that match a string

@endpoint GET /action/package_relationships_list
@desc Get package (dataset) relationships
@optional {id: str=grizzly-bear-population-units # The id or name of the first package, id2: str=important-fossil-areas # The id or name of the second package, rel: str # relationship as string}
@returns(200) List of dataset relationships

@endpoint GET /action/package_revision_list
@desc Get list of revisions for a package (dataset)
@optional {id: str=grizzly-bear-population-units # The id or name of the dataset}
@returns(200) List of dataset revisions

@endpoint GET /action/organization_activity_list
@desc Get the activity stream of an organization
@optional {id: str=ministry-of-agriculture # The id or name of the organization}
@returns(200) List of an organization's activities

@endpoint GET /action/organization_activity_list_html
@desc Get the activity stream of an organization, HTML format
@optional {id: str=ministry-of-agriculture # The id or name of the organization}
@returns(200) List of an organization's activities in HTML

@endpoint GET /action/organization_follower_count
@desc Get number of followers of an organization
@optional {id: str=ministry-of-agriculture # The id or name of the organization}
@returns(200) Count of organization followers

@endpoint GET /action/organization_follower_list
@desc Get users following an organization
@optional {id: str=ministry-of-agriculture # The id or name of the organization}
@returns(200) List of organization followers

@endpoint GET /action/organization_list_for_user
@desc Get organizations that a user has a given permission for
@optional {permission: str="edit_group" # The permission the user has against the returned organization}
@returns(200) List of organizations for given permission

@endpoint GET /action/organization_revision_list
@desc Get organization revisions
@optional {id: str=ministry-of-agriculture # The name or id of the organization}
@returns(200) List of an organization's revisions

@endpoint GET /action/organization_show
@desc Get details of a specific organization
@optional {id: str=ministry-of-agriculture # The id or name of the organization, include_datasets: bool=true # include a list of the organization's datasets}
@returns(200) List organization details

@endpoint GET /action/organization_list
@desc Get names of all organizations
@optional {offset: int=0 # The offset (index) of the first organizations to return, limit: int=100 # The number of organizations to be returned per page}
@returns(200) List of organizations

@endpoint GET /action/organization_autocomplete
@desc Get names of organizations that match a query string
@optional {q: str=ministry # The string to search for, limit: int=20 # The maximum number of organizations to return (optional)}
@returns(200) List of organizations

@endpoint GET /action/resource_search
@desc Find resources
@optional {query: str=format:csv # The search criteria string or list of strings of the form ``{field}:{term1}``, fields: str # Depreciated, order_by: str # A field on the resource model that orders the results, offset: int=0 # Apply an offset to the query, limit: int=0 # Apply a limit to the query}
@returns(200) Search for resources

@endpoint GET /action/resource_show
@desc Get metadata for a specific resource
@optional {id: str=e6c8bb1d-3726-418b-9b7e-1d97a9bbb817 # The id of the resource, include_tracking: bool=false # Add tracking information to dataset}
@returns(200) Return metadata of a resource

@endpoint GET /action/related_list
@desc Gets items related to a package (dataset)
@optional {id: str # id or name of the dataset (optional), dataset: str # Dataset dictionary of the dataset (optional), type_filter: str # The type of related item to show (optional), sort: str # The order to sort the related items in, featured: str # whether or not to restrict the results to only featured items}
@returns(200) Search for related items

@end
