3

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.

1
  • 1
    Note that the /search paths are the only ones that allow much text searching and they omit answers by design. Commented Mar 5, 2014 at 22:42

1 Answer 1

2

I forget when, but sometime in the last couple of years, the /search/excerpts route started allowing is:answer in the q parameter.

For example:
          /2.2/search/excerpts?&q=Hear! is:answer&site=stackapps

-- which returns Stack Apps answers with the text "Hear!" in the body.

(Pretty sure I tested this in early 2014, and it didn't work then. But, other parts of the API have stealthily changed.)

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.