University of Wisconsin–Madison

Filters and Searches

Filters and searches in the Locations API

There are two main ways to find particular locations within the Locations API: filters and searches.

Filters will look for a particular value in one particular attribute. You need to have the entire value of the attribute – there are no partial matches. Use these if you have a pretty good idea what you’re looking for.

Searches will look for locations that contain one or more words from your query in one or more of their attributes. Use these if you’re not quite sure what you’re looking for.

Both filters and searches are passed along with your request as query parameters.

Basic attribute filters

A basic attribute filter looks like this:

https://api.wisc.edu/locations?filter[referenceId]=LCMSN_0050

The prefix filter marks this parameter as a filter. This is always followed by a set of square brackets, inside which is the name of the attribute you want to apply the filter to.

You can use basic filters like this on any attribute, and you can use as many as you like at once. For example:

https://api.wisc.edu/locations?filter[type]=Building&filter[addressMunicipality]=Madison

…would get you all the buildings in the city of Madison.

If you specify a single attribute multiple times, you’ll get all the locations that match any of the values you specified. For example:

https://api.wisc.edu/locations?filter[referenceId]=LCMSN_0050&filter[referenceId]=LCMSN_0002&filter[referenceId]=LCMSN_0042

…would get you all the locations with a reference ID of LCMSN_0050, LCMSN_0002, or LCMSN_0042.

Hierarchy attributes

You may want to get all of the sublocations within a particular location. To do this, filter on one of the superior location attributes:

Attribute nameDescription
superiorLocationIdA location’s immediate superior location. For example, the immediate superior location of a room is either the building it’s in, or the floor it’s part of. Because some but not all locations use floors, this is not a good way to get all the rooms within a building.
superiorBranchCampusIdIf the location is part of a branch campus, this will point to the branch campus it belongs to. For locations not belonging to a branch campus, this will be empty.
superiorCampusIdThe campus (not branch campus) this location belongs to. For locations belonging to branch campuses, this value will point to the parent campus of their branch.
superiorBuildingIdThe building or non-building this location belongs to. Empty for buildings, non-buildings, campuses, and branch campuses.
superiorFloorIdThe floor this location belongs to. Empty for all locations except rooms.

For example, to get all the locations at the Rock County branch of UW-Whitewater:

https://api.wisc.edu/locations?filter[superiorBranchCampusId]=LCWTW_RCK

Or, to get all the rooms that can be used as work spaces within Bascom Hall:

https://api.wisc.edu/locations?filter[superiorBuildingId]=LCMSN_0050&filter[type]=Room&filter[usages]=WORK SPACE

Date filters

There are several date attributes available for locations:

  • inactiveDate
  • workdayCreatedOn
  • workdayDateOfLastChange

Sometimes there’s one exact value you’re looking for, but often you’ll need to filter for dates after or before a particular date, or from a range of dates. For this, you can use filter operators.

?filter[inactiveDate:greaterThan]=2026-01-01
        ^^^^^^^^^^^^ ^^^^^^^^^^^
      Attribute name Operator

Operators are placed inside the filter square brackets and are separated from the attribute name by a colon. Only date fields support operators. The operators available are:

  • greaterThan
  • greaterThanOrEqual
  • lessThan
  • lessThanOrEqual
  • between

The value must be a data, or in the case of the between operator, two dates separated by a comma. Examples:

# locations inactivated before 2025
https://api.wisc.edu/locations?filter[inactiveDate:lessThan]=2025-01-01

# locations updated since Feb 1
https://api.wisc.edu/locations?filter[wdDateOfLastChange:greaterThanOrEqual]=2026-02-01

# locations created during January 2026
https://api.wisc.edu/locations?filter[wdCreatedOn:between]=2026-01-01,2026-01-31

Searches

Searches are a less restrictive way of finding locations. If you know part of the name of a building, or part of any attribute, you can search for it:

https://api.wisc.edu/locations?search=Bascom

This will return all locations with “Bascom” anywhere in any of their attributes. This would include Bascom Hall, but also North Hall and South Hall (since their address is on Bascom Mall).

You can include multiple terms in a single search string, and you’ll get locations that match either of them:

https://api.wisc.edu/locations?search=Bascom Babcock

Your search term needs to match the full value of one of the words in an attribute. This will return no results because it doesn’t include the whole word:

https://api.wisc.edu/locations?search=Basc