20

You can fetch a question by providing its id, via SO's API. See this page, for more information.

However, the returned JSON, has no body containing the actual text of the question. Is it by design? Am I following a wrong path?

3 Answers 3

26

body=true doesn't seem to work with the 2.1 API, but you can add filter=withbody:

https://api.stackexchange.com/2.1/questions/113204?site=meta.stackoverflow&filter=withbody

Or you create a custom filter that includes the body.

3
  • there is some discussion about your lack of user name - meta.stackexchange.com/questions/195798/…
    – apaul
    Sep 4, 2013 at 20:22
  • The first link does not work, it returns zero. Can I have a filter=withlink? This seems also good for comments. How does the customer filter work regarding withbody? At the bottom: withbody, which is default plus the *.body fields Nov 20, 2020 at 19:08
  • I look for the body AND title. How would this work? Is there a withtitle? Jan 17, 2021 at 11:41
10

Recently, the Stack Exchange API has been upgraded to v2.2. So the earlier answers cannot work now. The query should be:

https://api.stackexchange.com/2.2/questions/43225521?&site=stackoverflow&filter=withbody

Related documents can be seen in the page.

1
  • I look for the body AND link of Comments. How would this work? Nov 18, 2020 at 15:19
7

Another parameter is needed...

3
  • OMG, stupid me. How on earth I didn't see that. :(. Thanks @Bobby. Nov 22, 2011 at 11:18
  • For whatever reason, I rejoice in the clarity and rigor of your image-only answer.
    – dakab
    Apr 7, 2017 at 7:00
  • this is no longer correct. body is no longer listed as a parameter
    – gman
    Aug 4, 2017 at 18:07

You must log in to answer this question.

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