I want to use the Stack Exchange API to perform research on the question/answer's body but it seems impossible.

Is that the case? If not, how do I go about doing it?

  • The /search/advanced route, added in API version 2.1, allows you to search on question bodies (not answers, alas) using the q parameter. – Brock Adams Dec 12 '18 at 21:16

In order to access the body of a post, you need to create a filter that includes this information. You create a filter using the /filters/create method:


The response from that URL will look something like this:

  "items": [{

As you can see, the new filter is identified by the string !9Tk5izFWA. You need to then pass this as the filter parameter to any request that you want to obtain the post body on.



Edit: upon further clarification, the method you are looking for is /search. The example would now become:


This example will search for all questions that contain the string "java" in the title.

  • Sorry, but I already knew that. What I ask is how to do a search like this stackoverflow.com/search?q="search query" with the api. Because the rate limiter with just stackoverflow is very low 6 per minute whereas it is 30 per seconde with the api. – taoder Jun 11 '12 at 7:29
  • @taoder: I have updated my answer now. – Nathan Osman Jun 11 '12 at 14:48
  • Thank's but sorry again, I want to search in the body not only in the title. I think the api not provide this service. – taoder Jun 11 '12 at 14:59
  • @taoder: That is correct - the API does not provide a means of searching within the post body. You could, however, use the data dumps. – Nathan Osman Jun 11 '12 at 15:02
  • Yes, I know. I do a comparison between this two method use of the api and the search engine of stackoverflow and in an other hand the use of the data dump. – taoder Jun 12 '12 at 8:02

It's impossible to search in the body with the api stackexchange.

You must log in to answer this question.

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