Category Counts API

Returns a list of category IDs with their corresponding names and the number of events for the time period specified, where each event cost is less than or equal to the price argument.

Location

https://calendar.byu.edu/api/CategoryCounts

Example: https://calendar.byu.edu/api/CategoryCounts?event[min][date]=2017-04-01&event[max][date]=2017-04-30&price=5

Parameters

Parameter
Description
event[min][date]
(Optional) The starting date of the time period (in the format yyyy-mm-dd).
event[max][date]
(Optional) The ending date of the time period (in the format yyyy-mm-dd).
price
(Optional) The max price. Provide an integer or decimal. Free events and events without tickets will always be included.

NOTE: If either a min or a max date is provided, but not the other, all events for each category get returned regardless of min/max date argument.

Example: https://calendar.byu.edu/api/CategoryCounts?event[min][date]=2017-04-01&price=5

 

Return Values

Name
Description
CategoryId
 
CategoryName
 
Count
The number of events for the specified time period

 

Return Format

XML is returned by default, but the format can be specified explicitly in the URL.

XML Example

https://calendar.byu.edu/api/CategoryCounts.xml?event[min][date]=2017-04-01&event[max][date]=2017-04-30&price=5

 

JSON Example

https://calendar.byu.edu/api/CategoryCounts.json?event[min][date]=2017-04-01&event[max][date]=2017-04-30&price=5

 

Changes

This API used to include all categories. Now, events include main categories (listed by this API) as well as department categories, tags, and a 'Featured on the Homepage' tag. All Category Counts API returns all of these categories.

Old Value
New Value
Note
<CategoryCountViewModel>
<item>
This is the wrapper around each category. Only the name of the tag has changed.

 

New Values

  • CategoryName