Categories
info
Read more in the API documentation for the categories
endpoint.
The categories
endpoint has full support, including query validation.
Endpoint | Function | Client method | Filters class |
---|---|---|---|
"categories" | categories | Client.categories | CategoriesFilters |
Usage
- Sync
- Async
Using top-level functions
import bavapi
result = bavapi.categories("TOKEN", name="Soap")
Using Client asynchronously
import bavapi
async with bavapi.Client("TOKEN") as bav:
result = await bav.categories(name="Soap")
Available filters in function calls
These filters are available directly within the function/method:
- Positional filters:
name
,sector
- Keyword filters:
category_id
For other filters, passing an CategoriesFilters
instance to the filters
parameter is required.
Default includes
In order to provide critical information about the data retrieved from categories
, and to move its structure in line
with data downloads from the Fount or BAV's Cultural Rank Tool (CRT), some include
values are requested by default:
sector
.
# All default (sector) includes will be requested
bavapi.categories("TOKEN", name="All Adults")
To suppress default includes, set include
to "no_default"
.