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.

elixenide
  • 173
  • 1
  • 1
  • 6

1 Answers1

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.)

Brock Adams
  • 12,901
  • 5
  • 38
  • 64