Searching by Activity
Allowing the end user to easily search by activity type is very useful. A lot of the time we get asked if there is a way to reduce the number of activities returned by our API to make the search functionality on the front end more intuitive - this is because when an API call returns tens to hundreds of thousands of items, there can be a lot of different activity types from the Activity List returned. It is, however, possible to reduce the number of activities returned in the following three ways:
1. Reduce the Number of Activities Returned
The easiest way to reduce the number of activities that appear in after a search is to use a smaller radius in geo[radial]
. This can be achieved by asking the end user upfront where they want to focus their search. Once you have the coordinates, you can restrict the radius and receive a more manageable number of results.
2. Filter by the Parent Activities
Another way is to filter on topConceptOf
in the imin:facet
s listed at the bottom of the API results to only show those top concepts listed in https://activity-list.openactive.io/en/hierarchical_concepts.html; or
3. Filter on imin:resultCount
imin:resultCount
The final way to filter on imin:facet.imin:index.activity.imin:item[].imin:resultCount
in order to show the e.g. top 10 prefLabel
s with the highest number of associated items.
Last updated