Thoughts on Search and APIs
Published:
Searching and APIs
-
APIs that are a subset of search
Often an API is a subset of search. Anytime a user of the API gets a list of items back matching some criteria, it might be a search query written as an API call. One can often turn search queries into an API call. For example, give me objects that were created on day X (date: xx/yy/zzzz).
So some API calls have a corresponding search query.List<ObjectType> getObjectsCreatedOn(Date someDay) -
Search is a desired/required feature
If users want to search some criteria to display, debug or measure datasets, then they may want a search API. It's better to have the search API early to leverage it later on, when it's worthwile. -
One search API vs many equivalent API calls
One can reduce many equivalent API calls to a single search API. One still needs typing for the search result objects and potentially transforming objects from a serialized form to a reified form (e.g. bytes -> plain old objects).