Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I use the API to search for answers containing particular text or with particular properties? For example, this link allows me to search for is:answer foo, that is, answers containing foo. Can I do this with the current API?

Note: I have already searched the documentation, but didn't find anything like this.

share|improve this question
I don't think you can do this. The API allows limited searching of question text, but nothing similar for answers that I've ever seen. You may have to resort to scraping the live page or, if data that lags by 1 to 5 weeks is okay, using SEDE queries. – Brock Adams Mar 5 '14 at 22:30
Note that the /search paths are the only ones that allow much text searching and they omit answers by design. – Brock Adams Mar 5 '14 at 22:42
Thanks, Brock. Your first comment was what I was afraid of, and your second is spot-on. Make them into an answer and I will gladly accept it. – Ed Cottrell Mar 5 '14 at 23:04
Thanks, I'll make it into an answer in a week or so (if I remember), if nothing better comes along. I'm hoping one of the developers will come through in this case. You might also make a feature request if they don't. – Brock Adams Mar 6 '14 at 0:01
Confirmed that the new /search/excerpts route allows you to search answers too. Unfortunately, you still can't limit results to only answers. – Brock Adams Jul 26 '14 at 5:52

You must log in to answer this question.

Browse other questions tagged .