Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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

share|improve this answer
add comment

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:

http://api.stackexchange.com/2.0/filters/create?include=question.body;answer.body

The response from that URL will look something like this:

{
  "items": [{
    "filter":"!9Tk5izFWA",
  ...
}

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.

Example:

http://api.stackexchange.com/2.0/questions?site=stackoverflow&filter=!9Tk5izFWA


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

http://api.stackexchange.com/2.0/search?site=stackoverflow&filter=!9Tk5izFWA&intitle=java

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

share|improve this answer
    
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
add comment

You must log in to answer this question.

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