Skip to main content
Events Calendar

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

ParameterDescription
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

NameDescription
CategoryId
CategoryName
CountThe 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

XML_3.png

JSON Example

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

JSON_7.png

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 ValueNew ValueNote
<CategoryCountViewModel><item>This is the wrapper around each category. Only the name of the tag has changed.

New Values

  • CategoryName