Going over the API, there seems to be some overlap when it comes to expressing a predicate in a URL.

For example, let's say I want to fetch some questions from stackoverflow.com that have the tag "cocoa". According to the API, there are two ways to do it:


(ignoring required query params like the API key, of course)

Are these guaranteed to return the same results? If not, how do should I decide which endpoint to use? There are some ways I could differentiate between them, such as if the user decides to sort the results by "hotness", then I know to use the "/questions" endpoint, since "/search" doesn't support the hotness sort key. But if the user wants to sort by "creation", then I've got a choice.

What would you do in this case? What should I do? (Right now I'm just arbitrarily picking one)

(It looks like they are returning stuff in the same order [at least, according to stackapi.com], but I'm wondering about a guarantee...)


/search is generally slower than /questions. You should use /questions unless you need one of the parameters on /search.

That said, ignoring caching differences, those two queries are equivalent.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .