Filters

See API Reference for the specification of each filter. This guide explains some general principles that have been used to define the specification as well as notes about how to combine filters.

Filters are Search Intent

Although the names of query parameters may match fields found in the response, they are not directly related. All filters represent a search intention, e.g. "the user is interested in anything that happens on a Tuesday" (byDay=schema:Tuesday) rather than "the user is interested in anything with field byDay equal to schema:Tuesday". The API may combine multiple fields to determine if a session satisfies an intention-based filter.

Filters also have operators to modify the intention, e.g. "the user is interested in anything that costs less than £5" (priceAdult[lte]=5).

Filters that do not have an operator are assumed to mean "equals" for numbers, and "is one of" for strings e.g. "the user is interested in anything that is beginner or intermediate level" (levelType=imin:Beginner&levelType=imin:Intermediate).

Filter Naming Rules

Noun[operator] e.g. withpriceAdult[lte], priceAdult is the noun and lte ("Less than or equal") is the operator.

"Noun"s can be composed of multiple words. The general rule is that words are ordered from less specific to more specific (e.g. priceAdult, ageMax).

Filter Combinations

Different Filters

When different filters are combined (e.g. filtering for activityPrefLabel as well as genderRestriction), every single EventSeries in the results that are returned matches each and every different filter.

Example: activityPrefLabel=Basketball&ageRangeMin[gte]=16&genderRestriction=oa:FemaleOnly The following would be a valid session given these filters:

{
  "type": "EventSeries",
  "id": "https://search.imin.co/v2/sessions/example-dummyid#!/subEvent/2018-09-10T18:00:00Z",
  "name": "NPB Women's Basketball",
  "activity": [
    {
      "type": "Concept",
      "id": "https://openactive.io/activity-list#e09776e6-f1b4-421b-b667-5c5913cf97aa",
      // activityPrefLabel=Basketball
      "prefLabel": "Basketball"
    }
  ],
  // genderRestriction=oa:FemaleOnly
  "genderRestriction": "oa:FemaleOnly",
  "ageRange": {
    "type": "QuantitativeValue",
    // ageRangeMin[gte]=16
    // since minValue is greater than or equal to 16, this session is included
    "minValue": 16,
    "maxValue": 80
  },
  // other fields...
}

Same Filters, Multiple Values

If the same filter is used for multiple values (e.g. filtering for two activityIds), every single EventSeries in the results that are returned matches one or more of each of the values.

Example

activityPrefLabel=Tennis&activityPrefLabel=Badminton

This filter will bring back sessions with either Tennis or Badminton or both as an activity. They need not match both. The following would be a valid session:

{
  "type": "EventSeries",
  "name": "Tennis Tuesdays",
  "activity": [
    {
      "type": "Concept",
      "id": "https://openactive.io/activity-list#f2ea7405-6098-4378-b0fe-4e398a659fc4",
      "prefLabel": "Tennis",
    }
  ],
  // other fields...
}

Example

accessibilitySupportId=https%3A%2F%2Fopenactive.io%2Faccessibility-support%2367902468-fd49-4238-8650-20a22d7f0e40&accessibilitySupportId=https%3A%2F%2Fopenactive.io%2Faccessibility-support%dd026873-6713-4ea1-af5a-08901f651d98

This will return sessions with either learning impairment or physical impairment or both as the accessibilitySupport[].prefLabel.

Combinations

Both of the above kinds of combinations can occur. For example, a search with activityPrefLabel=Basketball&activityPrefLabel=Football&genderRestriction=oa:FemaleOnly will only include items that:

  • Have activity of either Basketball or Football (same filter, activityPrefLabel, but with multiple values); and

  • Has gender restriction of female only (different filters - activityPrefLabel and genderRestriction are separate filters).

Find out more...

The following pages describe more specifics about certain filters.

Last updated